ggm.generator {gif} | R Documentation |
Simulate Data from Gaussian Graphical Model
Description
Produce one or more samples from the specified Gaussian graphical model.
Usage
ggm.generator(n, Omega)
Arguments
n |
The number of samples required. |
Omega |
The inverse covariance matrix of the specified Gaussian graphical model. |
Value
A numeric matrix with n
rows and p
variables where p
corresponds to the dimension of Omega
.
Note
Omega
should be positive definite.
Examples
library(gif)
set.seed(1)
n <- 200
p <- 100
Omega <- diag(1, p, p)
for(i in 1:(p - 1)) {
Omega[i, i + 1] <- 0.5
Omega[i + 1, i] <- 0.5
}
x <- ggm.generator(n, Omega)
[Package gif version 0.1.1 Index]