glmreg_fit(x, y, weights, start=NULL, etastart=NULL, mustart=NULL,
nlambda=100, lambda=NULL, lambda.min.ratio=ifelse(nobs
family="gaussian"
.
Non-negative counts for family="poisson"
or family="negbin"
. For
family="binomial"
should be either a factor with two levels or
a vector of prlambda
values - default is 100. The sequence may be truncated before nlambda
is reached if a close to saturated model is fitted. See also satu
.lambda
sequencelambda
, 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 a closed formula for lambda.max
alpha=1 is lasso (mcp, scad) penalty; and alpha=0
the ridge penalty. However, if alpha=0
, one must provide lambda
values.\le>
snet
or mnet
penalty.penalty="mnet"
or penalty="snet"
with family
other than "gaussian". See referencestandardize=TRUE
.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 all1e-6
.family="binomial"
.lambda
value; default is 1000.eps
in magnitude, then it is reported to be 0penalty="mnet" or "snet"
.family="negbin"
TRUE
, fitting progress is reported"glmreg"
for the various types of models.length(lambda)
nvars x length(lambda)
matrix of coefficients.lambda
values usednlambda
sequence may be truncated before nlambda
is reached if satu=1
."gaussian"
, this
is the R-square). The deviance calculations incorporate weights if
present in the model. The deviance is defined to be 2*(loglike_sat -
loglike), where loglike_sat is the log-likelihood for the saturated
model (a model with a free parameter per observation).lambda
is fit by coordinate
descent. For family="gaussian"
this is the lasso, mcp or scad sequence if
alpha=1
, else it is the enet, mnet or snet sequence.
For the other families, this is a lasso (mcp, scad) or elastic net (mnet, snet) regularization path
for fitting the generalized linear regression
paths, by maximizing the appropriate penalized log-likelihood.
Note that the objective function for "gaussian"
is $$1/2*
weights*RSS + \lambda*penalty,$$ if standardize=FALSE
and $$1/2*
\frac{weights}{\sum(weights)}*RSS + \lambda*penalty,$$ if standardize=TRUE
. For the other models it is
$$-\sum (weights * loglik) + \lambda*penalty$$ if standardize=FALSE
and $$-\frac{weights}{\sum(weights)} * loglik + \lambda*penalty$$ if standardize=TRUE
.Zhu Wang, Shuangge Ma, Michael Zappitelli, Chirag Parikh, Ching-Yun Wang and Prasad Devarajan (2014) Penalized Count Data Regression with Application to Hospital Stay after Pediatric Cardiac Surgery, Statistical Methods in Medical Research. 2014 Apr 17. [Epub ahead of print]
glmreg