irglmreg {mpath} | R Documentation |
Fit a robust penalized generalized linear models
Description
Fit a robust penalized GLM where the loss function is a composite function cfun
odfun
+ penalty. This is the wrapper function of irglmreg_fit
Usage
## S3 method for class 'formula'
irglmreg(formula, data, weights, offset=NULL, contrasts=NULL, ...)
## S3 method for class 'matrix'
irglmreg(x, y, weights, offset=NULL, ...)
## Default S3 method:
irglmreg(x, ...)
Arguments
formula |
symbolic description of the model, see details. |
data |
argument controlling formula processing
via |
weights |
optional numeric vector of weights. If |
x |
input matrix, of dimension nobs x nvars; each row is an observation vector |
y |
response variable. Quantitative for |
offset |
Not implemented yet |
contrasts |
the contrasts corresponding to |
... |
Other arguments passing to |
Details
The computing is done by the iteratively reweighted penalized GLM, an application of the iteratively reweighted convex optimization (IRCO). Here convex is the loss function induced by dfun
, not the penalty function. The output weights_update
is a useful diagnostic to the outlier status of the observations.
The regularization path is computed for the lasso (or elastic net penalty), scad (or snet) and mcp (or mnet penalty), at a grid of values for the regularization parameter lambda.
The sequence of robust models implied by lambda
is fit by the 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
.
Value
An object with S3 class "irglmreg"
for the various types of models.
call |
the call that produced this object |
b0 |
Intercept sequence of length |
beta |
A |
lambda |
The actual sequence of |
nobs |
number of observations |
risk |
if |
pll |
if |
fitted.values |
predicted values depending on |
Author(s)
Zhu Wang <zwang145@uthsc.edu>
References
Zhu Wang (2024) Unified Robust Estimation, Australian & New Zealand Journal of Statistics. 66(1):77-102.
See Also
print
, predict
, coef
and plot
methods, and the cv.irglmreg
function.
Examples
#binomial
x=matrix(rnorm(100*20),100,20)
g2=sample(c(-1,1),100,replace=TRUE)
fit1=irglmreg(x,g2,s=1,cfun="ccave",dfun="gaussian",type.path="active",
decreasing=TRUE,type.init="bst")
#fit1$risk
## Not run:
### different solution paths via a combination of type.path, decreasing and type.init
fit1=irglmreg(x,g2,s=1,cfun="ccave",dfun="gaussian",type.path="active",
decreasing=TRUE,type.init="bst")
fit2=irglmreg(x,g2,s=1,cfun="ccave",dfun="gaussian",type.path="active",
decreasing=FALSE,type.init="bst")
fit3=irglmreg(x,g2,s=1,cfun="ccave",dfun="gaussian",type.path="nonactive",
decreasing=TRUE,type.init="bst")
fit4=irglmreg(x,g2,s=1,cfun="ccave",dfun="gaussian",type.path="nonactive",
decreasing=FALSE,type.init="bst")
fit5=irglmreg(x,g2,s=1,cfun="ccave",dfun="gaussian",type.path="active",
decreasing=TRUE,type.init="co")
fit6=irglmreg(x,g2,s=1,cfun="ccave",dfun="gaussian",type.path="active",
decreasing=FALSE,type.init="co")
fit7=irglmreg(x,g2,s=1,cfun="ccave",dfun="gaussian",type.path="nonactive",
decreasing=TRUE,type.init="co")
fit8=irglmreg(x,g2,s=1,cfun="ccave",dfun="gaussian",type.path="nonactive",
decreasing=FALSE,type.init="co")
## End(Not run)