rPosterior.GaussianGaussian: Generate ramdom samples from the posterior distribution of a...

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(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 model structure and prior parameters are stored in a "GaussianGaussian" object.
Posterior distribution is Gaussian(mu|m,S).

Usage

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

Arguments

obj

A "GaussianGaussian" 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 mu.

See Also

GaussianGaussian, dPosterior.GaussianGaussian

Examples

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

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