rPosterior.GaussianNIW {bbricks}R Documentation

Generate ramdom samples from the posterior distribution of a "GaussianNIW" object

Description

Generate random samples from the posterior distribution of the following 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.
The model structure and prior parameters are stored in a "GaussianNIW" object.
Posterior distribution is NIW(mu,Sigma|m,k,v,S).

Usage

## S3 method for class 'GaussianNIW'
rPosterior(obj, ...)

Arguments

obj

A "GaussianNIW" object.

...

Additional arguments to be passed to other inherited types.

Value

list(mu,Sigma), where mu is a numeric vector, Sigma is a symmetric positive definite matrix.

See Also

GaussianNIW, dPosterior.GaussianNIW

Examples

obj <- GaussianNIW(gamma=list(m=c(0,0),k=1,v=2,S=diag(2)))
rPosterior(obj = obj)

[Package bbricks version 0.1.4 Index]