Learn R Programming

hmgm (version 1.0.3)

datagen: Data generator

Description

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

Usage

datagen(parlist,n)

Arguments

parlist

The parameter list generated by pargen

n

The number of observations (sample size)

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

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.

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

Run this code
# NOT RUN {
#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)

# }

Run the code above in your browser using DataLab