Learn R Programming

cxreg (version 1.0.0)

cglasso: fit a complex-valued graphical lasso

Description

Fit a complex-valued graphical lasso for spectral precision matrix (inverse spectral density matrix) via a complex variable-wise coordinate descent algorithm for classo with covariates update.

Usage

cglasso(
  S,
  D = NULL,
  type = c("I", "II"),
  nobs,
  lambda = NULL,
  nlambda = 50,
  lambda.min.ratio = ifelse(nobs < p, 0.01, 1e-04),
  W.init = NULL,
  stopping_rule = TRUE,
  stop_criterion = c("EBIC", "AIC", "RMSE"),
  maxit = 500,
  thresh = 1e-04,
  trace.it = 0,
  ...
)

Value

An object with class "cglassofit" and "cglasso".

stop_arr

Sequence of values of information criterion for a fixed lambda.

stop_criterion

Stopping criterion used.

min_index

The index for lambda that minimizes the value of the information criterion.

lambda_grid

Sequence of lambdas used.

Theta_list

Estimated inverse spectral matrix for each fixed lambda. It is provided in the list.

type

Type of the formulation used, either CGALSSO-I or CGLASSO-II.

scale

Whether the spectral density matrix (covariance) or spectral coherence (coherence) is given.

D

Used scale diagonal matrix.

Arguments

S

p x p-dimensional symmetric spectral density (or spectral coherence) matrix. S is considered as being computed by average smoothed periodogram (the bandwidth is computed by using the given nobs).

D

The p x p-dimensional diagonal matrix with spectral densities as the diagonal entries. Default is NULL. If D is not provided, diagonals of S are chosen.

type

A logical flag to choose the formulation to solve. Default is I. If type is I, the algorithm solves CGLASSO-I in the reference, $$ D^{-1/2} \left( \arg\min_{\Theta} \operatorname{Tr} \left[ \hat{R} \hat{\Theta} \right] - \log \det \Theta + \sum_{i \ne j} \left| \Theta_{ij} \right| \right) D^{-1/2} $$ for the given D. If type is II, the algorithm solves CGLASSO-II in the reference. It is for each iterative classo with covariate update, the squared-root of scale matrix \( D^{-1/2}\) is multiplied. Please refer to the equation (5.2) in the reference for the details.

nobs

Number of observations used in computation of the spectral density matrix S. This quantity is need to compute the Fourier frequency, extended BIC, and bandwidth for the average smoothed periodogram.

lambda

A user supplied lambda sequence. Typical usage is to have the program compute its own lambda sequence based on nlambda and lambda.min.ratio. Supplying a value of lambda overrides this. WARNING: use with care. Avoid supplying a single value for lambda

nlambda

The number of lambda values - default is 50.

lambda.min.ratio

Smallest value for lambda, as a fraction of lambda.max, the (data derived) entry value (i.e. the smallest value for which all coefficients are zero). The default depends on the sample size nobs relative to the number of variables nvars. If nobs > p, the default is 0.0001, close to zero. If nobs < p, the default is 0.01.

W.init

Logical flag whether the initially estimated spectral density matrix is given. Default is NULL.

stopping_rule

Logical flag if the algorithm is terminated by stopping rule. If the algorithm is early terminated ,not all estimates for initially designated lambdas are explored.

stop_criterion

Stopping criterion for early termination. Default is EBIC (Extended BIC). Alternatively, AIC (AIC) and RMSE (root mean squared error between two consecutive estimates) can be used.

maxit

Maximum number of iterations of both outer and inner loops. Default 500.

thresh

Convergence threshold for coordinate descent. Default is 1e-4.

trace.it

If trace.it=1, then a progress bar is displayed;

...

Other arguments that can be passed to cglasso useful for big models that take a long time to fit.

Author

Navonil Deb, Younghoon Kim, Sumanta Basu
Maintainer: Younghoon Kim yk748@cornell.edu

Details

The sequence of models implied by lambda is fit by coordinate descent.

References

Deb, N., Kuceyeski, A., Basu, S. (2024) Regularized Estimation of Sparse Spectral Precision Matrices, https://arxiv.org/abs/2401.11128.

Examples

Run this code
p <- 30
n <- 500
C <- diag(0.7, p)
C[row(C) == col(C) + 1] <- 0.3  
C[row(C) == col(C) - 1] <- 0.3  
Sigma <- solve(C)
set.seed(1010)
m <- floor(sqrt(n)); j <- 1
X_t <- mvtnorm::rmvnorm(n = n, mean = rep(0, p), sigma = Sigma)
d_j <- dft.X(X_t,j,m)
f_j_hat <- t(d_j) %*% Conj(d_j) / (2*m+1)
fit <- cglasso(S=f_j_hat, nobs=n)

Run the code above in your browser using DataLab