Learn R Programming

islasso (version 1.6.0)

islasso.path: Induced Smoothed Lasso Regularization Path

Description

Fits a sequence of penalized regression models using the Induced Smoothing Lasso approach over a grid of lambda values. Supports elastic-net penalties and generalized linear models: Gaussian, Binomial, Poisson, and Gamma.

Usage

islasso.path(
  formula,
  family = gaussian(),
  lambda = NULL,
  nlambda = 100,
  lambda.min.ratio = ifelse(nobs < nvars, 0.01, 1e-04),
  alpha = 1,
  data,
  weights,
  subset,
  offset,
  contrasts = NULL,
  unpenalized,
  control = is.control()
)

Value

A list with components:

call

Matched function call.

Info

Matrix with diagnostics: lambda, deviance, degrees of freedom, dispersion, iterations, convergence status.

GoF

Model goodness-of-fit metrics: AIC, BIC, AICc, GCV, GIC, eBIC.

Coef

Matrix of coefficients across lambda values.

SE

Matrix of standard errors.

Weights

Matrix of mixing weights for the smoothed penalty.

Gradient

Matrix of gradients for the smoothed penalty.

Linear.predictors, Fitted.values, Residuals

Matrices of fitted quantities across the path.

Input

List of input arguments and design matrix.

control, formula, model, terms, data, xlevels, contrasts

Standard model components.

Arguments

formula

Model formula of type response ~ predictors.

family

Response distribution. Supported families: gaussian(), binomial(), poisson(), Gamma().

lambda

Optional numeric vector of lambda values. If not provided, a sequence is automatically generated.

nlambda

Integer. Number of lambda values to generate if lambda is missing. Default is 100.

lambda.min.ratio

Smallest lambda as a fraction of lambda.max. Default: 1e-2 if nobs < nvars, else 1e-3.

alpha

Elastic-net mixing parameter: alpha = 1 is lasso, alpha = 0 is ridge.

data

Data frame containing model variables.

weights

Optional observation weights.

subset

Optional logical or numeric vector to subset observations.

offset

Optional vector of prior known components for the linear predictor.

contrasts

Optional contrast settings for factor variables.

unpenalized

Optional vector of variable names or indices excluded from penalization.

control

A list of control parameters via is.control.

Author

Gianluca Sottile gianluca.sottile@unipa.it

Details

This function fits a regularization path of models using the induced smoothing paradigm, replacing the non-smooth L1 penalty with a differentiable surrogate. Standard errors are returned for all lambda points, allowing for Wald-based hypothesis testing. The regularization path spans a range of lambda values, either user-defined or automatically computed.

References

Cilluffo G., Sottile G., La Grutta S., Muggeo V.M.R. (2019). The Induced Smoothed Lasso: A practical framework for hypothesis testing in high dimensional regression. Statistical Methods in Medical Research. DOI: 10.1177/0962280219842890

Sottile G., Cilluffo G., Muggeo V.M.R. (2019). The R package islasso: estimation and hypothesis testing in lasso regression. Technical Report. DOI: 10.13140/RG.2.2.16360.11521

See Also

islasso, summary.islasso.path, coef.islasso.path, predict.islasso.path, GoF.islasso.path

Examples

Run this code
n <- 100; p <- 30; p1 <- 10  # number of nonzero coefficients

beta.veri <- sort(round(c(seq(.5, 3, length.out = p1/2),
                         seq(-1, -2, length.out = p1/2)), 2))
beta <- c(beta.veri, rep(0, p - p1))
sim1 <- simulXy(n = n, p = p, beta = beta, seed = 1, family = gaussian())
o <- islasso.path(y ~ ., data = sim1$data,
                  family = gaussian(), nlambda = 30L)
o

summary(o, lambda = 10, pval = 0.05)
coef(o, lambda = 10)
fitted(o, lambda = 10)
predict(o, type = "response", lambda = 10)
plot(o, yvar = "coef")
residuals(o, lambda = 10)
deviance(o, lambda = 10)
logLik(o, lambda = 10)
GoF.islasso.path(o)

if (FALSE) {
##### binomial ######
beta <- c(1, 1, 1, rep(0, p - 3))
sim2 <- simulXy(n = n, p = p, beta = beta, interc = 1, seed = 1,
                size = 100, family = binomial())
o2 <- islasso.path(cbind(y.success, y.failure) ~ ., data = sim2$data,
                   family = binomial(), lambda = seq(0.1, 100, l = 50L))
temp <- GoF.islasso.path(o2)
summary(o2, pval = 0.05, lambda = temp$lambda.min["BIC"])

##### poisson ######
beta <- c(1, 1, 1, rep(0, p - 3))
sim3 <- simulXy(n = n, p = p, beta = beta, interc = 1, seed = 1,
                family = poisson())
o3 <- islasso.path(y ~ ., data = sim3$data, family = poisson(), nlambda = 30L)
temp <- GoF.islasso.path(o3)
summary(o3, pval = 0.05, lambda = temp$lambda.min["BIC"])

##### Gamma ######
beta <- c(1, 1, 1, rep(0, p - 3))
sim4 <- simulXy(n = n, p = p, beta = beta, interc = -1, seed = 1,
                family = Gamma(link = "log"))
o4 <- islasso.path(y ~ ., data = sim4$data, family = Gamma(link = "log"),
                   nlambda = 30L)
temp <- GoF.islasso.path(o4)
summary(o4, pval = .05, lambda = temp$lambda.min["BIC"])
}

Run the code above in your browser using DataLab