ggm.generator: Simulate Data from Gaussian Graphical Model

Description Usage Arguments Value Note Examples

View source: R/GGM_generator.R

Description

Produce one or more samples from the specified Gaussian graphical model.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

gif documentation built on July 1, 2020, 8:53 p.m.