datagen: Data generator

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/datagen.R

Description

The data generator creates random samples from conditional Gaussian distribution with different graph structures

Usage

1
datagen(parlist,n)

Arguments

parlist

The parameter list generated by pargen

n

The number of observations (sample size)

Details

We use the exact probability rather than MCMC methods to generate the binary variables. We generate the probability distribution of Z as well as the canonical parameters. The memory requirements for the distribution of Z make it difficult to generate a large number of binary variables in simulations. However, this is not a problem for real data where the variables are already observed.

Value

The function returns a data list:

z

Value of binary variable

y

Value of continous variable

Prob

The probability distribution of discrete variables

cparlist

The canonical parameter

Author(s)

Mingyu Qi, Tianxi Li

References

Jie Cheng, Tianxi Li, Elizaveta Levina, and Ji Zhu.(2017) High-dimensional Mixed Graphical Models. Journal of Computational and Graphical Statistics 26.2: 367-378, https://arxiv.org/pdf/1304.2810.pdf

See Also

pargen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#set parameters
n = 100
p = 20
q = 10
a = 1
b = 2
c = 1
adj = matrix(0, p+q, p+q)
adj[10:16, 10:16] = 1
adj[1:5, 1:5] = 1
adj[25:30, 25:30] = 1
adj = adj-diag(diag(adj))
parlist = pargen(adj, p, q, a, b, c)

#generate data
mydata = datagen(parlist, n)

hmgm documentation built on Jan. 13, 2021, 5:19 p.m.