Learn R Programming

mvtnorm (version 1.3-1)

margcond: Marginal and Conditional Multivariate Normal Distributions

Description

Computes means and Cholesky factors of covariance or precision matrices of multiple multivariate normal distributions.

Usage

marg_mvnorm(chol, invchol, which = 1L)
cond_mvnorm(chol, invchol, which_given = 1L, given, center = FALSE)

Value

A named list.

Arguments

chol

Cholesky factors of covariance matrices as ltMatrices object, length is recylced to length of lower and upper.

invchol

Cholesky factors of precision matrices as ltMatrices object, length is recylced to length of lower and upper. Either chol or invchol must be given.

which

names or indices of elements those marginal distribution is of interest.

which_given

names or indices of elements to condition on.

given

matrix of realisations to condition on (number of rows is equal to length(which), the number of columns corresponds to the number of matrices in chol or invchol.

center

logical, if TRUE, the negative rescaled conditional mean is returned (such that it can be specified as center argument to slpmvnorm). By default, the conditional mean is returned.

Details

Derives parameters of the requested marginal or conditional distributions, defined by chol (Cholesky factor of covariance) or invchol (Cholesky factor of precision matrix) and, for conditional distributions, the mean.

More details can be found in the lmvnorm_src package vignette.

See Also

vignette("lmvnorm_src", package = "mvtnorm")