semilatent {latentgraph} | R Documentation |
Estimate Graphical Models with Latent Variables and Replicates
Description
Estimate graphical models with latent variables and replicates using the method in Tan et al. (2016).
Usage
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 |
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 \le j \le p
.
\min_{\beta_{j,O / j}} \{l_j (\beta_{j,O / j}) + \lambda\|\beta_{j,O / j}\|_1 \},
where l_j (\beta_{j,O / j})
is a nuisance-free loss function, \beta_{j,O / j}
is a parameter that represents the conditional dependence relationships between j
th observed variable and the other observed variables, and \lambda
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
#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")