pargen: Generating parameters according to the graph

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

View source: R/pargen.R

Description

The function generates parameters for different types of edges based on the graph.

Usage

1
pargen(adjmat, p, q, a, b, c)

Arguments

adjmat

A m x m adjacency matrix (m is the number of total variables). The program automatically check whether the matrix is symmetric and positive.

p

The number of continous variables.

q

The number of binary variables.

a

Control overall magnitude of the non-zero parameters for edges connecting continuous variables.

b

Control overall magnitude of the non-zero parameters for edges connecting binary and continuous variables.

c

Control overall magnitude of the non-zero parameters for edges connecting binary variables.

Details

In order to generate simulation data, first generate the parameters. Once the adjacency matrix is given, we set all parameters corresponding to absent edges to 0. For the non-zero parameters, we set lambdaj, lambdajk, etaj to be positive or negative with equal probability and the absolute value of each non-zero etaj is drawn from the uniform distribution on the interval (0.9a, 1.1a) and each non-zero lambdaj or lambdajk is from (0.9c,1.1c). The program makes sure that all the probability values are not negative.

Value

The function returns a paramter list.

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

datagen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## set controlling parameters
p = 20
q = 10
a = 1
b = 2
c = 1

# set adjacency matrix
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))

#generate list
parlist = pargen(adj, p, q, a, b,c)

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