Description Usage Arguments Details Value Author(s) See Also Examples
The argument z
can be used to specify cluster allocations. If
left missing then the usual marginal likelihood is computed, else it is
computed conditional on the clusters (this is equivalent to the product
of marginal likelihoods across clusters)
1 2  marginalNIW(x, xbar, samplecov, n, z, g, mu0=rep(0,ncol(x)),
nu0=ncol(x)+4, S0, logscale=TRUE)

x 
Data matrix (individuals in rows, variables in
columns). Alternatively you can leave missing and specify

xbar 
Either a vector with column means of 
samplecov 
Either the sample covariance matrix 
n 
Either an integer indicating the sample size 
z 
Optional argument specifying cluster allocations 
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 logposterior density 
The function computes
p(x)= int p(x  mu,Sigma) p(mu,Sigma) dmu dSigma
where p(x[i])= N(x[i]; mu,Sigma) iid i=1,...,n
p(mu  Sigma)= N(mu; mu0, g Sigma) p(Sigma)= IW(Sigma; nu0, S0)
If z
is missing the integrated likelihood under a NormalIW
prior. If z
was specified then the product of integrated
likelihoods across clusters
David Rossell
dpostNIW
for the posterior NormalIW density.
1 2 3 4 5 6 7 8 9  #Simulate data
x= matrix(rnorm(100),ncol=2)
#Integrated likelihood under correct model
marginalNIW(x,g=1,nu0=4,log=FALSE)
#Integrated likelihood under random cluster allocations
z= rep(1:2,each=25)
marginalNIW(x,z=z,g=1,nu0=4,log=FALSE)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.