Package {AdaptiveGlasso}


Title: Adaptive Graphical Lasso for Sparse Network Estimation
Version: 1.0.0
Description: Implements an adaptive graphical lasso method for sparse precision matrix and network estimation. The method combines ridge stabilization, cross-validated regularization, an initial graphical lasso estimate, and adaptive edge-specific penalties to estimate sparse conditional dependence structures. The method supports settings where the sample size is smaller than, equal to, or larger than the number of variables.
URL: https://github.com/elizabethamona/AdaptiveGlasso
BugReports: https://github.com/elizabethamona/AdaptiveGlasso/issues
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.3
Imports: CVglasso, glasso
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2026-10-13 04:39:31 UTC; amona
Author: Elizabeth B. Amona ORCID iD [aut, cre, cph]
Maintainer: Elizabeth B. Amona <amonaelizabeth1@gmail.com>
Repository: CRAN
Date/Publication: 2026-10-24 08:40:09 UTC

AdaptiveGlasso: Adaptive Graphical Lasso for Sparse Network Estimation

Description

AdaptiveGlasso implements an adaptive graphical lasso method for sparse precision-matrix and network estimation. The method combines ridge stabilization, cross-validated regularization, an initial graphical lasso estimate, and adaptive edge-specific penalties.

Details

The main fitting function is adaptive_glasso().

For a data matrix with observations in rows and variables in columns, the method first optionally standardizes the variables and ridge-stabilizes the sample covariance matrix. An initial graphical lasso estimate is then used to construct adaptive weights

w_{ij} = \frac{1}{|\hat{\omega}^{init}_{ij}| + d},

where d > 0 is a stabilization constant. The final edge-specific penalties are

\rho_{ij} = \lambda w_{ij}.

If lambda is not supplied, it is selected by cross-validation using CVglasso.

The method can be applied when the sample size is smaller than, equal to, or larger than the number of variables.

Main functions

Author(s)

Maintainer: Elizabeth B. Amona amonaelizabeth1@gmail.com (ORCID) [copyright holder]

See Also

Useful links:

Examples

set.seed(123)

x <- matrix(
  rnorm(60 * 6),
  nrow = 60,
  ncol = 6
)

fit <- adaptive_glasso(
  x,
  ridge = 0.10,
  d = 0.32,
  lambda = 0.20
)

fit

coef(fit, type = "precision")


Fit an adaptive graphical lasso model

Description

Fits an adaptive graphical lasso model for sparse precision-matrix and network estimation. The procedure combines ridge stabilization, an initial graphical lasso estimate, adaptive edge-specific penalties, and a final weighted graphical lasso estimate.

Usage

adaptive_glasso(
  x,
  ridge = 0.1,
  d = 0.32,
  lambda = NULL,
  lam.min.ratio = 0.01,
  nfolds = 5L,
  standardize = TRUE,
  seed = 123L,
  penalize_diagonal = TRUE,
  tol = 1e-04,
  maxit = 10000L
)

Arguments

x

Numeric matrix or data frame with observations in rows and variables in columns.

ridge

Non-negative ridge stabilization constant added to the diagonal of the sample covariance matrix. Default is 0.10.

d

Positive stabilization constant used in the adaptive weights w_{ij} = 1/(|\hat{\omega}^{init}_{ij}| + d). Default is 0.32.

lambda

Optional positive regularization parameter. If NULL, lambda is selected automatically by cross-validation using CVglasso. If a positive numeric value is supplied, that fixed value is used and cross-validation is skipped.

lam.min.ratio

Minimum-to-maximum lambda ratio used by CVglasso when lambda = NULL. Default is 0.01.

nfolds

Number of cross-validation folds used when lambda = NULL. Default is 5.

standardize

Logical; if TRUE, variables are standardized before fitting. Default is TRUE.

seed

Optional integer seed used for reproducibility of cross-validation when lambda = NULL. Default is 123.

penalize_diagonal

Logical; whether diagonal precision-matrix elements are penalized. Default is TRUE, matching the fitting procedure used in the motivating analysis.

tol

Positive convergence tolerance passed to the graphical lasso fitting routines. Default is 1e-4.

maxit

Maximum number of graphical lasso iterations. Default is 10000.

Details

The sample covariance matrix is first ridge-stabilized as

S_{\delta} = S + \delta I,

where ridge corresponds to \delta.

An initial graphical lasso estimate is then used to construct the adaptive weights

w_{ij} = \frac{1}{|\hat{\omega}^{init}_{ij}| + d},

followed by the edge-specific penalties

\rho_{ij} = \lambda w_{ij}.

The value of lambda can be handled in two ways:

The method can be applied when the number of observations is smaller than, equal to, or larger than the number of variables.

Value

An object of class "adaptive_glasso_fit" containing the fitted precision and covariance matrices, adjacency matrix, initial precision estimate, adaptive weights, adaptive penalty matrix, selected or supplied lambda, ridge and adaptive stabilization constants, cross-validation results when applicable, and fitting diagnostics.

Examples

set.seed(123)

x <- matrix(
  rnorm(60 * 6),
  nrow = 60,
  ncol = 6
)

# Use a fixed lambda: cross-validation is not performed
fit <- adaptive_glasso(
  x,
  lambda = 0.195237
)

fit
coef(fit, type = "precision")

# Select lambda automatically by cross-validation
fit_cv <- adaptive_glasso(
  x,
  lambda = NULL,
  nfolds = 3
)

fit_cv$lambda


Extract matrices from an adaptive graphical lasso fit

Description

Extract matrices from an adaptive graphical lasso fit

Usage

## S3 method for class 'adaptive_glasso_fit'
coef(
  object,
  type = c("precision", "adjacency", "weights", "penalty", "covariance"),
  ...
)

Arguments

object

An object returned by adaptive_glasso().

type

Matrix to return.

...

Additional arguments; currently unused.

Value

A matrix.


Print an adaptive graphical lasso fit

Description

Print an adaptive graphical lasso fit

Usage

## S3 method for class 'adaptive_glasso_fit'
print(x, ...)

Arguments

x

An object returned by adaptive_glasso().

...

Additional arguments; currently unused.

Value

The fitted object, invisibly.