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.


stm documentation built on June 24, 2024, 5:18 p.m.