qpSampleMvnorm {qpgraph} | R Documentation |
Samples independent observations from a multivariate normal distribution with a given mean vector and a given concentration matrix.
qpSampleMvnorm(K, N, mean = rep(0, nrow(K)))
K |
concentration matrix of the multivariate normal distribution. |
N |
number of observations to sample. |
mean |
mean vector of the multivariate normal distribution. |
This function requires the mvtnorm
package. This function is designed
to be used to sample multivariate normal observations from a randomly
generated concentration matrix that has a zero-structure reflecting the
conditional independencies from a, possibly also randomly generated, undirected
graph. The function qpI2K
can be employed to obtain such a
concentration matrix.
A matrix where rows correspond to observations and columns to random variables.
R. Castelo and A. Roverato
Castelo, R. and Roverato, A. A robust procedure for Gaussian graphical model search from microarray data with p larger than n. J. Mach. Learn. Res., 7:2621-2650, 2006.
nVar <- 50 # number of variables maxCon <- 5 # maximum connectivity per variable nObs <- 30 # number of observations to simulate I <- qpRndGraph(n.vtx=nVar, n.bd=maxCon) K <- qpI2K(I) X <- qpSampleMvnorm(K, nObs) dim(X)