| boot_glasso | R Documentation |
Fast, single-call bootstrap for EBICglasso partial correlation networks. Combines nonparametric edge/centrality bootstrap, case-dropping stability analysis, edge/centrality difference tests, predictability CIs, and thresholded network into one function. Designed as a faster alternative to bootnet with richer output.
boot_glasso(
x,
iter = 1000L,
cs_iter = 500L,
cs_drop = seq(0.1, 0.9, by = 0.1),
alpha = 0.05,
gamma = 0.5,
nlambda = 100L,
centrality = c("strength", "expected_influence", "betweenness", "closeness"),
centrality_fn = NULL,
cor_method = "pearson",
ncores = 1L,
seed = NULL
)
x |
A data frame, numeric matrix (observations x variables), or
a |
iter |
Integer. Number of nonparametric bootstrap iterations (default: 1000). |
cs_iter |
Integer. Number of case-dropping iterations per drop proportion (default: 500). |
cs_drop |
Numeric vector. Drop proportions for CS-coefficient
computation (default: |
alpha |
Numeric. Significance level for CIs (default: 0.05). |
gamma |
Numeric. EBIC hyperparameter (default: 0.5). |
nlambda |
Integer. Number of lambda values in the regularization path (default: 100). |
centrality |
Character vector. Centrality measures to compute.
Built-in: |
centrality_fn |
Optional function. A custom centrality function
that takes a weight matrix and returns a named list of centrality
vectors. When |
cor_method |
Character. Correlation method: |
ncores |
Integer. Number of parallel cores for mclapply (default: 1, sequential). |
seed |
Integer or NULL. RNG seed for reproducibility. |
An object of class "boot_glasso" containing:
Original partial correlation matrix.
Original precision matrix.
Named list of original centrality vectors.
Named numeric vector of node R-squared.
Data frame of edge CIs (edge, weight, ci_lower, ci_upper, inclusion).
Named numeric vector of edge inclusion probabilities.
Partial correlation matrix with non-significant edges zeroed.
Named list of data frames (node, value, ci_lower, ci_upper) per centrality measure.
Named numeric vector of CS-coefficients per centrality measure.
Data frame of case-dropping correlations (drop_prop, measure, correlation).
Symmetric matrix of pairwise edge difference p-values.
Named list of symmetric p-value matrices per centrality measure.
Data frame of node predictability CIs (node, r2, ci_lower, ci_upper).
iter x n_edges matrix of bootstrap edge weights.
Named list of iter x p bootstrap centrality matrices.
iter x p matrix of bootstrap R-squared.
Character vector of node names.
Sample size.
Number of variables.
Number of nonparametric iterations.
Number of case-dropping iterations.
Drop proportions used.
Significance level.
EBIC hyperparameter.
Lambda path length.
Character vector of centrality measures.
Correlation method.
Lambda sequence used.
Selected lambda for original data.
Named numeric vector with timing in seconds.
build_network, bootstrap_network
set.seed(1)
dat <- as.data.frame(matrix(rnorm(60), ncol = 3))
net <- build_network(dat, method = "glasso")
bg <- boot_glasso(net, iter = 10, cs_iter = 5, centrality = "strength")
set.seed(42)
mat <- matrix(rnorm(60), ncol = 4)
colnames(mat) <- LETTERS[1:4]
net <- build_network(as.data.frame(mat), method = "glasso")
boot <- boot_glasso(net, iter = 100, cs_iter = 50, seed = 42,
centrality = c("strength", "expected_influence"))
print(boot)
summary(boot, type = "edges")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.