ddirmult {ecostate} | R Documentation |
Dirichlet-multinomial
Description
Allows data-weighting as parameter
Usage
ddirmult(x, prob, ln_theta, log = TRUE)
Arguments
x |
numeric vector of observations across categories |
prob |
numeric vector of category probabilities |
ln_theta |
logit-ratio of effective and input sample size |
log |
whether to return the log-probability or not |
Value
The log-likelihood resulting from the Dirichlet-multinomial distribution
Examples
library(RTMB)
prob = rep(0.1,10)
x = rmultinom( n=1, prob=prob, size=20 )[,1]
f = function( ln_theta ) ddirmult(x, prob, ln_theta)
f( 0 )
F = MakeTape(f, 0)
F$jacfun()(0)
[Package ecostate version 0.2.0 Index]