| loglik | R Documentation | 
Computes the log-likelihood value
x must belong to a mixture family, as specified by its class.
loglik(mix, x, beta = NULL, attr = FALSE)
| mix | a discrete distribution, as defined by class
 | 
| x | a data object of a mixture model class. | 
| beta | the structural parameter, if any. | 
| attr | =FALSE, by default. If TRUE, also returns attributes "dmix" and "logd" | 
the log-likelihood value.
Yong Wang <yongwang@auckland.ac.nz>
Wang, Y. (2007). On fast computation of the non-parametric maximum likelihood estimate of a mixing distribution. Journal of the Royal Statistical Society, Ser. B, 69, 185-198.
Wang, Y. (2010). Maximum likelihood computation for fitting semiparametric mixture models. Statistics and Computing, 20, 75-86
cnm, cnmms,
npnorm, nppois, disc,
## Poisson mixture
mix0 = disc(c(1,4), c(0.7,0.3))
x = rnppois(10, mix0)
loglik(mix0, x)
## Normal mixture
x = rnpnorm(10, mix0, sd=2)
loglik(mix0, x, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.