Learn R Programming

cxreg (version 1.0.0)

classo.path: fit a complex-valued lasso for a path of lambda values

Description

Fit a complex-valued lasso formulation for a path of lambda values. classo.path solves the Lasso problem for a path of lambda values.

Usage

classo.path(
  x,
  y,
  weights = NULL,
  standardize = FALSE,
  lambda = NULL,
  nlambda = 100,
  lambda.min.ratio = ifelse(nobs < nvars, 0.01, 1e-04),
  intercept = FALSE,
  thresh = 1e-10,
  maxit = 1e+05,
  trace.it = 0,
  ...
)

Value

An object with class "classofit" and "classo".

a0

Intercept sequence of length length(lambda).

beta

A nvars x length(lambda) matrix of coefficients, stored in sparse matrix format.

df

The number of nonzero coefficients for each value of lambda.

dim

Dimension of coefficient matrix.

lambda

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.

dev.ratio

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.ratio=1-dev/nulldev.

nulldev

Null deviance (per observation). This is defined to be 2*(loglike_sat -loglike(Null)). The null model refers to the intercept model.

npasses

Total passes over the data summed over all lambda values.

jerr

Error flag, for warnings and errors (largely for internal debugging).

call

The call that produced this object.

family

Family used for the model.

nobs

Number of observations.

Arguments

x

Complex-valued input matrix, of dimension nobs by nvar; each row is an observation vector.

y

Complex-valued response variable, nobs dimensional vector.

weights

Observation weights. Default is 1 for each observation.

standardize

Logical flag for x variable standardize beforehand; i.e. for n and p by nobs and nvar, $$\|X_j\|=\sqrt{n} \textrm{for all }j=1,\ldots,p$$ is satisfied for the input x. Default is FALSE.

lambda

A user supplied lambda sequence. Default is NULL.

nlambda

The number of lambda values. Default is 100.

lambda.min.ratio

If nobs < nvars, the default is 0.01.

intercept

Should intercept be set to zero (default=FALSE) or fitted (FALSE)? This default is reversed from glmnet package.

thresh

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. Default value is 1e-10.

maxit

Maximum number of iterations of outer loop. Default 10,000.

trace.it

Controls how much information is printed to screen. Default is trace.it=0 (no information printed). If trace.it=1, a progress bar is displayed. If trace.it=2, some information about the fitting procedure is printed to the console as the model is being fitted.

...

Other arguments that can be passed to classo