rmvnorm: Generate multivariate Normals

Description Usage Arguments Details Value See Also Examples

View source: R/multivariatenormal.R

Description

Function to generate draws from a multivariate Normal distribution.

Usage

1
rmvnorm(n, mean, covariance)

Arguments

n

is the number of desired samples

mean

is the mean vector

covariance

is the covariance matrix

Details

This function does not check anything (i.e. that the given covariance is PSD). Thus it is faster than functions in standard packages, but more risky.

Value

a n x d matrix where d is both the length of mean and the dimension of covariance. Each row contains a draw from the desired multivariate Normal.

See Also

rmvnorm_cholesky, dmvnorm, dmvnorm_cholesky_inverse

Examples

1
rmvnorm(10, rep(0, 5), diag(1, 5, 5))

pierrejacob/PET documentation built on May 25, 2019, 11:35 p.m.