| Title: | Online Sliced Inverse Regression for Elliptical Model with Streaming Data |
|---|---|
| Description: | For high-dimensional streaming heavy-tailed elliptical data, traditional sliced inverse regression methods require full offline data and cannot adapt to incremental data arrival. This package implements Online Sliced Inverse Regression for Elliptical Model with Streaming Data (OSIR) algorithm with two recursive updating strategies, including offline batch SIR as benchmark, elliptical heavy-tailed data simulator, subspace evaluation metric and batch simulation tools for numerical experiments. Cai, Z., Li, R., & Zhu, L. (2020) <doi:10.48550/arXiv.2002.02795>. |
| Authors: | Sirui Yan [aut], Guangbao Guo [aut, cre] |
| Maintainer: | Guangbao Guo <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.3.2 |
| Built: | 2026-11-14 14:06:52 UTC |
| Source: | https://github.com/cran/osir |
Generate Elliptical Streaming Data Generate elliptical normal / student-t heavy-tailed covariate stream
generate_elliptical(n, p, nu = 3, sigma = 0.3, heavy = TRUE)generate_elliptical(n, p, nu = 3, sigma = 0.3, heavy = TRUE)
n |
total sample size |
p |
covariate dimension |
nu |
t-distribution freedom |
sigma |
scale coefficient |
heavy |
TRUE = elliptical-t, FALSE = elliptical normal |
A list with components:
An by numeric matrix of generated elliptically distributed covariates.
A numeric response vector of length .
A by 2 orthonormal matrix; its first column spans the true central direction.
A by positive definite covariance matrix used to scale X.
set.seed(1) dat <- generate_elliptical(n = 100, p = 6) dim(dat$X) length(dat$Y)set.seed(1) dat <- generate_elliptical(n = 100, p = 6) dim(dat$X) length(dat$Y)
Offline Batch SIR (Baseline Comparison Algorithm) Classical full-data sliced inverse regression
offline_sir(X, Y, H = 5, K = 2)offline_sir(X, Y, H = 5, K = 2)
X |
n*p covariate matrix |
Y |
response vector |
H |
slice number |
K |
target central subspace dimension |
A by K numeric matrix whose columns are the estimated SIR directions, i.e. the leading K eigenvectors of the sliced covariance matrix.
set.seed(1) dat <- generate_elliptical(n = 100, p = 6) offline_sir(dat$X, dat$Y)set.seed(1) dat <- generate_elliptical(n = 100, p = 6) offline_sir(dat$X, dat$Y)
Online SIR (Two Online Solvers) Streaming recursive OSIR, gradient / perturbation two update methods
osir(X, Y, H = 5, K = 2, method = c("grad", "pert"), C = 1)osir(X, Y, H = 5, K = 2, method = c("grad", "pert"), C = 1)
X |
full streaming matrix |
Y |
response vector |
H |
slice count |
K |
target subspace dimension |
method |
"grad" gradient descent / "pert" perturbation update |
C |
gradient step constant |
A list with component B_hat: a by K numeric matrix of the recursively updated estimated directions after scanning the whole stream X.
set.seed(1) dat <- generate_elliptical(n = 80, p = 5) osir(dat$X, dat$Y, method = "grad")$B_hatset.seed(1) dat <- generate_elliptical(n = 80, p = 5) osir(dat$X, dat$Y, method = "grad")$B_hat
Batch Ablation Simulation Tool Generate experiment table for paper drawing
sim_ablation( heavy = TRUE, n_vec = c(2000, 4000, 6000), p_vec = c(8, 10, 12), rep = 5 )sim_ablation( heavy = TRUE, n_vec = c(2000, 4000, 6000), p_vec = c(8, 10, 12), rep = 5 )
heavy |
TRUE = heavy-tailed elliptical-t |
n_vec |
sample size grid |
p_vec |
dimension grid |
rep |
repeat experiment times |
A data.frame with one row per (n,p) setting and columns n, p, OSIR_MSE and Offline_MSE, giving the averaged subspace projection MSE over rep replications for the online and offline solvers.
Calculate estimation error between true & estimated subspace
subspace_mse(est, true)subspace_mse(est, true)
est |
estimated subspace matrix |
true |
real true subspace basis |
A non-negative numeric scalar giving the mean squared error between the projection matrices of the estimated and true subspaces.
set.seed(123) # Generate demo subspace true_sub <- matrix(rnorm(10*2), 10, 2) est_sub <- true_sub + matrix(rnorm(10*2, sd = 0.01), 10, 2) subspace_mse(est = est_sub, true = true_sub)set.seed(123) # Generate demo subspace true_sub <- matrix(rnorm(10*2), 10, 2) est_sub <- true_sub + matrix(rnorm(10*2, sd = 0.01), 10, 2) subspace_mse(est = est_sub, true = true_sub)