Getting Started with risdr

Purpose

Sufficient dimension reduction seeks a low-dimensional projection \mathbf{B}^{\mathsf{T}}\mathbf{X} that retains the information in the predictors \mathbf{X} about a response Y. The working condition is

\[ Y \perp\!\!\!\perp \mathbf{X}\mid \mathbf{B}^{\mathsf{T}}\mathbf{X}. \]

risdr combines classical inverse-regression estimators with covariance regularisation, structural dimension criteria, prediction, and resampling. The implemented SDR methods are SIR (Li 1991), SAVE (Cook 1998), DR (Li and Wang 2007), and pHd (Li 1992).

A reproducible example

library(risdr)

sim <- simulate_risdr_data(
  n = 160,
  p = 20,
  d = 2,
  rho = 0.6,
  sigma = 0.7,
  model = "linear_quadratic",
  seed = 2026
)

The simulation object contains the predictor matrix, response, true central subspace basis, sufficient predictors, population covariance matrix, signal, noise, and generation settings.

str(sim[c("X", "y", "beta", "Sigma", "n", "p", "d")], max.level = 1)
#> List of 7
#>  $ X    : num [1:160, 1:20] 0.753 -0.579 0.403 -0.536 -0.613 ...
#>   ..- attr(*, "dimnames")=List of 2
#>  $ y    : num [1:160] 0.368 1.806 0.178 2.258 0.13 ...
#>  $ beta : num [1:20, 1:2] -1 0 0 0 0 0 0 0 0 0 ...
#>   ..- attr(*, "dimnames")=List of 2
#>  $ Sigma: num [1:20, 1:20] 1 0.6 0.36 0.216 0.13 ...
#>  $ n    : int 160
#>  $ p    : int 20
#>  $ d    : int 2

Fit an SDR model

fit <- fit_risdr(
  X = sim$X,
  y = sim$y,
  sdr_method = "dr",
  cov_method = "oas",
  nslices = 6,
  d_max = 6,
  selector = "cicomp",
  standardize = TRUE,
  stabilize = TRUE
)

fit
#> Regularised and Information-Theoretic SDR fit
#> --------------------------------------------------
#> SDR method       : DR 
#> Covariance       : OAS 
#> Stabilised       : TRUE 
#> Stabilisation    : eigenfloor 
#> Selected d       : 1 
#> Selector         : CICOMP 
#> Number of slices : 6 
#> Observations     : 160 
#> Predictors       : 20
summary(fit)
#> Summary of risdr fit
#> --------------------------------------------------
#> Method              : DR 
#> Covariance          : OAS 
#> Selected dimension  : 1 
#> Selector            : CICOMP 
#> 
#> Leading eigenvalues:
#>  [1] 3.453574 2.124236 1.985078 1.845607 1.794055 1.647861 1.617459 1.423187
#>  [9] 1.385982 1.339129
#> 
#> Dimension selection table:
#>   d      AIC      BIC     CAIC    ICOMP   CICOMP
#> 1 1 665.4152 674.6408 677.6408 659.4153 677.6409
#> 2 2 662.3393 674.6400 678.6400 654.3489 678.6496
#> 3 3 662.4504 677.8263 682.8263 652.4626 682.8385
#> 4 4 657.7823 676.2333 682.2333 645.7997 682.2508
#> 5 5 659.6837 681.2099 688.2099 645.7047 688.2310
#> 6 6 658.4830 683.0844 691.0844 642.5104 691.1118
#> 
#> Covariance diagnostics:
#> $min_eigenvalue
#> [1] 0.2577072
#> 
#> $max_eigenvalue
#> [1] 3.867814
#> 
#> $condition_number
#> [1] 15.00856
#> 
#> $effective_rank
#> [1] 20

The fitted object stores the training transformations, covariance estimate, kernel, eigenvalues, directions, scores, dimension-selection table, and downstream linear model.

Inspect the structural dimension

fit$d_table
#>   d      AIC      BIC     CAIC    ICOMP   CICOMP
#> 1 1 665.4152 674.6408 677.6408 659.4153 677.6409
#> 2 2 662.3393 674.6400 678.6400 654.3489 678.6496
#> 3 3 662.4504 677.8263 682.8263 652.4626 682.8385
#> 4 4 657.7823 676.2333 682.2333 645.7997 682.2508
#> 5 5 659.6837 681.2099 688.2099 645.7047 688.2310
#> 6 6 658.4830 683.0844 691.0844 642.5104 691.1118
criterion_weights(fit$d_table, criterion = "CICOMP")
#>   d criterion    value     delta       weight
#> 1 1    CICOMP 677.6409  0.000000 0.5604712157
#> 2 2    CICOMP 678.6496  1.008742 0.3384604077
#> 3 3    CICOMP 682.8385  5.197657 0.0416769998
#> 4 4    CICOMP 682.2508  4.609926 0.0559140063
#> 5 5    CICOMP 688.2310 10.590103 0.0028115237
#> 6 6    CICOMP 691.1118 13.470947 0.0006658468

Information criteria answer a model-selection question, while predictive cross-validation estimates out-of-fold error. Both should be considered when the selected dimension is consequential.

cv <- select_dimension_cv(
  X = sim$X,
  y = sim$y,
  sdr_method = "dr",
  cov_method = "oas",
  d_max = 5,
  v = 5,
  nslices = 6,
  metric = "RMSE",
  seed = 2026
)

cv$selected_d
#> [1] 1
cv$cv_table
#>   d     RMSE      MAE     MAPE          R2 Adjusted_R2 Correlation   RMSE_SD
#> 1 1 1.947696 1.361935 538.6245 -0.06341251  -0.0988596   0.3467036 0.4934735
#> 2 2 1.971852 1.363911 538.6585 -0.08109930  -0.1556579   0.2707241 0.5236187
#> 3 3 1.973159 1.394337 402.8622 -0.07404453  -0.1891207   0.2620802 0.5451999
#> 4 4 2.021144 1.413815 393.7101 -0.13007220  -0.2974903   0.2159555 0.5213593
#> 5 5 2.014107 1.402969 368.3190 -0.11275700  -0.3267487   0.2194342 0.5508809
#>      MAE_SD  MAPE_SD     R2_SD Adjusted_R2_SD Correlation_SD
#> 1 0.1783922 625.3954 0.2305538      0.2382390      0.2493878
#> 2 0.1784740 627.4625 0.2155648      0.2304314      0.1587921
#> 3 0.2252148 323.4023 0.1890185      0.2092705      0.1857056
#> 4 0.2100023 317.1924 0.1700001      0.1951853      0.1340351
#> 5 0.2318706 249.1694 0.1495779      0.1783429      0.1599928

Prediction

Prediction applies the training centre, scale, SDR centre, and estimated directions to new observations before invoking the downstream model.

predicted <- predict(fit, sim$X[1:12, , drop = FALSE])
evaluate_prediction(
  y_true = sim$y[1:12],
  y_pred = predicted,
  d = fit$d
)
#>      RMSE      MAE     MAPE        R2 Adjusted_R2 Correlation
#> 1 2.34521 1.377633 181.5434 0.2288204   0.1517025   0.6720394

Named columns may be supplied in a different order. They are checked and reordered to the training layout. A single new observation is also valid.

Component-specific controls

Arguments for covariance estimation, covariance stabilisation, and SDR kernels are supplied separately. This prevents a control intended for one component from being passed to another component.

fit_ridge <- fit_risdr(
  X = sim$X,
  y = sim$y,
  sdr_method = "sir",
  cov_method = "ridge",
  d = 2,
  d_max = 5,
  cov_args = list(lambda = 0.15),
  stabilization_args = list(eps = 1e-7),
  sdr_args = list(slice_type = "quantile")
)

Diagnostics

plot_scree(fit, n_eigen = 10)
plot_sufficient(fit, direction = 1)
plot_dimension_selection(fit)

Loadings and sufficient summary plots are descriptive. Signs of eigenvectors are not identified, so sign reversals across numerically equivalent fits do not change the estimated subspace.

Current scope

The verified modelling interface is for continuous responses. The standalone MEC covariance helper accepts additional working response forms, but binary, multiclass, and censored survival modelling are not yet claimed as complete risdr workflows.

References

Cook, R. Dennis. 1998. Regression Graphics: Ideas for Studying Regressions Through Graphics. Wiley. https://doi.org/10.1002/9780470316931.
Li, Bing, and Shaoli Wang. 2007. “On Directional Regression for Dimension Reduction.” Journal of the American Statistical Association 102 (479): 997–1008. https://doi.org/10.1198/016214507000000536.
Li, Ker-Chau. 1991. “Sliced Inverse Regression for Dimension Reduction.” Journal of the American Statistical Association 86 (414): 316–27. https://doi.org/10.1080/01621459.1991.10475035.
Li, Ker-Chau. 1992. “On Principal Hessian Directions for Data Visualization and Dimension Reduction: Another Application of Stein’s Lemma.” Journal of the American Statistical Association 87 (420): 1025–39. https://doi.org/10.1080/01621459.1992.10476258.