classo {Compack}R Documentation

Fit a linearly constrained linear regression model with lasso regularization.

Description

Fit a linearly constrained linear model with lasso regularization.

Usage

classo(y, Z, Zc = NULL, intercept = TRUE, pf = rep(1, times = p),
       lam = NULL, nlam = 100,lambda.factor = ifelse(n < p, 0.05, 0.001),
       dfmax = p, pfmax = min(dfmax * 1.5, p),
       u = 1, mu_ratio = 1.01, tol = 1e-10,
       outer_maxiter = 3e+08, outer_eps = 1e-8,
       inner_maxiter = 1e+6, inner_eps = 1e-8,
       A = rep(1, times = p), b = 0, beta.ini)

Arguments

y

a response vector with length n.

Z

a design matrix, with dimension n*p.

Zc

design matrix for unpenalized variables. Default value is NULL.

intercept

Boolean, specifying whether to include an intercept. Default is TRUE.

pf

penalty factor, a vector of length p. Zero implies no shrinkage. Default value for each entry is 1.

lam

a user supplied lambda sequence. If lam is provided as a scaler and nlam>1, lam sequence is created starting from lam. To run a single value of lam, set nlam=1. The program will sort user-defined lambda sequence in decreasing order.

nlam

the length of the lam sequence. Default is 100. No effect if lam is provided.

lambda.factor

the factor for getting the minimal lambda in the lam sequence, where min(lam) = lambda.factor * max(lam). max(lam) is the smallest value of lam for which all penalized coefficients become zero. If n >= p, the default is 0.001. If n < p, the default is 0.05.

dfmax

limit the maximum number of groups in the model. Useful for handling very large p, if a partial path is desired. Default is p.

pfmax

limit the maximum number of groups ever to be nonzero. For example once a group enters the model along the path, no matter how many times it re-enters the model through the path, it will be counted only once. Default is min(dfmax*1.5, p).

u

the inital value of the penalty parameter of the augmented Lagrange method adopted in the outer loop. Default value is 1.

mu_ratio

the increasing ratio, with value at least 1, for u. Default value is 1.01. Inital values for scaled Lagrange multipliers are set as 0. If mu_ratio < 1, the program automatically set u as 0 and outer_maxiter as 1, indicating that there is no linear constraint.

tol

tolerance for the estimated coefficients to be considered as non-zero, i.e., if abs(β_j) < tol, set β_j as 0. Default value is 1e-10.

outer_maxiter, outer_eps

outer_maxiter is the maximum number of loops allowed for the augmented Lanrange method; and outer_eps is the corresponding convergence tolerance.

inner_maxiter, inner_eps

inner_maxiter is the maximum number of loops allowed for the coordinate descent; and inner_eps is the corresponding convergence tolerance.

A, b

linear equalities of the form Aβ_p = b, where b is a scaler, and A is a row-vector of length p. Default values: b is 0 and A = matrix(1, ncol = p).

beta.ini

inital value of the coefficients. Can be unspecified.

Value

A list of

beta

a matrix of coefficients.

lam

the sequence of lambda values.

df

a vector, the number of nonzero coefficients for Z at each value of lambda.

npass

total number of iteration.

error

a vector of error flag.


[Package Compack version 0.1.0 Index]