jewel | R Documentation |
This function estimates Gaussian graphical models (i.e. networks of conditional dependencies, direct connections between variables) given multiple datasets. We assume that datasets contain measurements of the same variables collected under different conditions (different equipment, locations, even sub-types of disease).
jewel(
X,
lambda1,
lambda2 = NULL,
Theta = NULL,
W = NULL,
tol = 0.01,
maxIter = 10000,
stability = FALSE,
stability_nsubsets = 25,
stability_frac = 0.8,
verbose = TRUE
)
X |
a list of |
lambda1 |
a number, first regularization parameter (of the common penalty). |
lambda2 |
an optional number, second regularization parameter
(of the class-specific penalty). If NULL, set to |
Theta |
an optional list of |
W |
an optional list of |
tol |
an optional number, convergence threshold controlling the relative error between iterations. The default value is 0.01. |
maxIter |
an optional number, maximum allowed number of iterations. The default value is 10 000. |
stability |
if stability = TRUE, stability selection procedure to reduce
the number of false positives will be applied. |
stability_nsubsets |
an optional number, how many times to subsample datasets and apply __jewel__ for stability selection procedure. The default value is 25. |
stability_frac |
an optional number, in what proportion of the stability results on subsampled data an edge has to be present to be included into the final estimate. The default value is 0.8. |
verbose |
if verbose = FALSE, tracing information printing is disabled. The default value is TRUE. |
The following list is returned
CommonG
- an adjacency matrix of the common estimated graph (intersection of K
estimated graphs).
G_list
- a list of K
adjacency matrices for each estimated graph.
Theta
- a list of K
estimated covariance matrices (when stability selection is disabled).
BIC
– a number, value of Bayesian information criterion for resulting graphs (when stability selection is disabled).
{
K <- 3
p <- 50
n <- 20
data <- generateData_rewire(K = K, p = p, n = n, ncores = 1, verbose = FALSE)
G_list_true <- data$Graphs
X <- data$Data
true_degrees <- rowSums(G_list_true[[1]])
cut <- sort(true_degrees, decreasing = TRUE)[ceiling(p * 0.03)]
apriori_hubs <- ifelse(true_degrees >= cut, 10, 1)
W <- constructWeights(apriori_hubs, K = K)
res <- jewel(X, lambda1 = 0.25, W = W, verbose = FALSE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.