semilatent: Estimate Graphical Models with Latent Variables and...

Description Usage Arguments Details Value References Examples

View source: R/semilatent.R

Description

Estimate graphical models with latent variables and replicates using the method in Tan et al. (2016).

Usage

1
semilatent(data, n, R, p, lambda, distribution = "Gaussian", rule = "AND")

Arguments

data

data set. Can be a matrix, list, array, or data frame. If the data set is a matrix, it should have nR rows and p columns. This matrix is formed by stacking n matrices, and each matrix has R rows and p columns. If the data set is a data frame, the dimention and structure are the same as the matrix. If the data set is an array, its dimention is (R, p, n). If the data set is a list, it should have n elements and each element is a matrix with R rows and p columns.

n

the number of observations.

R

the number of replicates for each observation.

p

the number of observed variables.

lambda

tuning parameter that encourages estimated graph to be sparse.

distribution

For a data set with Gaussian distribution, use "Gaussian"; For a data set with Ising distribution, use "Ising". Default is "Gaussian".

rule

rules to combine matrices that encode the conditional dependence relationships between sets of two observed variables. Options are "AND" and "OR". Default is "AND".

Details

The semilatent method has two assumptions. The first one states that the latent variables are constant across replicates. Assumption 2 states that given the latent variables, the replicates are mutually independent. With these two assumptions, the method seeks to solve the following problem for 1 ≤ j ≤ p.

\min_{β_{j,O / j}} \{l_j (β_{j,O / j}) + λ\|β_{j,O / j}\|_1 \},

where l_j (β_{j,O / j}) is a nuisance-free loss function, β_{j,O / j} is a parameter that represents the conditional dependence relationships between jth observed variable and the other observed variables, and λ is a tuning parameter. This method aims at modeling semiparametric exponential family graphical model with latent variables and replicates.

Value

omega

a matrix that encodes the conditional dependence relationships between sets of two observed variables

theta

the adjacency matrix with 0 and 1 encoding conditional independence and dependence between sets of two observed variables, respectively

penalty

the penalty value

References

Tan, K. M., Ning, Y., Witten, D. M. & Liu, H. (2016), ‘Replicates in high dimensions, with applications to latent variable graphical models’, Biometrika 103(4), 761–777.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#semilatent Gaussian with "AND" rule
n <- 50
R <- 20
p <- 30
seed <- 1
l <- 2
s <- 2
data <- generate_Gaussian(n, R, p, l, s, sparsityA = 0.95, sparsityobserved = 0.9,
sparsitylatent = 0.2, lwb = 0.3, upb = 0.3, seed)$X

result <- semilatent(data, n, R, p, lambda = 0.1,distribution = "Gaussian", 
rule = "AND")

latentgraph documentation built on Dec. 15, 2020, 5:23 p.m.