rmnorm: Random number generation from the multivariate normal...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/rmnorm.R

Description

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

Usage

1
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

Details

Empty

Value

A matrix of n rows

Author(s)

Genaro Sucarrat, http://www.sucarrat.net/

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

1
2
3
4
5
6
7
8
##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)))

Example output

Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

lgarch documentation built on May 1, 2019, 6:33 p.m.