Package {stabplot}


Type: Package
Title: Stability Plots for Lasso Stability Selection
Version: 0.0.1
Description: Provides stability selection with Lasso and two diagnostic plots for assessing selection stability. The Regustab plot shows stability across the regularisation parameter grid, while the Convstab plot shows stability as a function of the number of subsamples. Methods are described in Nouraie and Muller (2026) <doi:10.1080/03610926.2026.2715517>.
License: MIT + file LICENSE
Imports: glmnet, latex2exp, ggplot2
Encoding: UTF-8
URL: https://github.com/MahdiNouraie/stabplot, https://www.tandfonline.com/doi/full/10.1080/03610926.2026.2715517
BugReports: https://github.com/MahdiNouraie/stabplot/issues
RoxygenNote: 7.3.3
NeedsCompilation: no
Packaged: 2026-09-17 05:53:03 UTC; 48099783
Author: Mahdi Nouraie [aut, cre], Samuel Muller [aut]
Maintainer: Mahdi Nouraie <mahdinouraie20@gmail.com>
Repository: CRAN
Date/Publication: 2026-09-28 07:50:02 UTC

Stability Plots for Lasso Stability Selection

Description

Provides two diagnostic plots for assessing stability selection with Lasso. The 'Regustab' function plots stability values across the regularisation parameter grid, supporting regularisation tuning based on selection stability. It highlights and returns 'lambda.min', 'lambda.1se', and 'lambda.stable' when the maximum stability exceeds 0.75. Otherwise, it returns 'lambda.stable.1sd', defined using a one-standard-deviation criterion. The 'Convstab' function plots stability values against the number of subsamples to assess the convergence of the stability estimates and returns variables with selection frequencies exceeding a specified threshold, which defaults to 0.5.

Author(s)

Maintainer: Mahdi Nouraie mahdinouraie20@gmail.com

Authors:

References

Nouraie, M., & Muller, S. (2026). Stability-guided hyper-parameter tuning for stability selection. Communications in Statistics - Theory and Methods, 1–19.

Meinshausen, N., & Bühlmann, P. (2010). Stability selection. Journal of the Royal Statistical Society Series B: Statistical Methodology, 72(4), 417-473.

Nogueira, S., Sechidis, K., & Brown, G. (2018). On the stability of feature selection algorithms. Journal of Machine Learning Research, 18(174), 1-54.

https://github.com/nogueirs/JMLR2018

Tibshirani, R. (1996). Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society Series B: Statistical Methodology, 58(1), 267-288.

See Also

Regustab, Convstab


Convstab

Description

Creates a diagnostic plot of stability estimates and their confidence intervals across sequential subsamples in stability selection. The plot is constructed using 'lambda.stable' when the maximum stability exceeds 0.75; otherwise, 'lambda.stable.1sd' is used.

Usage

Convstab(x, y, B, alpha = 0.05, thr = 0.5)

Arguments

x

A numeric matrix of predictors.

y

A numeric vector of response values.

B

An integer specifying the number of subsamples.

alpha

A numeric value specifying the significance level for the confidence intervals.

thr

A numeric value specifying the minimum selection frequency for reporting selected variables.

Value

A list containing the stability plot ('plot') and a data frame of variables with selection frequencies exceeding 'thr' ('selected'), returned invisibly. The plot is also displayed as a side effect.

References

Nouraie, M., & Muller, S. (2026). Stability-guided hyper-parameter tuning for stability selection. Communications in Statistics - Theory and Methods, 1–19.

Meinshausen, N., & Bühlmann, P. (2010). Stability selection. Journal of the Royal Statistical Society Series B: Statistical Methodology, 72(4), 417-473.

Nogueira, S., Sechidis, K., & Brown, G. (2018). On the stability of feature selection algorithms. Journal of Machine Learning Research, 18(174), 1-54.

https://github.com/nogueirs/JMLR2018

Tibshirani, R. (1996). Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society Series B: Statistical Methodology, 58(1), 267-288.

See Also

stabplot

Examples


set.seed(123)
x <- matrix(rnorm(1000), ncol = 10)
# create beta based on the first 3 columns of x and some error
beta <- c(0.5, 0.4, 0.3, rep(0, 7))
y <- x %*% beta + rnorm(100)
B <- 200
res <- Convstab(x, y, B)  # Example usage of the Convstab function
res$selected
# output
# Variable Selection_Frequency
# 1       x1               0.970
# 2       x2               0.895



Regustab

Description

Creates a diagnostic plot of stability values across the regularisation parameter grid for Lasso stability selection. The plot highlights 'lambda.min' and 'lambda.1se' from cross-validation, as well as 'lambda.stable' when the maximum stability exceeds 0.75. Otherwise, 'lambda.stable.1sd', defined using a one-standard-deviation criterion, is highlighted.

Usage

Regustab(x, y, B)

Arguments

x

A numeric matrix of predictors.

y

A numeric vector of response values.

B

An integer specifying the number of subsamples.

Value

A list containing the selected regularisation values ('min', '1se', and either 'stable' or 'stable.1sd'), returned invisibly. A stability plot is also produced as a side effect.

References

Nouraie, M., & Muller, S. (2026). Stability-guided hyper-parameter tuning for stability selection. Communications in Statistics - Theory and Methods, 1–19.

Meinshausen, N., & Bühlmann, P. (2010). Stability selection. Journal of the Royal Statistical Society Series B: Statistical Methodology, 72(4), 417-473.

Nogueira, S., Sechidis, K., & Brown, G. (2018). On the stability of feature selection algorithms. Journal of Machine Learning Research, 18(174), 1-54.

https://github.com/nogueirs/JMLR2018

Tibshirani, R. (1996). Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society Series B: Statistical Methodology, 58(1), 267-288.

See Also

stabplot

Examples


set.seed(123)
x <- matrix(rnorm(1000), ncol = 10)
# create beta based on the first 3 columns of x and some error
beta <- c(1, 2, 3, rep(0, 7))
y <- x %*% beta + rnorm(100)
B <- 10
res <- Regustab(x, y, B)  # Example usage of the Regustab function
res
# output
# $min
# [1] 0.07609021
# $`1se`
# [1] 0.2550241
# $stable
#[1] 0.3371269