ncl: fit a nonconvex loss based robust linear model

View source: R/ncl.R

nclR Documentation

fit a nonconvex loss based robust linear model

Description

Fit a linear model via penalized nonconvex loss function.

Usage

## S3 method for class 'formula'
ncl(formula, data, weights, offset=NULL, contrasts=NULL, 
x.keep=FALSE, y.keep=TRUE, ...)
## S3 method for class 'matrix'
ncl(x, y, weights, offset=NULL, ...)
## Default S3 method:
ncl(x,  ...)

Arguments

formula

symbolic description of the model, see details.

data

argument controlling formula processing via model.frame.

weights

optional numeric vector of weights. If standardize=TRUE, weights are renormalized to weights/sum(weights). If standardize=FALSE, weights are kept as original input

x

input matrix, of dimension nobs x nvars; each row is an observation vector

y

response variable. Quantitative for rfamily="clossR" and -1/1 for classification.

offset

Not implemented yet

contrasts

the contrasts corresponding to levels from the respective models

x.keep, y.keep

For glmreg: logical values indicating whether the response vector and model matrix used in the fitting process should be returned as components of the returned value. For ncl_fit: x is a design matrix of dimension n * p, and x is a vector of observations of length n.

...

Other arguments passing to ncl_fit

Details

The robust linear model is fit by majorization-minimization along with linear regression. Note that the objective function is

weights*loss

.

Value

An object with S3 class "ncl" for the various types of models.

call

the call that produced this object

fitted.values

predicted values

h

pseudo response values in the MM algorithm

Author(s)

Zhu Wang <zwang145@uthsc.edu>

References

Zhu Wang (2021), MM for Penalized Estimation, TEST, doi: 10.1007/s11749-021-00770-2

See Also

print, predict, coef.

Examples

#binomial
x=matrix(rnorm(100*20),100,20)
g2=sample(c(-1,1),100,replace=TRUE)
fit=ncl(x,g2,s=1,rfamily="closs")

mpath documentation built on Jan. 7, 2023, 1:17 a.m.