draw_mvnorm: Draw a sample from a multivariate normal distribution

View source: R/sim.R

draw_mvnormR Documentation

Draw a sample from a multivariate normal distribution

Description

Draw a sample from a multivariate normal distribution with specified mean and covariance.

Usage

draw_mvnorm(mean = NULL, Sigma = NULL, L = NULL)

Arguments

mean

mean vector, defaults to 0 vector

Sigma

covariance matrix

L

optional cholesky factor of Sigma

Details

One of Sigma or L must be provided. Pre-computing L with L = t(chol(Sigma)) will make calling this function repeatedly much faster.

Value

A vector giving one draw from the specified multivariate normal distribution.


biobakery/anpan documentation built on Jan. 3, 2025, 9:11 a.m.