log.posterior.lcm {lca}R Documentation

Find Log-Posterior or Log-Likelihood values for Latent Class Models

Description

Functions give log of posterior (or likelihood) values for particular parameter values and data in a Latent Class Model.

Usage

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)

Arguments

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.

Details

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.

Value

A single numeric value.

Author(s)

Robin Evans

References

Goodman, L.A. (1974) - Exploratory Latent Structure Analysis Using Both Identifiable and Unidentifiable Models, Biometrika, Vol. 61 (2), pp 215-331.

Examples

data(question)

out = lcaMLE(question, 2)
loglik.lcm(question, out$theta, out$eta)

[Package lca version 0.2 Index]