Learn R Programming

bbricks (version 0.1.4)

GaussianGaussian: Create objects of type "GaussianGaussian".

Description

Create an object of type "GaussianGaussian", which represents the Gaussian and Gaussian conjugate structure: $$x \sim Gaussian(mu,Sigma)$$ $$mu \sim Gaussian(m,S)$$ Where Sigma is known. Gaussian() is the Gaussian distribution. See ?dGaussian for the definition of Gaussian distribution. The created 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.

Usage

GaussianGaussian(
  objCopy = NULL,
  ENV = parent.frame(),
  gamma = list(Sigma = 1, m = 0, S = 1)
)

Arguments

objCopy

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

ENV

environment, specify where the object will be created.

gamma

list, a named list of parameters, gamma=list(Sigma,m,S). Where gamma$Sigma is the known covariance matrix of x, gamma$m and gamma$S are the prior mean and covariance matrix of mu.

Value

An object of class "GaussianGaussian".

References

Gelman, Andrew, et al. Bayesian data analysis. CRC press, 2013.

See Also

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

Examples

Run this code
# NOT RUN {
obj <- GaussianGaussian(gamma=list(Sigma=matrix(c(2,1,1,2),2,2),m=c(0.2,0.5),S=diag(2)))
obj #print the content
# }

Run the code above in your browser using DataLab