inferenceJointGaussian: Inference in joint Gaussian distribution

Description Usage Arguments Value Examples

View source: R/Gaussian_Inference.r

Description

For the model structure

x1,x2|mu,Sigma \sim Gaussian(mu,Sigma)

x1|x2,mu,Sigma \sim Gaussian(mu12,Sigma12)

Usage

1
inferenceJointGaussian(x2, mu, Sigma = NULL, Precision = NULL)

Arguments

x2

numeric, an sample of X2, satisfying length(x2)<D, D is the dimension of the joint distribution.

mu

numeric, length D mean vector. mu=c(mu_X1,mu_X2)/.

Sigma

DxD covariance matrix. At least one of Sigma and Precision should be non-NULL.

Precision

DxD precision matrix, satisfying Precision = inverse(Sigma). At least one of Sigma and Precision should be non-NULL.

Value

A named list containing the conditional mean and covariance matrix.

Examples

1
2
3
4
5
6
tmp <- matrix(runif(100),20,5)
S <- crossprod(tmp)                 #some synthetic covariance matrix
P <- solve(S)
m <- runif(5)
x2 <- runif(3)
inferenceJointGaussian(x2 = x2,mu = m,Precision = P)

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