cov_estim_glasso: Graphical Lasso Covariance Estimation

View source: R/cov_estim_glasso.R

cov_estim_glassoR Documentation

Graphical Lasso Covariance Estimation

Description

Computes the Graphical Lasso (GLASSO) estimator of the covariance matrix.

Usage

cov_estim_glasso(
  data,
  rho = NULL,
  type = "cor",
  nfolds = 5,
  crit = "loglik",
  pendiag_log = FALSE,
  start = "warm",
  tol = 1e-04,
  maxit = 10000,
  cores = 1,
  seed = 1234
)

Arguments

data

an nxp data matrix.

rho

a double or a sequence, the non-negative regularization parameter \rho for lasso. \rho=0 means no regularization. Can be a scalar (usual) or a symmetric p by p matrix, or a vector of length p. In the latter case, the penalty matrix has jkth element \sqrt{\rho_j*\rho_k}. Default value is NULL and an optimal regularization is computed with the cross-validation (CV) procedure as in \insertCitecvglassopackage;textualcovestim.

type

a character, the type of matrix to be estimated. Possible values are c("cor", "cov"). Default value is "cor" for the correlation matrix.

nfolds

an integer, indicating the number of folds for the CV. Default value is 5.

crit

a character, indicating which selection criterion within the CV. Possible values are "loglik", "AIC" and "BIC". Default is set to "BIC".

pendiag_log

a logical, indicating whether the diagonal of the sample covariance matrix is to be penalized (TRUE) or not (FALSE). Default value is FALSE.

start

a character, specifying the start type of the glasso algorithm. Possible values are "warm" or "cold". Default value is "cold".

tol

a double, indicating the tolerance for the glasso algorithm. Default value is set to 1e-05.

maxit

an integer, indicating the maximum number of iterations for the glasso algorithm. Default value is set to 10000.

cores

an integer, indicating how many cores should be used for the CV. Default value is 1. cores cannot be higher than the maximum number of cores of the processor in use.

seed

an integer, the seed for the performed cross-validation. Default value is 1234.

Details

The GLASSO estimator is elaborated in detail in \insertCitefriedman2008sparse;textualcovestim. More information on the functionality can be found in \insertCiteglassopackage;textualcovestim and \insertCitecvglassopackage;textualcovestim.

Value

a list with the following entries

  • a pxp estimated covariance matrix.

  • an estimation specific tuning parameter, here the lasso penalty.

References

\insertAllCited

Examples

data(rets_m)
sigma_glasso <- cov_estim_glasso(rets_m, type = "cov", rho = 0.0001)[[1]]


antshi/CovEstim documentation built on June 10, 2025, 3:11 a.m.