Learn R Programming

lgarch (version 0.2)

rmnorm: Multivariate normal random number generation

Description

Similar to the rmnorm function from the mnormt package, but slightly faster.

Usage

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

Arguments

n
number of observations
mean
vector of means
vcov
variance-covariance matrix

Value

  • A matrix with the random numbers

Details

Empty

See Also

mlgarchSim, rnorm, chol

Examples

Run this code
##generate from 2-dimensional multivariate normal
##(standardised and independent variables):
y <- rmnorm(100, vcov=diag(c(1,1)))

##generate from 2-dimensional multivariate normal
##(standardised and dependent variables):
y <- rmnorm(100, vcov=cbind(c(1,0.5),c(0.5,1)))

##generate from 3-dimensional multivariate normal
##(independent variables with variances 1, 2 and 3):
y <- rmnorm(100, vcov=diag(c(1,2,3)))

Run the code above in your browser using DataLab