sim.rgm {rgm}R Documentation

Simulate Data from a Random Graphical Model

Description

This function simulates data from a random graphical model. The graphical model is a Gaussian graphical model, with a mean zero vector and condition-specific precision matrices. The random graph model is a latent probit model, which includes condition-specific intercepts, a 2D latent space model and an edge specific covariate.

Usage

#sim.rgm(n = 1000, D = 2, p = 81, B = 10,
#seed = 123, mcmc_iter = 50, alpha = NULL,
#theta = NULL, loc = NULL, X = NULL)

Arguments

n

The number of observations for each environment. Default is 1000.

D

The dimension of the latent space. Default is 2.

p

The number of nodes in each graph. Default is 81.

B

The number of conditions. Default is 10.

seed

The random seed. Default is 123.

mcmc_iter

The number of MCMC sampling for the generation of the graphs from the joint random graph distribution. Default is 50.

alpha

The true values of the condition-specific intercepts. If NULL, these are drawn from a N(-2,1) distribution.

theta

The true values of the regression coefficients associated to the covariates in X. If NULL, this is set to 2.5.

loc

The true coordinates of the B locations in the latent space. If NULL, these are drawn from a N(0,0.3) distribution.

X

The edge specific covariates. If NULL, the data for one covariates is drawn from a Uniform(-0.5,0.5) distribution.

Value

A list with the following elements:

data

A list of B elements, where each element contains an n x p matrix of simulated Gaussian data.

X

An n.edge x ncol(X) data matrix of edge covariates.

loc

A B x D matrix of the true condition-specific coordinates.

alpha

A B-dimensional vector of the true condition-specific intercepts.

theta

A vector of the true regression coefficients associated to the covariates in X.

G

An n.edge x B matrix of the true graphs.

diagnostic

The sparsity of the graphs generated across the mcmc_iter iterations, as a diagnostic tool for convergence.

Examples

sim_data <- sim.rgm(n = 10, D = 2, p = 7, B = 5)

[Package rgm version 1.0.4 Index]