qpSampleMvnorm {qpgraph} | R Documentation

## Sample multivariate normal observations

### Description

Samples independent observations from a multivariate normal distribution with a given mean vector and a given concentration matrix.

### Usage

    qpSampleMvnorm(K, N, mean = rep(0, nrow(K)))

### Arguments

`K` | concentration matrix of the multivariate normal distribution.
`N` | number of observations to sample.
`mean` | mean vector of the multivariate normal distribution.

### Details

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.

### Value

A matrix where rows correspond to observations and columns to random variables.

### Author(s)

R. Castelo and A. Roverato

### References

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.

### See Also

`qpI2K`

### Examples

    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)

[Package qpgraph version 1.0.0 Index]