Learn R Programming

bbricks (version 0.1.4)

inferenceJointGaussian: Inference in joint Gaussian distribution

Description

For the model structure $$x1,x2|mu,Sigma \sim Gaussian(mu,Sigma)$$ $$x1|x2,mu,Sigma \sim Gaussian(mu12,Sigma12)$$

Usage

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

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab