Fit a complex-valued lasso formulation via complex update coordinate descent algorithm. By defining a field isomophism between complex values and its 2 by 2 representation, it enables to update each coordinate of the solution as a regular coordinate descent algorithm.
classo(
x,
y,
weights = NULL,
lambda = NULL,
nlambda = 100,
lambda.min.ratio = ifelse(nobs < nvars, 0.01, 1e-04),
standardize = TRUE,
intercept = FALSE,
maxit = 10000,
thresh = 1e-07,
trace.it = 0,
...
)An object with class "classofit" and "classo".
Intercept sequence of length length(lambda).
A nvars x length(lambda) matrix of coefficients, stored in
sparse matrix format.
The number of nonzero coefficients for each value of lambda.
Dimension of coefficient matrix.
The actual sequence of lambda values used. When alpha=0, the largest lambda reported does not quite give the zero coefficients reported (lambda=inf would in principle). Instead, the largest lambda for alpha=0.001 is used, and the sequence of lambda values is derived from this.
The fraction of (null) deviance explained. The deviance calculations incorporate weights if present in the model. The deviance is defined to be 2*(loglike_sat - loglike), where loglike_sat is the log-likelihood for the saturated model (a model with a free parameter per observation). Hence dev=1-dev/nulldev.
Null deviance (per observation). This is defined to be 2*(loglike_sat -loglike(Null)). The null model refers to the intercept model.
Total passes over the data summed over all lambda values.
Error flag, for warnings and errors (largely for internal debugging).
The call that produced this object.
Family used for the model.
Number of observations.
input matrix, of dimension nobs x nvars; each row is an observation vector.
Requirement: nvars >1; in other words, x should have 2 or more columns.
response variable.
observation weights. Default is 1 for each observation.
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
(for predictions after CV use predict() instead).
Supply instead a decreasing sequence of lambda values.
classo relies on its warms starts for speed, and its often faster to fit a whole path than compute a single fit.
The number of lambda values - default is 100.
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 > nvars, the default is 0.0001, close to zero.
If nobs < nvars, the default is 0.01.
A very small value of lambda.min.ratio will lead to a saturated fit
in the nobs < nvars case.
Logical flag for x variable standardization, prior to
fitting the model sequence. The coefficients are always returned on the
original scale. Default is standardize=TRUE.
Should intercept(s) set to zero (default=FALSE) or be fitted (TRUE).
Maximum number of iterations of outer loop. Default 10,000.
Convergence threshold for coordinate descent.
Each inner coordinate-descent loop continues until the maximum change in the objective
after any coefficient update is less than thresh times the null
deviance. Defaults value is 1e-7.
If trace.it=1, then a progress bar is displayed;
useful for big models that take a long time to fit.
Other arguments that can be passed to classo
Navonil Deb, Younghoon Kim, Sumanta Basu
Maintainer: Younghoon Kim
yk748@cornell.edu
The sequence of models implied by lambda is fit by coordinate descent.
Deb, N., Kuceyeski, A., Basu, S. (2024) Regularized Estimation of Sparse Spectral Precision Matrices, https://arxiv.org/abs/2401.11128.
set.seed(1010)
n = 1000
p = 200
x = array(rnorm(n*p), c(n,p)) + (1+1i) * array(rnorm(n*p), c(n,p))
for (j in 1:p) x[,j] = x[,j] / sqrt(mean(Mod(x[,j])^2))
e = rnorm(n) + (1+1i) * rnorm(n)
b = c(1, -1, rep(0, p-2)) + (1+1i) * c(-0.5, 2, rep(0, p-2))
y = x %*% b + e
fit.test = classo(x, y)
Run the code above in your browser using DataLab