Fit a robust penalized GLM where the loss function is a composite function cfun
odfun
+ penalty. This does computing for irglmreg
.
irglmreg_fit(x, y, weights, offset, cfun="ccave", dfun="gaussian", s=NULL,
delta=0.1, fk=NULL, iter=10, reltol=1e-5,
penalty=c("enet","mnet","snet"), nlambda=100, lambda=NULL,
type.path=c("active", "nonactive"), decreasing=TRUE,
lambda.min.ratio=ifelse(nobs
An object with S3 class "irglmreg"
for the various types of models.
the call that produced the model fit
Intercept sequence of length length(lambda)
A nvars x length(lambda)
matrix of coefficients.
The actual sequence of lambda
values used
A nobs x length(lambda)
matrix of weights computed by the IRCO algorithm. The entry of i-th row and j-th column is the weight for the i-th observation and j-th lambda
value.
if lambda
is an increasing sequence or not, used to determine regularization path direction either from lambda_max to a potentially modified lambda_min or vice versa if type.init="bst", "heu"
.
input matrix, of dimension nobs x nvars; each row is an observation vector.
response variable. Quantitative for dfun=1
and -1/1 otherwise for classifications.
observation weights. Can be total counts if responses are proportion matrices. Default is 1 for each observation
this can be used to specify an a priori known component to be included in the linear predictor during fitting. This should be NULL or a numeric vector of length equal to the number of cases. Currently only one offset term can be included in the formula.
character, type of convex cap (concave) function.
Valid options are:
"hcave"
"acave"
"bcave"
"ccave"
"dcave"
"ecave"
"gcave"
"tcave"
character, type of convex downward function.
Valid options are:
"gaussian"
"gaussianC"
"binomial"
tuning parameter of cfun
. s > 0
and can be equal to 0 for cfun="tcave"
. If s
is too close to 0 for cfun="acave", "bcave", "ccave"
, the calculated weights can become 0 for all observations, thus crash the program.
a small positive number provided by user only if cfun="gcave"
and 0 < s <1
predicted values at an iteration in the IRCO algorithm
The number of lambda
values - default is 100. The sequence may be truncated before nlambda
is reached if a close to saturated model is fitted. See also satu
.
by default, the algorithm provides a sequence of regularization values, or a user supplied lambda
sequence
solution path for parallel=FALSE
. If type.path="active"
, then cycle through only the active set in the next increasing lambda
sequence. If type.path="nonactive"
, no active set for each element of the lambda sequence and cycle through all the predictor variables.
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 except the intercept). Note, there is no closed formula for lambda.max
. The default of lambda.min.ratio
depends on the
sample size nobs
relative to the number of variables
nvars
. If nobs > nvars
, the default is 0.001
,
close to zero. If nobs < nvars
, the default is 0.05
.
The \(L_2\) penalty mixing parameter, with
\(0 \le alpha\le 1\). alpha=1
is lasso (mcp, scad) penalty; and alpha=0
the ridge penalty. However, if alpha=0
, one must provide lambda
values.
The tuning parameter of the snet
or mnet
penalty.
logical value, if TRUE, adaptive rescaling of the penalty parameter for penalty="mnet"
or penalty="snet"
with dfun="binomial"
. See glmreg_fit
logical value for x variable standardization, prior to
fitting the model sequence. The coefficients are always returned on
the original scale. Default is standardize=TRUE
.
logical value: if TRUE (default), intercept(s) are fitted; otherwise, intercept(s) are set to zero
This is a number that multiplies lambda
to allow
differential shrinkage of coefficients. Can be 0 for some variables, which implies
no shrinkage, and that variable is always included in the
model. Default is same shrinkage for all variables.
a method to determine the initial values. If type.init="ncl"
, an intercept-only model as initial parameter and run irglmreg
regularization path forward from lambda_max to lambda_min. If type.init="heu"
, heuristic initial parameters and run irglmreg
path backward or forward depending on decreasing
, between lambda_min and lambda_max. If type.init="bst"
, run a boosting model with bst
in package bst, depending on mstop.init, nu.init
and run irglmreg
backward or forward depending on decreasing
.
character value for initial family, one of "clossR", "closs","gloss","qloss", which can be used to derive an initial estimator, if the selection is different from the default value
an integer giving the number of boosting iterations when type.init="bst"
a small number (between 0 and 1) defining the step size or shrinkage parameter when type.init="bst"
.
only used if lambda=NULL
, a logical value used to determine regularization path direction either from lambda_max to a potentially modified lambda_min or vice versa if type.init="bst", "heu"
. Since this is a nonconvex optimization, it is possible to generate different estimates for the same lambda
depending on decreasing
. The choice of decreasing
picks different starting values.
number of iteration in the IRCO algorithm
Within each IRCO algorithm iteration, maximum number of coordinate descent iterations for each lambda
value; default is 1000.
convergency criteria in the IRCO algorithm
If a coefficient is less than eps
in magnitude, then it is reported to be 0
If nlambda
> 1 and the relative loss values from two consecutive lambda
values change > epscycle
, then re-estimate parameters in an effort to avoid trap of local optimization.
Convergence threshold for coordinate descent. Defaults value is 1e-6
.
Type of regularization
an overdispersion scaling parameter for family="negbin"
If TRUE
, to compute solution of lambda
with parallel computing in number of n.cores
. If FALSE
, sequential computing. If NULL
, still sequential computing with a different convergence criteria based on penalized loss values
If TRUE
, fitting progress is reported. If tracelevel=2
, deeper level of fitting progress is reported.
Zhu Wang <zwang145@uthsc.edu>
A case weighted penalized least squares or GLM is fit by the iteratively reweighted convex optimization (IRCO), where the loss function is a composite function cfun
odfun
+ penalty. Here convex is the loss function induced by dfun
, not the penalty function.
The sequence of robust models implied by lambda
is fit by IRCO along with coordinate
descent. Note that the objective function is $$weights*loss + \lambda*penalty,$$ if standardize=FALSE
and $$
\frac{weights}{\sum(weights)}*loss + \lambda*penalty,$$ if standardize=TRUE
.
Zhu Wang (2024) Unified Robust Estimation, Australian & New Zealand Journal of Statistics. 66(1):77-102.
irglmreg