zilgm | R Documentation |
Network estimation following local markov property for count data with zero inflated and overdispersion by specified node-conditional distribution
zilgm(X, lambda = NULL, nlambda = 50, family = c("Poisson", "NBI", "NBII"),
update_type = c("IRLS", "MM"), sym = c("AND", "OR"), theta = NULL, thresh = 1e-6,
weights_mat = NULL, penalty_mat = NULL, do_boot = FALSE, boot_num = 10,
beta = 0.05, lambda_min_ratio = 1e-4, init_select = FALSE, nCores = 1, verbose = 0, ...)
X |
A n x p data matrix, where n is the number of observations and p is the number of variables or nodes. |
lambda |
A sequence of regularization parameter to control a level of l_1-penalty. |
nlambda |
The number of regularization parameter. If |
family |
Types of node-conditional distribution to be assumed among zero-inflated distributions. |
update_type |
Algorithm for estimating edge coefficients. |
sym |
Symmetrize the output graphs. If |
theta |
A dispersion parameter. If |
thresh |
Threshold value for the estimated edge coefficients. |
weights_mat |
A n x p matrix containing weights for observations in each node |
penalty_mat |
A p x p matrix containing weights for each edge coefficients |
do_boot |
A logical. Whether to use Stability Apprach to Regularization Selection (StARS). |
boot_num |
The number of iteration for StARS. |
beta |
Threshold value on sparsity of the network. |
lambda_min_ratio |
The smallest value for lambda, as a fraction of the lambda^max of the regularization parameter. This factor is used by |
init_select |
A logical. Whether to use initial selection. |
nCores |
The number of cores to use for parallel computing. |
verbose |
An optional integer value, If |
... |
Other arguments that can be passed to neighborhood selection function. |
An S3 object with the following slots
network |
a list of p x p matrices of estimated networks along the regularization path. |
coef_network |
a array of p x p x nlambda of estimated edge coefficients matrix along the regularization path. |
lambda |
vector used for regularization path. |
v |
vector of network variability measured for each regularization level. |
opt_lambda |
The lambda that gives the optimal network. |
Choi, H., J. Gim, S. Won, Y. J. Kim, S. Kwon, and C. Park, 2017: Network analysis for count data with excess zeros. BMC genetics, 18, no. 1, 1-10.
Park, B., H. Choi, C. Park, 2021: Negative binomial graphical model with excess zeros.
require(ZILGM)
set.seed(1)
n = 100; p = 10; prob = 2 / p;
A = generate_network(p, prob, type = "random")
simul_dat = zilgm_sim(A = A, n = n, p = p, zlvs = 0.1,
family = "negbin", signal = 1.5, theta = 0.5, noise = 0.0)
# Compute a sequence of regularization parameter
lambda_max = find_lammax(simul_dat$X)
lambda_min = 1e-4 * lambda_max
lambs = exp(seq(log(lambda_max), log(lambda_min), length.out = 50))
nb2_fit = zilgm(X = simul_dat$X, lambda = lambs, family = "NBII", update_type = "IRLS",
do_boot = TRUE, boot_num = 30, sym = "OR", nCores = 10)
# To compute the regularization parameters automatically, use the argument nlambda
nb2_fit = zilgm(X = simul_dat$X, nlambda = 50, family = "NBII", update_type = "IRLS",
do_boot = TRUE, boot_num = 30, sym = "OR", nCores = 10)
# Get estimated graph
est_graph = nb2_fit$network[[nb2_fit$opt_index]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.