fitadj: Obtain the adjascent matrix by thresholding the adj norm...

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

View source: R/fitadj.R

Description

Function to obtain the adjascent matrix by thresholding the adj norm matrix

Usage

1
fitadj(adj_norm, thres)

Arguments

adj_norm

A structure with adj norm matrix zz zy yy

thres

Length of thresholding vector

Value

The function returns a 4-dimentional array to record the adj matrix.

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

hmgm edgenorm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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)

mydata = datagen(parlist, n)

z = mydata$z

y = mydata$y

tune1 = tune2 = 0.1

kappa = 0.1

## parameter estimation

fit = hmgm(z, y, tune1, tune2, 'max',kappa)

#calculate the group L2 norm for each pair of edges

fitlist_post = fit$fitlist_post
adj_norm = edgenorm(fitlist_post)

adj_lambda = fitadj(adj_norm, 0)

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