MyNixOS website logo
Description

Slab and Shrinkage Linear Regression Estimation.

Implements a suite of shrinkage estimators for multivariate linear regression to improve estimation stability and predictive accuracy. Provides methods including the Stein estimator, Diagonal Shrinkage, the general Shrinkage estimator (solving a Sylvester equation), and Slab Regression (Simple and Generalized). These methods address Stein's paradox by introducing structured bias to reduce variance without requiring cross-validation, except for 'ShrinkageRR' where the intensity is chosen by minimizing an explicit Mean Squared Error (MSE) criterion. Methods are based on Asimit, V., Cidota, M. A., Chen, Z., and Asimit, J. (2025) <https://openaccess.city.ac.uk/id/eprint/35005/>.

savvySh: Shrinkage Methods for Linear Regression Estimation

The savvySh package provides a unified interface for fitting shrinkage estimators in linear regression, which is particularly useful in the presence of multicollinearity or high-dimensional covariates. It supports four shrinkage classes: Multiplicative Shrinkage, Slab Regression, Linear Shrinkage, and Shrinkage Ridge Regression. These methods improve on the classical Ordinary Least Squares (OLS) estimator by trading a small amount of bias for a significant reduction in variance.

This package implements the theoretical framework discussed in:

Asimit, V., Cidota, M. A., Chen, Z., & Asimit, J. (2025). Slab and Shrinkage Linear Regression Estimation.

Related Projects

  • savvyGLM: For applying these shrinkage methods within Generalized Linear Models (GLMs), please refer to the companion package savvyGLM.
  • flashfm-savvySh: For applications in genetic fine-mapping, see the flashfm-savvySh repository.

Installation Guide

You can install the released version of savvySh from CRAN with:

install.packages("savvySh")

Alternatively, you can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("Ziwei-ChenChen/savvySh")

Once installed, load the package:

library(savvySh)

Features

savvySh provides several shrinkage estimators designed to improve regression accuracy by reducing Mean Squared Error (MSE):

  • Multiplicative Shrinkage: Applies shrinkage by multiplying the OLS estimates with data-driven factors.

    • Stein (St): Applies a single global shrinkage factor to all coefficients.

    • Diagonal Shrinkage (DSh): Applies a separate factor to each coefficient.

    • Shrinkage (Sh): Uses a full matrix shrinkage operator estimated by solving a Sylvester equation.

  • Slab Regression: Adds structured shrinkage based on penalty terms.

    • Slab Regression (SR): Shrinks toward a fixed target direction (e.g., a vector of ones).

    • Generalized Slab Regression (GSR): Shrinks toward multiple directions (e.g., eigenvectors).

  • Linear Shrinkage (LSh): Takes a weighted average of the OLS estimator and a target estimator and is useful for standardized data.

  • Shrinkage Ridge Regression (SRR): Extends Ridge Regression (RR) by shrinking toward a diagonal matrix with equal entries.

All shrinkage factors are computed in closed form (except SRR, which optimizes shrinkage intensity numerically).

Usage

This is a basic example that shows you how to solve a common problem:

# Simulated example
set.seed(123)
x <- matrix(rnorm(100 * 10), 100, 10)
y <- rnorm(100)

# Fit shrinkage estimators
fit <- savvySh(x, y, model_class = "Multiplicative", include_Sh = TRUE)

# Extract coefficients
coef(fit, estimator = "St")
coef(fit, estimator = "DSh")
coef(fit, estimator = "Sh")

Authors

License

This package is licensed under the GPL (>= 3) License.

Metadata

Version

0.1.1

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows