# LinearGaussianGaussian: Create objects of type "LinearGaussianGaussian". In bbricks: Bayesian Methods and Graphical Model Structures for Statistical Modeling

## Description

Create an object of type "LinearGaussianGaussian", which represents the Linear Gaussian and Gaussian conjugate structure:

x \sim Gaussian(A z + b, Sigma)

z \sim Gaussian(m,S)

Where Sigma is known. A is a m x n matrix, x is a m x 1 random vector, z is a n x 1 random vector, b is a n x 1 vector. 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

 ```1 2 3 4 5``` ```LinearGaussianGaussian( objCopy = NULL, ENV = parent.frame(), gamma = list(Sigma = 1, m = 0, S = 1) ) ```

## Arguments

 `objCopy` an object of type "LinearGaussianGaussian". If "objCopy" is not NULL, the function create a new "LinearGaussianGaussian" 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 z.

## Value

An object of class "LinearGaussianGaussian".

## References

Murphy, Kevin P. Machine learning: a probabilistic perspective. MIT press, 2012.

`posterior.LinearGaussianGaussian`,`posteriorDiscard.LinearGaussianGaussian`,`MAP.LinearGaussianGaussian`,`MPE.LinearGaussianGaussian`,`marginalLikelihood.LinearGaussianGaussian`,`rPosteriorPredictive.LinearGaussianGaussian`,`dPosteriorPredictive.LinearGaussianGaussian`.
 ```1 2 3``` ```obj <- LinearGaussianGaussian(gamma=list(Sigma=matrix(c(2,1,1,2),2,2), m=c(0.2,0.5,0.3),S=diag(3))) obj #print the content ```