GaussianNIW {bbricks}R Documentation

Create objects of type "GaussianNIW".


Create an object of type "GaussianNIW", which represents the Gaussian-Normal-Inverse-Wishart (Gaussian-NIW) conjugate structure:

mu,Sigma|m,k,v,S \sim NIW(m,k,v,S)

x|mu,Sigma \sim Gaussian(mu,Sigma)

Where NIW() is the Normal-Inverse-Wishart distribution, Gaussian() is the Gaussian distribution. See ?dNIW and dGaussian for the definitions of these distribution.
This object will be used as a place for recording and accumulating information in the related inference/sampling functions such as posterior(), posteriorDiscard(), MAP(), marginalLikelihood(), dPosteriorPredictive(), rPosteriorPredictive() and so on.


  objCopy = NULL,
  ENV = parent.frame(),
  gamma = list(m = 0, k = 1, v = 2, S = 1)



An object of type "GaussianNIW". If "objCopy" is not NULL, the function create a new "GaussianNIW" object by copying the content from objCopy, otherwise this new object will be created by using "ENV" and "gamma". Default NULL.


environment, specify in which environment the object will be created.


list, a named list of NIW parameters, gamma=list(m,k,v,S). Where gamma$m is a numeric "location" parameter; gamma$S is a symmetric positive definite matrix representing the "scale" parameters; gamma$k and gamma$v are numeric values.


An object of class "GaussianNIW".


Murphy, Kevin P. "Conjugate Bayesian analysis of the Gaussian distribution." def 1.22 (2007): 16.

Gelman, Andrew, et al. "Bayesian Data Analysis Chapman & Hall." CRC Texts in Statistical Science (2004).

See Also

posterior.GaussianNIW,posteriorDiscard.GaussianNIW,MAP.GaussianNIW,MPE.GaussianNIW,marginalLikelihood.GaussianNIW,rPosteriorPredictive.GaussianNIW,dPosteriorPredictive.GaussianNIW ...


obj <- GaussianNIW(gamma=list(m=c(0,1),k=0.0001,v=2,S=diag(2)))
obj #print the content

[Package bbricks version 0.1.4 Index]