MyNixOS website logo
Description

Savvy Parity Regression Model Estimation with 'savvyPR'.

Implements the Savvy Parity Regression 'savvyPR' methodology for multivariate linear regression analysis. The package solves an optimization problem that balances the contribution of each predictor variable to ensure estimation stability in the presence of multicollinearity. It supports two distinct parameterization methods, a Budget-based approach that allocates a fixed loss contribution to each predictor, and a Target-based approach (t-tuning) that utilizes a relative elasticity weight for the response variable. The package provides comprehensive tools for model estimation, risk distribution analysis, and parameter tuning via cross-validation (PR1, PR2, and PR3 model types) to optimize predictive accuracy. Methods are based on Asimit, Chen, Ichim and Millossovich (2026) <https://openaccess.city.ac.uk/id/eprint/37017/>.

savvyPR: Parity Regression Model for Linear Estimation

The savvyPR package implements Parity Regression (PR), a novel regularization framework designed to distribute prediction error equilibrium across model parameters. This methodology is particularly effective for high-dimensional data characterized by substantial noise and high multicollinearity, such as financial time series with structural changes or evolving trends.

This package is based on the theoretical foundations and algorithms discussed in:

Asimit, V., Chen, Z., Ichim, B., & Millossovich, P. (2026). Parity Regression Estimation.

The official documentation site is available at: https://ziwei-chenchen.github.io/savvyPR/

Installation Guide

You can install the development version of savvyPR from GitHub:

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

Once installed, load the package:

library(savvySR)

Core Methodology

Unlike standard shrinkage methods like Ridge or Lasso, Parity Regression ensures that no single predictor dominates the model's risk profile. It optimizes objective functions using two distinct parameterizations:

1. Budget-based ($c$-tuning)

The $c$-parameterization explicitly allocates a fixed loss contribution to each predictor. The objective function is defined as:

$$\frac{1}{2} RRSS(x, x_{p+1}; \lambda) - \tilde{\mu} \left( c \sum_{k=0}^{p} \log(\delta_k x_k) + (1 - (p + 1)c) \log(x_{p+1}) \right)$$

To ensure positive risk allocation, $c$ is constrained by $0 \le c < 1/(p+1)$.

2. Target-based ($t$-tuning)

The $t$-parameterization treats $t$ as the relative elasticity weight for the target variable (response):

$$\frac{1}{2} RRSS(x, x_{p+1}; \lambda) - \tilde{\mu} \left( \sum_{k=0}^{p} \log(\delta_k x_k) + t \log(x_{p+1}) \right)$$

Features

  • Three Model Types:

    • PR1: Pure parity optimization (fixing $\lambda=0$).

    • PR2: Parity optimization using a fixed $\lambda$ derived from Ridge regression via cv.glmnet.

    • PR3: Dual-stage optimization that tunes both the parity parameter and $\lambda$.

  • Built-in Cross-Validation: Automated selection of optimal $c$, $t$, or $\lambda$ using cv.savvyPR.

  • Rich Visualizations: Support for plotting estimated coefficients, risk contributions, coefficient paths, and CV error curves.

Basic Usage

# Generate highly correlated data
set.seed(123)
n <- 100; p <- 10
base <- rnorm(n)
x <- matrix(rnorm(n * p, sd = 0.1), n, p) + base
y <- as.numeric(x %*% rep(1, p) + rnorm(n, sd = 0.5))

# Fit a cross-validated PR3 model (Budget method)
cv_fit <- cv.savvyPR(x, y, method = "budget", model_type = "PR3")
coef(cv_fit)

# Plot the results
plot(cv_fit, plot_type = "estimated_coefficients")
plot(cv_fit, plot_type = "risk_contributions")

Authors

License

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

Metadata

Version

0.1.1

License

Unknown

Platforms (80)

    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
  • arc-linux
  • 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
  • sh4-linux
  • 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