logpost.norm: Observed-data log-posterior for normal data

View source: R/norm.R

logpost.normR Documentation

Observed-data log-posterior for normal data


Evaluates the log of the observed-data posterior density at a user-supplied value of the parameter. Assumes a normal-inverted Wishart prior. This function is useful for monitoring the progress of EM and data augmentation.


logpost.norm(s, theta, prior)



summary list of an incomplete normal data matrix created by the function prelim.norm.


vector of normal parameters expressed on transformed scale in packed storage, such as one produced by the function em.norm.


optional prior distribution. This is a list containing the hyperparameters of a normal-inverted Wishart distribution. In order, the elements of the list are: tau (a scalar), m (a scalar), mu0 (a vector of length ncol(x), where x is the original matrix of incomplete data), and lambdainv (a matrix of dimension c(ncol(x),ncol(x))). The elements of mu0 and lambdainv apply to the data after transformation, i.e. after the columns have been centered and scaled to have mean zero and variance one. If no prior is supplied, the default is the usual noninformative prior for a multivariate normal model: tau=0, m=-1, mu0=arbitrary, and lambdainv = matrix of zeros.


value of the observed-data log-posterior density


See Section 5.3.5 of Schafer (1996)

See Also

prelim.norm and loglik.norm


s <- prelim.norm(mdata)   #do preliminary manipulations
prior <- list(0,.5,rep(0,ncol(mdata)),
   .5*diag(rep(1,ncol(mdata)))) #ridge prior with .5 df
thetahat <- em.norm(s,prior=prior)   #compute posterior mode
logpost.norm(s,thetahat,prior)  #log-posterior at mode

norm documentation built on April 4, 2022, 1:06 a.m.

Related to logpost.norm in norm...