powered by
Speed up the use of MASS::mvrnorm.
MASS::mvrnorm
genr8(n = 1, R = diag(10), mean = rep(0, ncol(R)), ...)
A data frame of size n by ncol(R).
n
ncol(R)
the number of samples required.
a positive-definite symmetric matrix specifying the covariance matrix of the variables.
an optinal vector giving the means of the variables. Default is 0.
arguments for MASS::mvrnorm(), such as tol, empirical, and EISPACK.
MASS::mvrnorm()
tol
empirical
EISPACK
set.seed(19) R <- caron2016$mat1 mydata <- genr8(n = nrow(R)+1, R = R, empirical = TRUE) round(mydata, 2) round(cov(mydata), 2)
Run the code above in your browser using DataLab