draw_normal: Simulate one draw from a multivariate normal distribution

Description Usage Arguments Details Value Examples

Description

Simulate one draw from a multivariate normal distribution

Usage

1
draw_normal(mu, Sigma_inv)

Arguments

mu

A numeric vector, the mean of the distribution.

Sigma_inv

A numeric matrix, the precision matrix (inverse of the of the variance-covariance matrix) of the distribution

Details

Uses the Cholesky decomposition of Sigma_inv.

Value

A column vector containing the draw.

Examples

1
2
M <- matrix(c(1, 0.5, 0.5, 1), 2, 2)
draw_normal(c(0, 0), solve(M))

fditraglia/zoofactr documentation built on May 16, 2019, 12:12 p.m.