rPosterior.LinearGaussianGaussian: Posterior random generation of a "LinearGaussianGaussian"...

Description Usage Arguments Value See Also Examples

View source: R/Gaussian_Inference.r

Description

Generate random samples from the posterior distribution of the following structure:

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

z \sim Gaussian(m,S)

Where Sigma is known. A is a dimx x dimz matrix, x is a dimx x 1 random vector, z is a dimz x 1 random vector, b is a dimm x 1 vector. Gaussian() is the Gaussian distribution. See ?dGaussian for the definition of Gaussian distribution.
The model structure and prior parameters are stored in a "LinearGaussianGaussian" object.
Posterior distribution is Gaussian(z|m,S).

Usage

1
2
## S3 method for class 'LinearGaussianGaussian'
rPosterior(obj, n = 1, ...)

Arguments

obj

A "LinearGaussianGaussian" object.

n

integer, number of samples.

...

Additional arguments to be passed to other inherited types.

Value

A matrix of n rows, each row is a sample of z.

See Also

LinearGaussianGaussian, dPosterior.LinearGaussianGaussian

Examples

1
2
3
obj <- LinearGaussianGaussian(gamma=list(Sigma=matrix(c(2,1,1,2),2,2),
                                         m=c(0.2,0.5,0.6),S=diag(3)))
rPosterior(obj = obj,n=20)

bbricks documentation built on July 8, 2020, 7:29 p.m.