Package 'islasso'

Title: The Induced Smoothed Lasso
Description: An implementation of the induced smoothing (IS) idea to lasso and elastic-net regularisation models, allowing estimation and inference (standard errors and Wald tests) on all the model coefficients. Any generalised linear model family can be used. The numerical core, written in C with 'BLAS' and 'LAPACK', solves the smoothed estimating equations by majorization-minimization or Newton iterations and uses low-rank matrix identities when the covariates outnumber the observations. The method is described in Cilluffo et al. (2020) <doi:10.1177/0962280219842890> and in a tutorial <doi:10.13140/RG.2.2.16360.11521>.
Authors: Gianluca Sottile [aut, cre] (ORCID: <https://orcid.org/0000-0001-9347-7251>), Giovanna Cilluffo [aut], Vito M. R. Muggeo [aut]
Maintainer: Gianluca Sottile <[email protected]>
License: GPL (>= 2)
Version: 1.7.0
Built: 2026-11-27 20:13:02 UTC
Source: https://github.com/gianluca-sottile/islasso

Help Index


Optimal Tuning Parameter by Information Criteria

Description

Selects the tuning parameter lambda of an islasso() model by minimising an information criterion (AIC, BIC/eBIC, AICc, GCV or GIC; see islasso.path() for the definitions), as an alternative to cross-validation.

Usage

aic.islasso(
  object,
  method = c("AIC", "BIC", "AICc", "GCV", "GIC"),
  interval,
  g = 0,
  y,
  X,
  intercept = FALSE,
  family = gaussian(),
  alpha = 1,
  offset,
  weights,
  unpenalized,
  control = is.control(),
  trace = TRUE
)

Arguments

object

a fitted model of class "islasso" (optional if y and X are given).

method

the criterion to minimise.

interval

the search interval for lambda; by default the range of the glmnet path used to obtain the starting values of object.

g

numeric in [0, 1]: the parameter of the extended BIC (g = 0 gives the BIC).

y, X

response and model matrix (without the column of ones), used if object is missing.

intercept, family, alpha, offset, weights, unpenalized, control

as in islasso.fit(), used if object is missing.

trace

logical: print the progress of the optimisation?

Details

The criterion is minimised over log⁡λ\log\lambda with stats::optimize(); the degrees of freedom are the effective number of parameters (trace of the pseudo hat matrix).

Value

The value of lambda minimising the criterion.

Author(s)

Gianluca Sottile [email protected]

See Also

islasso(), islasso.path(), GoF.islasso.path()

Examples

n <- 100; p <- 30
beta <- c(rep(1, 5), rep(0, p - 5))
sim1 <- simulXy(n = n, p = p, beta = beta, seed = 1, family = gaussian())
o <- islasso(y ~ ., data = sim1$data, family = gaussian(), lambda = 5)
lambda.bic <- aic.islasso(o, method = "BIC", interval = c(1, 50), trace = FALSE)
o2 <- update(o, lambda = lambda.bic)

General Linear Hypotheses for islasso Models

Description

Tests general linear hypotheses and computes confidence intervals for linear combinations of coefficients from a fitted islasso model.

Usage

## S3 method for class 'islasso'
anova(object, A, b = NULL, ci, ...)

Arguments

object

A fitted model object of class "islasso".

A

Hypothesis specification. Either:

  • A numeric matrix or vector with each row specifying a linear combination of coefficients,

  • Or a character vector with symbolic expressions (e.g. "X1 + X2 = 3").

b

Right-hand side vector for the null hypotheses A %*% beta = b. If omitted, defaults to zeros.

ci

Optional 2-column matrix of confidence intervals for coefficients.

...

Currently unused.

Details

The method tests the null hypothesis H0:Aβ=bH_0: A \beta = b, where AA and bb define a linear constraint on model coefficients.

Symbolic expressions support natural syntax: coefficients may be added/subtracted, constants may be multiplied (e.g. "2 * X1 + 3 * X2 = 7"). Equations with omitted = assume zero on the right-hand side. See examples for syntax flexibility.

Value

An object of class "anova.islasso" containing:

Estimate

Linear combination estimates

SE

Standard errors

Wald

Wald statistics

p-value

Associated p-values

Author(s)

Gianluca Sottile [email protected]

See Also

islasso, summary.islasso, confint.islasso, predict.islasso, logLik.islasso, residuals.islasso

Examples

n <- 100; p <- 100
set.seed(1)
beta <- c(runif(10, -2, 2), rep(0, p - 10))
sim <- simulXy(n = n, p = p, beta = beta, seed = 1, family = gaussian())
fit <- islasso(y ~ . -1, data = sim$data, family = gaussian(), lambda = 10)

# Test if first 5 variables sum to -7.5
anova(fit, A = c("X1 + X2 + X3 + X4 + X5 = -7.5"))

# Test multiple hypotheses
anova(fit, A = c("X1 + X2 + X3 + X4 + X5", "X6 + X7 + X8 + X9 + X10"), b = c(-7.5, 8.75))

# Full diagonal comparison to true coefficients
anova(fit, A = diag(p), b = beta)

Breast Cancer microarray experiment

Description

This data set details a microarray experiment for 52 breast cancer patients. The binary variable status indicates whether or not the patient died of breast cancer (status = 0: did not die, status = 1: died). The other variables represent amplification or deletion of specific genes.

Format

A data frame with 52 rows and multiple variables, including a binary status and gene-level measurements.

Details

Unlike gene expression studies, this experiment focuses on measuring gene amplification or deletion-the number of DNA copies for a given genomic sequence. The goal is to identify key genomic markers distinguishing aggressive from non-aggressive breast cancer.

The experiment was conducted by Dr. John Bartlett and Dr. Caroline Witton in the Division of Cancer Sciences and Molecular Pathology at the University of Glasgow's Royal Infirmary.

Source

Dr. John Bartlett and Dr. Caroline Witton, Division of Cancer Sciences and Molecular Pathology, University of Glasgow, Glasgow Royal Infirmary.

References

Augugliaro L., Mineo A.M. and Wit E.C. (2013). dgLARS: a differential geometric approach to sparse generalized linear models, Journal of the Royal Statistical Society. Series B, Vol 75(3), 471-498. Wit E.C. and McClure J. (2004). Statistics for Microarrays: Design, Analysis and Inference, Chichester: Wiley.

Examples

data(breast)
str(breast)
table(breast$status)

## Not run: 
  fit <- islasso.path(status ~ ., data = breast, family = binomial(), alpha = 0)
  temp <- GoF.islasso.path(fit, plot = FALSE)
  lambda.aic <- temp$lambda.min["AIC"]
  fit.aic <- islasso(status ~ ., data = breast, family = binomial(),
                     alpha = 0, lambda = lambda.aic)
  summary(fit.aic, pval = 0.05)

## End(Not run)

confint method for islasso objects

Description

Computes confidence intervals for islasso objects using a Wald-type approach.

Usage

## S3 method for class 'islasso'
confint(object, parm, level = 0.95, type.ci = "wald", trace = TRUE, ...)

Arguments

object

A fitted model object of class "islasso".

parm

A specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered.

level

The confidence level required.

type.ci

Character. Only Wald-type confidence intervals are implemented yet! Set type.ci = "wald" to use estimates and standard errors to build the confidence interval.

trace

Not used (kept for compatibility).

...

Additional arguments for methods.

Details

confint method for islasso objects

Author(s)

Maintainer: Gianluca Sottile [email protected]

See Also

islasso.fit, summary.islasso, residuals.islasso, logLik.islasso, predict.islasso, deviance.islasso

Examples

n <- 100; p <- 100; p1 <- 10
beta.veri <- sort(round(c(seq(0.5, 3, length.out = p1 / 2),
                          seq(-1, -2, length.out = p1 / 2)), 2))
beta <- c(beta.veri, rep(0, p - p1))
sim <- simulXy(n = n, p = p, beta = beta, seed = 1, family = gaussian())
o <- islasso(y ~ ., data = sim$data, family = gaussian())

ci <- confint(o, type.ci = "wald", parm = 1:11)
ci
plot(ci)

Blood and other measurements in diabetics

Description

The diabetes data frame contains 442 observations used in the Efron et al. "Least Angle Regression" paper.

Format

A data frame with 442 rows and 3 columns:

x

Matrix with 10 numeric columns (standardized)

y

Numeric response vector

x2

Matrix with 64 columns including interactions

Details

The x matrix has been standardized to have unit L2 norm and zero mean in each column. The x2 matrix extends x by adding selected interaction terms.

Source

https://web.stanford.edu/~hastie/Papers/LARS/LeastAngle_2002.ps

References

Efron, Hastie, Johnstone and Tibshirani (2003). "Least Angle Regression" (with discussion), Annals of Statistics.

Examples

data(diabetes)
str(diabetes)
summary(diabetes$y)

## Not run: 
  fit <- islasso(y ~ ., data = data.frame(y = diabetes$y, diabetes$x2),
                 family = gaussian())
  summary(fit, pval = 0.05)
  lambda.aic <- aic.islasso(fit, interval = c(1, 100), trace = FALSE)
  fit.aic <- update(fit, lambda = lambda.aic)
  summary(fit.aic, pval = 0.05)

## End(Not run)

Select the Tuning Parameter by Information Criteria

Description

Finds, along an islasso.path() fit, the values of lambda minimising the information criteria AIC, BIC, AICc, eBIC, GCV and GIC (see islasso.path() for their definitions).

Usage

GoF.islasso.path(object, plot = TRUE, ...)

Arguments

object

a fitted model of class "islasso.path".

plot

logical: should the criteria be plotted against log⁡λ\log\lambda?

...

not used.

Details

The degrees of freedom are the effective number of parameters (trace of the pseudo hat matrix), which is not necessarily an integer.

Value

A list with components

gof

the matrix of criteria along the path;

minimum

the positions of the minima;

lambda.min

the values of lambda minimising each criterion;

plot

the ggplot object (if plot = TRUE).

Author(s)

Gianluca Sottile [email protected]

See Also

islasso.path(), summary.islasso.path(), predict.islasso.path()

Examples

n <- 100; p <- 30
beta <- c(runif(10, -2, 2), rep(0, p - 10))
sim <- simulXy(n = n, p = p, beta = beta, seed = 1, family = gaussian())
fit <- islasso.path(y ~ ., data = sim$data, family = gaussian(), nlambda = 30)
GoF.islasso.path(fit, plot = FALSE)$lambda.min

Control Parameters for islasso Fitting

Description

Collects the parameters controlling the fitting process of islasso() and islasso.path().

Usage

is.control(
  sigma2 = -1,
  tol = 1e-05,
  itmax = 1000,
  stand = TRUE,
  trace = 0,
  nfolds = 5,
  seed = NULL,
  adaptive = FALSE,
  g = 0.5,
  b0 = NULL,
  V0 = NULL,
  c = 0.5,
  inner = c("mm", "newton"),
  solver = c("auto", "dense", "woodbury"),
  ncores = 1L,
  ...
)

Arguments

sigma2

fixed value of the dispersion parameter; if negative (default) it is estimated (Pearson statistic over the residual degrees of freedom). Ignored for the binomial, Poisson and negative binomial families, where it is 1.

tol

tolerance of the convergence criteria (default 1e-5).

itmax

maximum number of iterations (default 1000).

stand

logical: should the covariates be standardised (default TRUE)? With stand = TRUE the penalty acts on the standardised coefficients, as in glmnet; estimates are always returned on the original scale.

trace

integer: 0 (default) silent, 1 compact and 2 detailed printing of the iterations.

nfolds

number of folds for the cross-validation used when lambda is missing.

seed

optional integer seed for the cross-validation folds (the random number generator state of the session is restored afterwards).

adaptive

logical: adaptive lasso with weights based on the pseudo hat values (experimental).

g

numeric in [0, 1]: the parameter of the extended BIC (g = 0 gives the BIC).

b0

optional starting values for the coefficients (original scale, intercept first).

V0

optional starting covariance matrix (or a number for its diagonal) on the standardised scale; default 0.01.

c

the mixture weight of the induced smoothing (default 0.5), a number in [0, 1] or a vector with one value per coefficient; a negative value means that the weights are re-estimated at each iteration.

inner

the algorithm solving the smoothed estimating equation at fixed standard errors: "mm" (default, monotone majorise-minimise iterations, the undamped version of the fixed-point iterations of islasso 1.6) or "newton" (Newton's method with line search).

solver

linear algebra: "auto" (default) uses "woodbury" when the number of columns exceeds twice the number of observations and "dense" otherwise.

ncores

number of cores used by islasso.path() to fit the models for the different values of lambda in parallel (socket cluster of package 'parallel'); default 1.

...

further arguments, ignored (allows do.call(is.control, control)).

Value

A list with the control parameters.

Author(s)

Gianluca Sottile [email protected]

See Also

islasso(), islasso.path()

Examples

is.control(tol = 1e-6, seed = 1)

The Induced Smoothed Lasso

Description

Fits regression models with a smoothed lasso (or elastic-net) penalty under the induced smoothing paradigm, which yields point estimates, standard errors and Wald tests for all the coefficients.

Usage

islasso(
  formula,
  family = gaussian,
  lambda,
  alpha = 1,
  data,
  weights,
  subset,
  offset,
  unpenalized,
  contrasts = NULL,
  control = is.control()
)

islasso.fit(
  X,
  y,
  family = gaussian,
  lambda,
  alpha = 1,
  intercept = FALSE,
  weights = NULL,
  offset = NULL,
  unpenalized = NULL,
  control = is.control()
)

Arguments

formula

a symbolic description of the model (see stats::formula()).

family

the error distribution and link function: a family object, a family function or its name. Any family accepted by stats::glm() can be used, for instance gaussian(), binomial() (links logit, probit, cauchit, log, cloglog), poisson(), Gamma(), inverse.gaussian(), the ⁠quasi*⁠ families and MASS::negative.binomial() with known theta.

lambda

the tuning parameter (a non-negative number). If missing, it is chosen by cross-validation with glmnet::cv.glmnet() (see nfolds and seed in is.control()). With lambda = 0 the model is not penalized (same estimates as glm()) and the model matrix must have full column rank: aliased terms (NA coefficients in glm()) give an error.

alpha

the elastic-net mixing parameter, 0≤α≤10 \le \alpha \le 1: alpha = 1 is the lasso, alpha = 0 the ridge penalty.

data

an optional data frame containing the variables in the model.

weights

optional vector of prior weights.

subset

an optional vector specifying a subset of observations.

offset

an optional offset in the linear predictor.

unpenalized

names or indices (with respect to the columns of the model matrix without intercept) of the coefficients left unpenalized. The intercept is never penalized.

contrasts

an optional list of contrasts for the factors (see stats::model.matrix()).

control

a list of control parameters, see is.control().

X, y

for islasso.fit(): the model matrix (without the column of ones) and the response.

intercept

for islasso.fit(): logical, should an (unpenalized) intercept be included?

Details

For a fixed λ\lambda the lasso estimating equation −X⊤W(z−Xβ)+λ sign(β)=0-X^\top W (z - X\beta) + \lambda\,\mathrm{sign}(\beta) = 0 is not smooth. The induced smoothing (IS) approach (Brown and Wang, 2005) replaces sign(βj)\mathrm{sign}(\beta_j) by its expectation under the approximate sampling distribution of the estimator, modelled as the mixture c N(0,1)+(1−c) N(0,10−10)c\,N(0,1) + (1-c)\,N(0,10^{-10}) of a continuous component and a component concentrated at zero:

Pj=c {2Φ(βj/sj)−1}+(1−c) {2Φ(105βj/sj)−1},P_j = c\,\{2\Phi(\beta_j/s_j) - 1\} + (1-c)\,\{2\Phi(10^5 \beta_j/s_j) - 1\},

where sjs_j is the standard error of β^j\hat\beta_j. The smoothed equation U~(β)=−X⊤W(z−Xβ)+λ{αP+(1−α)β}=0\tilde U(\beta) = -X^\top W(z - X\beta) + \lambda\{\alpha P + (1-\alpha)\beta\} = 0 admits the derivative U~′(β)=X⊤WX+λ diag{αP′+1−α}\tilde U'(\beta) = X^\top W X + \lambda\,\mathrm{diag}\{\alpha P' + 1 - \alpha\}, and the covariance matrix is obtained by the sandwich formula V=ϕ U~′−1X⊤WX U~′−1V = \phi\,\tilde U'^{-1} X^\top W X\, \tilde U'^{-1}. Point estimates and standard errors are computed alternately until the standard errors stabilise.

At fixed standard errors, U~\tilde U is the gradient of a smooth convex function, which is minimised by a monotone majorise-minimise algorithm (default) or by Newton's method with line search (inner = "newton" in is.control()). When the number of columns exceeds twice the number of observations, the linear algebra uses the Woodbury identity, with cost O(n2p)O(n^2 p) instead of O(p3)O(p^3). Generalised linear models are fitted by iteratively reweighted least squares, so any family with the usual components (linkinv, mu.eta, variance, dev.resids) is supported.

With stand = TRUE (default in is.control()) the covariates are standardised (weighted mean and standard deviation with divisor ∑w\sum w, as in glmnet) and the penalty acts on the standardised coefficients; the results are reported on the original scale. The scale of lambda is that of the deviance: λ=∑iwi λglmnet\lambda = \sum_i w_i\,\lambda_{glmnet}.

Since the smoothed penalty is never exactly flat, no estimate is exactly zero: the Wald statistics, rather than the point estimates, are used to judge which covariates matter. For coefficients whose estimate is shrunk to (practically) zero the induced-smoothing fixed point drives the standard error towards zero as well, while the Wald ratio stays stable: their standard errors depend on the convergence tolerance and should not be used to build confidence intervals. See vignette("islasso-methodology", package = "islasso").

Value

An object of class "islasso", a list with components including

coefficients, se

estimates and standard errors on the original scale;

dispersion

the dispersion parameter;

fitted.values, linear.predictors, residuals, weights, prior.weights

as in stats::glm() (residuals are the working residuals and weights the working weights);

deviance, null.deviance, aic, rank, df.residual, df.null

deviance-based summaries; rank is the effective number of parameters, the sum of the pseudo hat values;

converged, iter

convergence flag and number of iterations;

lambda, alpha, family, control, call, formula, terms, model, data, xlevels, contrasts, offset, y

the inputs;

internal

other internal quantities (full covariance matrix, pseudo hat values hi, gradient, mixture weights, standardisation constants, ...).

Author(s)

Gianluca Sottile [email protected]

References

Cilluffo G., Sottile G., La Grutta S., Muggeo V.M.R. (2020). The induced smoothed lasso: a practical framework for hypothesis testing in high dimensional regression. Statistical Methods in Medical Research, 29(3), 765–777. 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

Brown B.M., Wang Y.G. (2005). Standard errors and covariance matrices for smoothed rank estimators. Biometrika, 92(1), 149–158. doi:10.1093/biomet/92.1.149

See Also

summary.islasso(), confint.islasso(), predict.islasso(), anova.islasso(), plot.islasso(), aic.islasso(), relax.islasso(), islasso.path(), is.control(), simulXy()

Examples

n <- 100; p <- 50
beta <- c(rep(1, 5), rep(0, p - 5))
sim1 <- simulXy(n = n, p = p, beta = beta, seed = 1, family = gaussian())
o <- islasso(y ~ ., data = sim1$data, family = gaussian(), lambda = 10)
summary(o, pval = 0.05)
head(coef(o))
logLik(o)


# lambda chosen by 5-fold cross-validation (reproducible through 'seed')
o <- islasso(y ~ ., data = sim1$data, control = is.control(seed = 1))
summary(relax.islasso(o), pval = 0.05)

# 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(cbind(y.success, y.failure) ~ ., data = sim2$data, family = binomial(),
              lambda = 5)
summary(o2, pval = 0.05)

# Poisson
sim3 <- simulXy(n = n, p = p, beta = beta, interc = 1, seed = 1, family = poisson())
o3 <- islasso(y ~ ., data = sim3$data, family = poisson(), lambda = 5)
summary(o3, pval = 0.05)

# Gamma with log link
sim4 <- simulXy(n = n, p = p, beta = beta, interc = -1, seed = 1, dispersion = 0.1,
                family = Gamma(link = "log"))
o4 <- islasso(y ~ ., data = sim4$data, family = Gamma(link = "log"), lambda = 5)
summary(o4, pval = 0.05)

Induced Smoothed Lasso Regularization Path

Description

Fits the induced smoothed lasso (or elastic net) over a grid of values of the tuning parameter, with warm starts.

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()
)

islasso.path.fit(
  X,
  y,
  family = gaussian(),
  lambda = NULL,
  nlambda = 100,
  lambda.min.ratio = ifelse(NROW(X) < NCOL(X), 0.01, 1e-04),
  alpha = 1,
  intercept = FALSE,
  weights = NULL,
  offset = NULL,
  unpenalized = NULL,
  control = is.control()
)

Arguments

formula

a symbolic description of the model (see stats::formula()).

family

the error distribution and link function: a family object, a family function or its name. Any family accepted by stats::glm() can be used, for instance gaussian(), binomial() (links logit, probit, cauchit, log, cloglog), poisson(), Gamma(), inverse.gaussian(), the ⁠quasi*⁠ families and MASS::negative.binomial() with known theta.

lambda

optional vector of values of the tuning parameter; by default a sequence of nlambda values, log-equispaced between lambda.min.ratio * lambda.max and lambda.max, the smallest value giving (practically) null penalized coefficients.

nlambda

number of values of lambda (default 100).

lambda.min.ratio

ratio between the smallest and the largest value of lambda; default 1e-2 if the number of observations is smaller than the number of covariates and 1e-4 otherwise.

alpha

the elastic-net mixing parameter, 0≤α≤10 \le \alpha \le 1: alpha = 1 is the lasso, alpha = 0 the ridge penalty.

data

an optional data frame containing the variables in the model.

weights

optional vector of prior weights.

subset

an optional vector specifying a subset of observations.

offset

an optional offset in the linear predictor.

contrasts

an optional list of contrasts for the factors (see stats::model.matrix()).

unpenalized

names or indices (with respect to the columns of the model matrix without intercept) of the coefficients left unpenalized. The intercept is never penalized.

control

a list of control parameters, see is.control().

X, y

for islasso.fit(): the model matrix (without the column of ones) and the response.

intercept

for islasso.fit(): logical, should an (unpenalized) intercept be included?

Details

Each model of the path is fitted as islasso() would do at the same value of lambda (starting values from the glmnet path, standard errors started at their default values), so that the path and a single fit agree; with the Gaussian family the matrix X⊤WXX^\top W X is computed once for the whole path. The models are independent and can be fitted in parallel with control = is.control(ncores = ) (socket cluster of the 'parallel' package; worthwhile for large problems, since starting the workers takes about a second). Every model is kept in the output, together with its convergence flag (column conv of Info), except those for which the algorithm failed (a warning is given). The information criteria stored in GoF are AIC=−2ℓ+2 dfAIC = -2\ell + 2\,df, BIC=−2ℓ+log⁡(n) dfBIC = -2\ell + \log(n)\,df, AICc=AIC+2 df(df+1)/(n−df−1)AICc = AIC + 2\,df(df+1)/(n-df-1), eBIC=−2ℓ+{log⁡(n)+2glog⁡(p)} dfeBIC = -2\ell + \{\log(n) + 2g\log(p)\}\,df, GCV=n D/(n−df)2GCV = n\,D/(n-df)^2 (with DD the deviance) and GIC=−2ℓ+log⁡log⁡(n)log⁡(p) dfGIC = -2\ell + \log\log(n)\log(p)\,df, where dfdf is the effective number of parameters (sum of the pseudo hat values) and −2ℓ-2\ell is replaced by the deviance when p≥np \ge n or the family has no likelihood.

Value

An object of class "islasso.path", a list with components

Coef, SE, Weight, Gradient

matrices (one row per value of lambda, in increasing order) of estimates, standard errors, mixture weights and gradients of the smoothed estimating equation (a convergence diagnostic, numerically close to zero);

Score

matrix of standardized scores {xj⊤W(z−Xβ^)/λj−(1−α)β^j}/α\{x_j^\top W(z - X\hat\beta)/\lambda_j - (1-\alpha)\hat\beta_j\}/\alpha (standardized covariates), equal at the solution to the smoothed sign Pj∈[−1,1]P_j \in [-1, 1]: the induced-smoothing analogue of the lasso / elastic-net optimality conditions (0 for unpenalized columns, NA for the ridge penalty, alpha = 0);

Info

matrix with columns lambda, df, phi, deviance, logLik, iter, err, conv;

GoF

matrix of information criteria (AIC, BIC, AICc, eBIC, GCV, GIC);

Linear.predictors, Fitted.values, Residuals

matrices with one row per value of lambda;

Input

list with n, p, intercept, unpenalized;

call, family, prior.weights, y, offset, alpha, control, formula, model, terms, data, xlevels, contrasts

the inputs.

Author(s)

Gianluca Sottile [email protected]

References

Cilluffo G., Sottile G., La Grutta S., Muggeo V.M.R. (2020). The induced smoothed lasso: a practical framework for hypothesis testing in high dimensional regression. Statistical Methods in Medical Research, 29(3), 765–777. doi:10.1177/0962280219842890

See Also

plot.islasso.path(), predict.islasso.path(), summary.islasso.path(), GoF.islasso.path(), islasso(), is.control()

Examples

n <- 100; p <- 30; p1 <- 10
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)
GoF.islasso.path(o, plot = FALSE)$lambda.min


plot(o, yvar = "coefficients", gof = "AIC")
# standardized scores: +-1 for the relevant covariates, inside (-1, 1) for the others
plot(o, yvar = "score", gof = "AIC", label = TRUE)

# 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, plot = FALSE)
summary(o3, pval = 0.05, lambda = temp$lambda.min["BIC"])

Diagnostic Plots for islasso Models

Description

Produces standard diagnostic plots for a fitted islasso model to assess residuals, model fit, and variance structure.

Usage

## S3 method for class 'islasso'
plot(x, ...)

Arguments

x

An object of class "islasso", typically created via islasso.

...

Graphical parameters: cex (point size), pch (point shape), col (colour of the reference lines) and lwd (their width).

Details

Draws a 2x2 grid of ggplot2 diagnostic plots:

  • Top-left: standardized deviance residuals (adjusted for leverage) vs linear predictor.

  • Top-right: normal Q-Q plot of the standardized deviance residuals (red line = reference).

  • Bottom-left: squared standardized Pearson residuals vs fitted values (variance function).

  • Bottom-right: working response vs linear predictor (link function).

The leverages are the diagonal elements of W1/2XU~′−1X⊤W1/2W^{1/2} X \tilde U'^{-1} X^\top W^{1/2}, computed from the derivative of the smoothed estimating equation; their sum is the effective number of parameters.

Value

Invisibly, a list with the four ggplot objects.

Author(s)

Gianluca Sottile [email protected]

See Also

islasso, summary.islasso, residuals.islasso, logLik.islasso, predict.islasso, deviance.islasso

Examples

sim <- simulXy(n = 100, p = 20, beta = c(1, -1, 0.5, rep(0, 17)), seed = 1)
fit <- islasso(y ~ ., data = sim$data, family = gaussian(), lambda = 8)
plot(fit)

Coefficient Profile and Diagnostic Plots for islasso.path

Description

Generates plots of coefficient profiles, standard errors, gradients, weights, or goodness-of-fit criteria from a fitted islasso.path model.

Usage

## S3 method for class 'islasso.path'
plot(
  x,
  yvar = c("coefficients", "se", "score", "gradient", "weight", "gof"),
  gof = c("none", "AIC", "BIC", "AICc", "eBIC", "GCV", "GIC"),
  label = FALSE,
  legend = FALSE,
  ...
)

Arguments

x

An object of class "islasso.path", typically created via islasso.path.

yvar

Character. Specifies what to display on the y-axis. Choices are:

  • "coefficients" - coefficient paths over log(lambda),

  • "se" - standard errors over log(lambda),

  • "score" - standardized scores over log(lambda), the induced-smoothing analogue of the lasso / elastic-net optimality conditions (dashed lines at ±1\pm 1); not available for the ridge penalty (alpha = 0),

  • "gradient" - gradient of the smoothed estimating equation over log(lambda) (a convergence check, numerically zero),

  • "weight" - mixture weights used in smoothing,

  • "gof" - goodness-of-fit values.

gof

Character. Criterion used for highlighting active variables. Choices: "none", "AIC", "BIC", "AICc", "eBIC", "GCV", "GIC".

label

Logical. Whether to annotate curves with variable names.

legend

Logical. Whether to display a plot legend.

...

Additional graphical parameters, e.g. main, xlab, ylab, xlim, ylim, lty, col, lwd, cex.axis, cex.lab, cex.main, gof_lty, gof_col, gof_lwd.

Details

This function visualizes the behavior of the solution path across a sequence of lambda values, helping diagnose coefficient shrinkage, influence of penalty, and variable selection stability. All the profiles are drawn against log⁡λ\log\lambda.

The standardized score of a covariate, sj={xj⊤W(z−Xβ^)/λ−(1−α)β^j}/αs_j = \{x_j^\top W(z - X\hat\beta)/\lambda - (1-\alpha)\hat\beta_j\}/\alpha (computed on the standardized scale on which the penalty acts), equals at the solution the smoothed sign PjP_j: it is close to ±1\pm 1 for the covariates with sizeable effects and strictly inside (−1,1)(-1, 1) for those shrunk towards zero, as the subgradient conditions of the lasso and of the elastic net (for α=1\alpha = 1 it is simply xj⊤W(z−Xβ^)/λx_j^\top W(z - X\hat\beta)/\lambda). With the ridge penalty (α=0\alpha = 0) there is no sign term and the score is not defined. The gradient, instead, is the residual of the smoothed estimating equation at the solution: it is zero up to numerical precision and is useful only as a check of convergence.

Value

A ggplot object (printed when not assigned).

Author(s)

Gianluca Sottile [email protected]

See Also

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

Examples

set.seed(1)
n <- 100; p <- 30
beta <- c(runif(10, -2, 2), rep(0, p - 10))
sim <- simulXy(n = n, p = p, beta = beta, seed = 1, family = gaussian())
fit <- islasso.path(y ~ ., data = sim$data, family = gaussian(), nlambda = 30)
plot(fit, yvar = "coefficients", gof = "AICc", label = TRUE)
plot(fit, yvar = "se", gof = "AICc")
plot(fit, yvar = "score", gof = "AICc")
plot(fit, yvar = "gradient", gof = "AICc")
plot(fit, yvar = "gof", gof = "AICc")

Prediction Method for islasso Objects

Description

Computes predictions from a fitted islasso model object. Multiple output types supported, including response scale, linear predictor, and coefficient values.

Usage

## S3 method for class 'islasso'
predict(
  object,
  newdata = NULL,
  type = c("link", "response", "coefficients", "class", "terms"),
  se.fit = FALSE,
  ci = NULL,
  type.ci = "wald",
  level = 0.95,
  terms = NULL,
  na.action = na.pass,
  ...
)

Arguments

object

A fitted model of class "islasso".

newdata

Optional data frame containing predictors for prediction. If omitted, the fitted model matrix is used.

type

Character. Specifies the prediction scale:

  • "link" (default): linear predictor scale;

  • "response": original response scale;

  • "coefficients": estimated coefficients;

  • "class": predicted class (only for binomial() family);

  • "terms": contribution of each term to the linear predictor.

se.fit

Logical. If TRUE, Wald confidence intervals (at level level) are returned together with the predictions (on the scale of type).

ci

Optional. Precomputed matrix of confidence intervals for the coefficients (2 columns), e.g. from confint.islasso.

type.ci

Type of interval. Only "wald" is implemented.

level

Confidence level for intervals. Default is 0.95.

terms

If type = "terms", optionally specify which terms to extract.

na.action

Function to handle missing values in newdata. Default: na.pass.

...

Additional arguments passed to downstream methods.

Value

A numeric vector or, with se.fit = TRUE or type = "terms", a matrix.

Author(s)

Gianluca Sottile [email protected]

See Also

islasso, summary.islasso, logLik.islasso, residuals.islasso, deviance.islasso

Examples

set.seed(1)
n <- 100; p <- 100
beta <- c(runif(20, -3, 3), rep(0, p - 20))
sim <- simulXy(n = n, p = p, beta = beta, seed = 1, family = gaussian())
fit <- islasso(y ~ ., data = sim$data, family = gaussian(), lambda = 2)
head(predict(fit, type = "response"))
predict(fit, newdata = sim$data[1:3, ], se.fit = TRUE)

Prediction Method for islasso.path Objects

Description

Generates predictions from a fitted islasso.path model at one or more lambda values. Supports various output types including linear predictors, response scale, class labels, and coefficients.

Usage

## S3 method for class 'islasso.path'
predict(
  object,
  newdata,
  type = c("link", "response", "coefficients", "class"),
  lambda,
  ...
)

Arguments

object

A fitted model object of class "islasso.path".

newdata

Optional data frame containing covariates for prediction. If omitted, returns fitted values from the original model.

type

Character. Type of prediction:

  • "link" (default) - linear predictor scale,

  • "response" - original response scale,

  • "coefficients" - estimated coefficients,

  • "class" - predicted class labels (only for binomial models).

lambda

Numeric value(s). Specific lambda value(s) at which predictions are required. If missing, predictions are computed for the full lambda sequence.

...

Additional arguments passed to lower-level methods.

Details

For values of lambda not in the path, the coefficients are linearly interpolated on the log⁡λ\log\lambda scale.

Value

A vector or a matrix (one column per value of lambda) depending on type.

Author(s)

Gianluca Sottile [email protected]

See Also

islasso.path, summary.islasso.path, coef.islasso.path, GoF.islasso.path, fitted.islasso.path, logLik.islasso.path, residuals.islasso.path, deviance.islasso.path

Examples

set.seed(1)
n <- 100; p <- 30
beta <- c(runif(10, -3, 3), rep(0, p - 10))
sim <- simulXy(n = n, p = p, beta = beta, seed = 1, family = gaussian())
fit <- islasso.path(y ~ ., data = sim$data, family = gaussian(), nlambda = 30)
optimal <- GoF.islasso.path(fit, plot = FALSE)
pred <- predict(fit, newdata = sim$data[1:5, ], type = "response",
                lambda = optimal$lambda.min[c("AIC", "BIC")])
pred

Prostate Cancer Data

Description

This dataset originates from a study examining the correlation between prostate-specific antigen levels and various clinical measures in men scheduled for radical prostatectomy. It contains 97 rows and 9 variables.

Format

A data frame with 97 observations and 9 variables:

lcavol

Log of cancer volume

lweight

Log of prostate weight

age

Age of the patient

lbph

Log of benign prostatic hyperplasia amount

svi

Seminal vesicle invasion (binary)

lcp

Log of capsular penetration

gleason

Gleason score

pgg45

Percentage of Gleason scores 4 or 5

lpsa

Log of prostate-specific antigen

Source

Stamey, T.A., et al. (1989). Prostate specific antigen in the diagnosis and treatment of adenocarcinoma of the prostate: II. radical prostatectomy treated patients. Journal of Urology, 141(5), 1076-1083.

References

Stamey, T.A., Kabalin, J.N., McNeal, J.E., Johnstone, I.M., Freiha, F., Redwine, E.A., and Yang, N. (1989). Journal of Urology, 141(5), 1076-1083.

Examples

data(Prostate)
summary(Prostate)
cor(Prostate$lpsa, Prostate$lcavol)

fit <- islasso(lpsa ~ ., data = Prostate, family = gaussian(),
               control = is.control(seed = 1))
summary(fit, pval = 0.05)
lambda.aic <- aic.islasso(fit, method = "AIC", trace = FALSE)
fit.aic <- update(fit, lambda = lambda.aic)
summary(fit.aic, pval = 0.05)

Relaxed islasso Fit

Description

Refits an islasso() model leaving unpenalized a subset of covariates, chosen by their p-values or given explicitly, while the other covariates are (practically) removed by a large penalty.

Usage

relax.islasso(fit, id = NULL, pval = 0.05, ...)

Arguments

fit

a fitted model of class "islasso".

id

optional names or indices (with respect to the covariates, intercept excluded) of the covariates to leave unpenalized; by default those with p-value not greater than pval.

pval

the significance level used when id is missing (default 0.05).

...

further arguments replacing those of the original call.

Details

The refit uses a value of lambda equal to 100 times the smallest value that shrinks all the penalized coefficients to zero, so that the unselected covariates have (practically) null estimates.

Value

An object of class "islasso".

See Also

islasso(), summary.islasso()

Examples

n <- 100; p <- 30
beta <- c(rep(1, 5), rep(0, p - 5))
sim1 <- simulXy(n = n, p = p, beta = beta, seed = 1, family = gaussian())
o <- islasso(y ~ ., data = sim1$data, lambda = 10)
summary(relax.islasso(o), pval = 0.05)
summary(relax.islasso(o, id = c("X1", "X2")), pval = 0.05)

Simulate a Model Matrix and a Response Vector

Description

Generates covariates (multivariate normal with AR(1) correlation) and a response from a Gaussian, binomial, Poisson or Gamma regression model, for simulation studies and examples.

Usage

simulXy(
  n,
  p,
  interc = 0,
  beta,
  family = gaussian(),
  prop = 0.1,
  lim.b = c(-3, 3),
  sigma = 1,
  size = 1,
  rho = 0,
  scale.data = TRUE,
  seed = NULL,
  X = NULL,
  dispersion = 0.1
)

Arguments

n

number of observations.

p

number of covariates.

interc

the intercept of the linear predictor (default 0).

beta

vector of p regression coefficients; if missing, a proportion prop of coefficients is drawn uniformly in lim.b and the others are zero.

family

a family object, function or name: gaussian, binomial, poisson or Gamma (with any of their links).

prop

proportion of non-null coefficients when beta is missing (default 0.1).

lim.b

range of the non-null coefficients when beta is missing.

sigma

standard deviation of the Gaussian response.

size

number of trials of the binomial response; with size > 1 the response is a two-column matrix of failures and successes.

rho

correlation parameter: cor(Xj,Xk)=ρ∣j−k∣cor(X_j, X_k) = \rho^{|j-k|}.

scale.data

logical: should the columns of the model matrix be standardised?

seed

optional seed; the state of the random number generator of the session is restored on exit.

X

optional model matrix replacing the generated one.

dispersion

dispersion parameter of the Gamma response (default 0.1).

Value

A list with components

data

a data frame with the response y (columns y.failure, y.success when size > 1) and the covariates X1, ..., Xp;

beta0

the intercept;

beta

the regression coefficients.

Author(s)

Gianluca Sottile [email protected]

See Also

islasso(), islasso.path()

Examples

n <- 100; p <- 100
beta <- c(runif(10, -3, 3), rep(0, p - 10))
sim <- simulXy(n = n, p = p, beta = beta, seed = 1234)
str(sim$data[, 1:5])

Summarize islasso Fitted Model

Description

Provides a concise summary of a fitted islasso model, including p-values and optional filtering.

Usage

## S3 method for class 'islasso'
summary(object, pval = 1, which, use.t = FALSE, type.pval = "wald", ...)

Arguments

object

A fitted model of class "islasso".

pval

Numeric threshold for displaying coefficients. Only those with p≤p \le pval are printed. Unpenalized coefficients (like intercepts) are always shown.

which

Optional. Specifies a subset of coefficients to test. If missing, all parameters are evaluated.

use.t

Logical. If TRUE, p-values are computed using the t-distribution and residual degrees of freedom.

type.pval

Character. Type of p-value approximation. Only "wald" (default) is implemented.

...

Additional arguments; digits is used by the print method.

Details

The column Df reports the pseudo hat values hjh_j, whose sum is the effective number of parameters (see islasso). The Wald statistics are the ratios of the estimates to their standard errors; with use.t = TRUE (Gaussian family only) the p-values use a t distribution with the residual degrees of freedom.

Value

An object of class "summary.islasso" containing:

coefficients

matrix with estimates, standard errors, pseudo hat values, Wald statistics and p-values;

dispersion, df, res, aic, lambda, nulldev, dev, df.null, df.res, family, iter

model summaries;

pval

threshold used to filter the printed coefficients;

unpenalized

logical vector of the unpenalized coefficients (always printed);

call

the original model call.

Author(s)

Gianluca Sottile [email protected]

See Also

islasso.fit, residuals.islasso, logLik.islasso, predict.islasso, deviance.islasso

Examples

sim <- simulXy(n = 100, p = 20, beta = c(1, -1, 0.5, rep(0, 17)), seed = 1)
o <- islasso(y ~ ., data = sim$data, lambda = 8)
summary(o, pval = 0.1)            # coefficients with p-value <= 0.1
summary(o, which = c("X1", "X4"))

Summarize islasso.path Model at Specific Lambda

Description

Extracts coefficient estimates, standard errors and p-values from an islasso.path fit at a given regularization level lambda.

Usage

## S3 method for class 'islasso.path'
summary(object, pval = 1, use.t = FALSE, lambda, ...)

Arguments

object

A fitted object of class "islasso.path".

pval

Numeric threshold for displaying coefficients. Only variables with p-value <= pval are printed. Unpenalized coefficients (like the intercept) are always shown.

use.t

Logical. If TRUE, p-values are computed using a t-distribution with residual degrees of freedom.

lambda

Numeric. Value of the regularization parameter at which the summary should be extracted.

...

Currently unused.

Details

Between two values of the path, estimates, standard errors and the other quantities are linearly interpolated on the log⁡λ\log\lambda scale.

Value

An object of class "summary.islasso.path" containing filtered estimates and significance metrics.

Author(s)

Gianluca Sottile [email protected]

See Also

islasso.path, GoF.islasso.path, coef.islasso.path, fitted.islasso.path, predict.islasso.path, residuals.islasso.path, logLik.islasso.path, deviance.islasso.path

Examples

sim <- simulXy(n = 100, p = 20, beta = c(1, -1, 0.5, rep(0, 17)), seed = 1)
o <- islasso.path(y ~ ., data = sim$data, nlambda = 20)
summary(o, pval = 0.1, lambda = 5)