rmvnorm: Draw from a Multivariate Normal

View source: R/STMfunctions.R

rmvnormR Documentation

Draw from a Multivariate Normal

Description

A basic function for doing multivariate normal simulations via the cholesky decomposition of the covariance matrix. Function is based on one by Peter Hoff.

Usage

rmvnorm(n, mu, Sigma, chol.Sigma = chol(Sigma))

Arguments

n

number of draws

mu

the K-dimensional mean

Sigma

the K by K dimensional positive definite covariance matrix

chol.Sigma

the cholesky decomposition of the Sigma matrix.

Details

This is a pretty standard multivariate normal generator. It could almost certainly be faster if we ported it over to RcppArmadillo but it isn't used a ton at the moment.


bstewart/stm documentation built on Jan. 3, 2024, 6:58 p.m.