genr8 {Rnest} | R Documentation |
Simplify the the generation from a multivariate normal distributions.
Description
Speed up the use of MASS::mvrnorm
.
Usage
genr8(n = 1, R = diag(10), mean = rep(0, ncol(R)), ...)
Arguments
n |
the number of samples required. |
R |
a positive-definite symmetric matrix specifying the covariance matrix of the variables. |
mean |
an optinal vector giving the means of the variables. Default is 0. |
... |
arguments for |
Value
A data frame of size n
by ncol(R)
.
Examples
set.seed(19)
R <- caron2016$mat1
mydata <- genr8(n = nrow(R)+1, R = R, empirical = TRUE)
round(mydata, 2)
round(cov(mydata), 2)
[Package Rnest version 1.2 Index]