ddirmult | R Documentation |
Allows data-weighting as parameter
ddirmult(x, prob, ln_theta, log = TRUE)
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 |
The log-likelihood resulting from the Dirichlet-multinomial distribution
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.