log.posterior.lcm {lca} | R Documentation |
Functions give log of posterior (or likelihood) values for particular parameter values and data in a Latent Class Model.
log.posterior.lcm(dat, theta, eta, prior.theta, prior.eta, factorials = FALSE, tol = 1e-10) loglik.lcm(dat, theta, eta, factorials = FALSE, tol = 1e-10)
dat |
an object of class freq.table containing disrete data. See lca-package for details. |
theta |
vector containing latent class proportions. |
eta |
object of class lcm.params . See lca-package for details. |
prior.theta |
vector of Dirichlet prior parameters for theta . |
prior.eta |
object of class lcm.params . See lca-package for details. |
factorials |
logical values indicating whether factorial terms (which are constant in the parameter values) should be included in the calculation. If FALSE (the default), then values are correct only up to an additive constant. |
tol |
level of tolerence given to groups parameters which ought to sum to 1, or be non-negative, but which do not exactly. |
Returns the log of the posterior value (or log-likelihood) for the observations
dat
at the parameter values theta
and eta
.
If parameter values are outside the allowed range (partly determined by tol
)
then the function returns -1e10
as an arbitrary small value.
A single numeric value.
Robin Evans
Goodman, L.A. (1974) - Exploratory Latent Structure Analysis Using Both Identifiable and Unidentifiable Models, Biometrika, Vol. 61 (2), pp 215-331.
data(question) out = lcaMLE(question, 2) loglik.lcm(question, out$theta, out$eta)