Package: robStepSplitReg 1.1.0

Anthony Christidis

robStepSplitReg: Robust Stepwise Split Regularized Regression

Functions to perform robust stepwise split regularized regression. The approach first uses a robust stepwise algorithm to split the variables into the models of an ensemble. An adaptive robust regularized estimator is then applied to each subset of predictors in the models of an ensemble.

Authors:Anthony Christidis [aut, cre], Gabriela Cohen-Freue [aut]

robStepSplitReg_1.1.0.tar.gz
robStepSplitReg_1.1.0.tar.gz(r-4.5-noble)robStepSplitReg_1.1.0.tar.gz(r-4.4-noble)
robStepSplitReg_1.1.0.tgz(r-4.4-emscripten)robStepSplitReg_1.1.0.tgz(r-4.3-emscripten)
robStepSplitReg.pdf |robStepSplitReg.html
robStepSplitReg/json (API)
NEWS

# Install 'robStepSplitReg' in R:
install.packages('robStepSplitReg', repos = 'https://cloud.r-project.org')
Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

openblascpp

2.18 score 1 packages 215 downloads 1 exports 50 dependencies

Last updated 2 years agofrom:4fcf144edd. Checks:3 OK. Indexed: no.

TargetResultLatest binary
Doc / VignettesOKApr 01 2025
R-4.5-linux-x86_64OKApr 01 2025
R-4.4-linux-x86_64OKApr 01 2025

Exports:robStepSplitReg

Dependencies:cellWiseclicodetoolscolorspaceDEoptimRfansifarverforeachggplot2glmnetgluegridExtragtableisobanditeratorslabelinglatticelifecyclemagrittrMASSMatrixmatrixStatsmgcvmunsellmvtnormnlmepcaPPpillarpkgconfigplyrR6RColorBrewerRcppRcppArmadilloRcppEigenreshape2rlangrobustbaserrcovscalesshapestringistringrsurvivalsvdtibbleutf8vctrsviridisLitewithr

Citation

To cite package ‘robStepSplitReg’ in publications use:

Christidis A, Cohen-Freue G (2023). robStepSplitReg: Robust Stepwise Split Regularized Regression. R package version 1.1.0, https://CRAN.R-project.org/package=robStepSplitReg.

Corresponding BibTeX entry:

  @Manual{,
    title = {robStepSplitReg: Robust Stepwise Split Regularized
      Regression},
    author = {Anthony Christidis and Gabriela Cohen-Freue},
    year = {2023},
    note = {R package version 1.1.0},
    url = {https://CRAN.R-project.org/package=robStepSplitReg},
  }

Readme and manuals

robStepSplitReg

This package provides functions for performing robust stepwise split regularized regression.


Installation

You can install the stable version on R CRAN.

install.packages("robStepSplitReg", dependencies = TRUE)

You can install the development version from GitHub

library(devtools)
devtools::install_github("AnthonyChristidis/robStepSplitReg")
Usage
# Required library
library(mvnfast)

# Simulation parameters
n <- 50
p <- 500
rho <- 0.8
p.active <- 100
snr <- 3
contamination.prop <- 0.2

# Setting the seed
set.seed(0)

# Simulation of beta vector
true.beta <- c(runif(p.active, 0, 5)*(-1)^rbinom(p.active, 1, 0.7), rep(0, p - p.active))

# Simulation of uncontaminated data 
sigma.mat <- matrix(0, nrow = p, ncol = p)
sigma.mat[1:p.active, 1:p.active] <- rho
diag(sigma.mat) <- 1
x <- mvnfast::rmvn(n, mu = rep(0, p), sigma = sigma.mat)
sigma <- as.numeric(sqrt(t(true.beta) %*% sigma.mat %*% true.beta)/sqrt(snr))
y <- x %*% true.beta + rnorm(n, 0, sigma)

# Contamination of data 
contamination_indices <- 1:floor(n*contamination.prop)
k_lev <- 2
k_slo <- 100
x_train <- x
y_train <- y
beta_cont <- true.beta
beta_cont[true.beta!=0] <- beta_cont[true.beta!=0]*(1 + k_slo)
beta_cont[true.beta==0] <- k_slo*max(abs(true.beta))
for(cont_id in contamination_indices){
  
  a <- runif(p, min = -1, max = 1)
  a <- a - as.numeric((1/p)*t(a) %*% rep(1, p))
  x_train[cont_id,] <- mvnfast::rmvn(1, rep(0, p), 0.1^2*diag(p)) + 
    k_lev * a / as.numeric(sqrt(t(a) %*% solve(sigma.mat) %*% a))
  y_train[cont_id] <- t(x_train[cont_id,]) %*% beta_cont
}

# Ensemble models
ensemble_fit <- robStepSplitReg(x_train, y_train,
                                n_models = 5,
                                model_saturation = c("fixed", "p-value")[1],
                                alpha = 0.05, model_size = 25,
                                robust = TRUE,
                                compute_coef = TRUE,
                                pense_alpha = 1/4, pense_cv_k = 5, pense_cv_repl = 1,
                                cl = NULL)

# Ensemble coefficients
ensemble_coefs <- coef(ensemble_fit, group_index = 1:ensemble_fit$n_models)
sens_ensemble <- sum(which((ensemble_coefs[-1]!=0)) <= p.active)/p.active
spec_ensemble <- sum(which((ensemble_coefs[-1]!=0)) <= p.active)/sum(ensemble_coefs[-1]!=0)

# Simulation of test data
m <- 2e3
x_test <- mvnfast::rmvn(m, mu = rep(0, p), sigma = sigma.mat)
y_test <- x_test %*% true.beta + rnorm(m, 0, sigma)

# Prediction of test samples
ensemble_preds <- predict(ensemble_fit, newx = x_test, 
                          group_index = 1:ensemble_fit$n_models,
                          dynamic = FALSE)
mspe_ensemble <- mean((y_test - ensemble_preds)^2)/sigma^2
License

This package is free and open source software, licensed under GPL (>= 2).