dpostNIW evalutes the posterior Normal-IWishart density at (mu,Sigma).
rpostNIW draws independent samples.
This posterior corresponds to a Normal model for the data
dpostNIW returns the Normal-IW posterior density evaluated at
(mu,Sigma).
rpostNIW returns a list with two elements. The first element are
posterior draws for the mean. The second element are posterior draws for
the covariance (or its inverse if precision==TRUE). Only
lower-diagonal elements are returned (Sigma[lower.tri(Sigma,diag=TRUE)]).
Arguments
mu
Vector of length p
Sigma
p x p positive-definite covariance matrix
x
n x p data matrix (individuals in rows, variables in columns)
g
Prior dispersion parameter for mu
mu0
Prior mean for mu
nu0
Prior degrees of freedom for Sigma
S0
Prior scale matrix for Sigma, by default set to I/nu0
logscale
set to TRUE to get the log-posterior density
n
Number of samples to draw
precision
If set to TRUE, samples from the precision
matrix (inverse of Sigma) are returned instead
Author
David Rossell
See Also
diwish for the inverse Wishart prior density,
marginalNIW for the integrated likelihood under a
Normal-IW prior