Model Terms with glmnet

Description

Constructor for estimating penalized model terms using the glmnet package.

Usage

gnet(formula, ...)

Arguments

formula A formula specifying the covariates that should be estimated using the glmnet implementation.
Control arguments passed to glmnet and the information-criterion-based shrinkage selection.

Details

gnet() constructs a model.matrix representation of the supplied formula and delegates estimation to glmnet inside the backfitting algorithm. The optimal penalty parameter is selected using an information criterion, with criterion = “bic” used by default.

Value

A special model-term object used internally by gamlss2.

See Also

la, gamlss2, specials.

Examples

library("gamlss2")



rent$Flc <- cut(rent$Fl, breaks = seq(20, 160, by = 10),
  include.lowest = TRUE)
rent$Ac <- cut(rent$A, breaks = seq(1890, 1990, by = 10),
  include.lowest = TRUE)

f <- R ~ gnet(~Flc + Ac + loc) |
  gnet(~Flc + Ac + loc) |
  gnet(~Flc + Ac + loc) |
  gnet(~Flc + Ac + loc)

m <- gamlss2(f, data = rent, family = BCT)

summary(m)