Learn R Programming

lgarch (version 0.6-2)

rmnorm: Random number generation from the multivariate normal distribution

Description

This function is a speed-optimised version of the rmnorm function from the mnormt package of Adelchi Azzalini (2013).

Usage

rmnorm(n, mean = NULL, vcov = 1)

Arguments

n
integer, the number of observations to generate
mean
numeric vector, i.e. the mean values
vcov
numeric matrix, i.e. the variance-covariance matrix

Value

Details

Empty

References

Adelchi Azzalini (2013): 'mnormt: The multivariate normal and t distributions', R package version 1.4-7, http://CRAN.R-project.org/package=mnormt

Examples

Run this code
##generate from univariate standardised normal:
z1 <- rmnorm(100)

##generate from bivariate, independent standardised normal:
z2 <- rmnorm(100, vcov=diag(c(1,1)))

##generate from bivariate, dependent standardised normal:
z3 <- rmnorm(100, vcov=cbind(c(1,0.3),c(0.3,1)))

Run the code above in your browser using DataLab