logpost.cat {cat} | R Documentation |
Log-posterior density for incomplete categorical data
Description
Calculates the observed-data loglikelihood or log-posterior density for incomplete categorical data under a specified value of the underlying cell probabilities, e.g. as resulting from em.cat or ecm.cat.
Usage
logpost.cat(s, theta, prior)
Arguments
s |
summary list of an incomplete categorical dataset created by the
function |
theta |
an array of cell probabilities of dimension |
prior |
optional vector of hyperparameters for a Dirichlet prior distribution. The default is a uniform prior distribution (all hyperparameters = 1) on the cell probabilities, which will result in evaluation of the loglikelihood. If structural zeros appear in the table, a prior should be supplied with NAs in those cells and ones (or other hyperparameters) elsewhere. |
Details
This is the loglikelihood or log-posterior density that ignores the missing-data mechanism.
Value
the value of the observed-data loglikelihood or log-posterior density
function at theta
References
Schafer (1996) Analysis of Incomplete Multivariate Data. Chapman & Hall. Section 7.3.
See Also
Examples
data(older) # load data
older[1:2,c(1:4,7)] # see partial content; older.frame also
# available.
s <- prelim.cat(older[,1:4],older[,7]) # preliminary manipulations
m <- c(1,2,0,3,4) # margins for restricted model
thetahat1 <- ecm.cat(s,margins=m) # mle
logpost.cat(s,thetahat1) # loglikelihood at thetahat1