sampleMVN {sparseCov} | R Documentation |
This function samples MVN based on a given covariance matrix
Description
This function samples MVN based on a given covariance matrix
Usage
sampleMVN(n, Sigma, sparse = TRUE, n_cores = 1, fastmvn = FALSE)
Arguments
n |
The sample size. |
Sigma |
The covariance matrix. |
sparse |
The indicator of sparse sampling or not. |
n_cores |
The number of cores used. |
fastmvn |
The indicator of fast sampling or not. |
Value
The data matrix sampled from the covariance matrix.
Examples
## generate data from a block diagonal covariance matrix structure
n <- 50
p <- 30
data.true.cov <- block.true.cov(p)
data <- sampleMVN(n, data.true.cov, sparse=TRUE)
data[1:10, 1:10]
[Package sparseCov version 0.0.1 Index]