rmnorm | R Documentation |
This function is a speed-optimised version of the rmnorm
function from the mnormt package of Adelchi Azzalini (2013).
rmnorm(n, mean = NULL, vcov = 1)
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 |
A matrix of n rows
Genaro Sucarrat, http://www.sucarrat.net/
Adelchi Azzalini (2013): 'mnormt: The multivariate normal and t distributions', R package version 1.4-7, https://CRAN.R-project.org/package=mnormt
##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)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.