% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/boot_glasso.R
\name{boot_glasso}
\alias{boot_glasso}
\title{Bootstrap for Regularized Partial Correlation Networks}
\usage{
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
)
}
\arguments{
\item{x}{A data frame, numeric matrix (observations x variables), or
a \code{netobject} with \code{method = "glasso"}.}

\item{iter}{Integer. Number of nonparametric bootstrap iterations
(default: 1000).}

\item{cs_iter}{Integer. Number of case-dropping iterations per drop
proportion (default: 500).}

\item{cs_drop}{Numeric vector. Drop proportions for CS-coefficient
computation (default: \code{seq(0.1, 0.9, by = 0.1)}).}

\item{alpha}{Numeric. Significance level for CIs (default: 0.05).}

\item{gamma}{Numeric. EBIC hyperparameter (default: 0.5).}

\item{nlambda}{Integer. Number of lambda values in the regularization
path (default: 100).}

\item{centrality}{Character vector. Centrality measures to compute.
Built-in: \code{"strength"}, \code{"expected_influence"},
\code{"betweenness"}, \code{"closeness"}.
Custom measures beyond these require \code{centrality_fn}.
Default: \code{c("strength", "expected_influence", "betweenness", "closeness")}.}

\item{centrality_fn}{Optional function. A custom centrality function
that takes a weight matrix and returns a named list of centrality
vectors. When \code{NULL} (default), only \code{"strength"} and
\code{"expected_influence"} are computed via \code{rowSums}/
\code{colSums}. When provided, the function is called as
\code{centrality_fn(mat)} and should return a named list (e.g.,
\code{list(closeness = ..., betweenness = ...)}).}

\item{cor_method}{Character. Correlation method: \code{"pearson"}
(default), \code{"spearman"}, or \code{"kendall"}.}

\item{ncores}{Integer. Number of parallel cores for mclapply
(default: 1, sequential).}

\item{seed}{Integer or NULL. RNG seed for reproducibility.}
}
\value{
An object of class \code{"boot_glasso"} containing:
\describe{
\item{original_pcor}{Original partial correlation matrix.}
\item{original_precision}{Original precision matrix.}
\item{original_centrality}{Named list of original centrality vectors.}
\item{original_predictability}{Named numeric vector of node R-squared.}
\item{edge_ci}{Data frame of edge CIs (edge, weight, ci_lower, ci_upper,
inclusion).}
\item{edge_inclusion}{Named numeric vector of edge inclusion probabilities.}
\item{thresholded_pcor}{Partial correlation matrix with non-significant
edges zeroed.}
\item{centrality_ci}{Named list of data frames (node, value, ci_lower,
ci_upper) per centrality measure.}
\item{cs_coefficient}{Named numeric vector of CS-coefficients per
centrality measure.}
\item{cs_data}{Data frame of case-dropping correlations (drop_prop,
measure, correlation).}
\item{edge_diff_p}{Symmetric matrix of pairwise edge difference p-values.}
\item{centrality_diff_p}{Named list of symmetric p-value matrices per
centrality measure.}
\item{predictability_ci}{Data frame of node predictability CIs (node,
r2, ci_lower, ci_upper).}
\item{boot_edges}{iter x n_edges matrix of bootstrap edge weights.}
\item{boot_centrality}{Named list of iter x p bootstrap centrality
matrices.}
\item{boot_predictability}{iter x p matrix of bootstrap R-squared.}
\item{nodes}{Character vector of node names.}
\item{n}{Sample size.}
\item{p}{Number of variables.}
\item{iter}{Number of nonparametric iterations.}
\item{cs_iter}{Number of case-dropping iterations.}
\item{cs_drop}{Drop proportions used.}
\item{alpha}{Significance level.}
\item{gamma}{EBIC hyperparameter.}
\item{nlambda}{Lambda path length.}
\item{centrality_measures}{Character vector of centrality measures.}
\item{cor_method}{Correlation method.}
\item{lambda_path}{Lambda sequence used.}
\item{lambda_selected}{Selected lambda for original data.}
\item{timing}{Named numeric vector with timing in seconds.}
}
}
\description{
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.
}
\examples{
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")
\donttest{
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")
}

}
\seealso{
\code{\link{build_network}}, \code{\link{bootstrap_network}}
}
