Fit a linearly constrained linear model with lasso regularization.
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)
a response vector with length n.
a design matrix, with dimension \(n \times p\).
design matrix for unpenalized variables. Default value is NULL.
Boolean, specifying whether to include an intercept. Default is TRUE.
penalty factor, a vector of length p. Zero implies no shrinkage. Default value for each entry is 1.
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.
the length of the lam
sequence. Default is 100. No effect if lam
is
provided.
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
.
limit the maximum number of groups in the model. Useful for handling very large \(p\), if a partial path is desired. Default is \(p\).
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)
.
the inital value of the penalty parameter of the augmented Lagrange method adopted in the outer loop. Default value is 1.
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.
tolerance for the estimated coefficients to be considered as non-zero, i.e., if \(abs(\beta_j)\) < tol
, set \(\beta_j\) as 0.
Default value is 1e-10.
outer_maxiter
is the maximum number of loops allowed for the augmented Lanrange method;
and outer_eps
is the corresponding convergence tolerance.
inner_maxiter
is the maximum number of loops allowed for the coordinate descent;
and inner_eps
is the corresponding convergence tolerance.
linear equalities of the form \(A\beta_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)
.
inital value of the coefficients. Can be unspecified.
A list of
a matrix of coefficients.
the sequence of lambda values.
a vector, the number of nonzero coefficients for Z
at each value of lambda.
total number of iteration.
a vector of error flag.