robust_pls — Robust PLS (Partial Robust M-regression)

Group: Robust / weighted · Registry tolerance: 1e-08

Description

Robust PLS (Partial Robust M-regression, Serneels 2005)

Registry note — R chemometrics::prm (Serneels et al. 2005) — Partial Robust M-regression. pls4all defaults to PRM matching the R algorithm bit-for-bit (median centering, Fair weights on leverage + residual, univariate SIMPLS inner kernel, intercept = median(y - X@b)). The legacy Huber-IRLS over weighted SIMPLS path is reachable via cfg.robust_pls_legacy = 1.

Parameters

Name

Type

Default

Notes

X

—

required

current public binding signature

y

—

required

current public binding signature

huber_k

float

1.345

current public binding signature

max_irls_iter

int

5

current public binding signature

n_components

int

2

current public binding signature

center_x

bool | None

None

current public binding signature

scale_x

bool | None

None

current public binding signature

center_y

bool | None

None

current public binding signature

scale_y

bool | None

None

current public binding signature

Explanations

Bibliographic source

Serneels, S., Croux, C., Filzmoser, P. & Van Espen, P. J. (2005). Partial robust M-regression. Chemometrics and Intelligent Laboratory Systems 79(1–2), 55–64. DOI 10.1016/j.chemolab.2005.04.007.

Mathematical principle

The default robust path follows a partial robust M-regression style iteration: residual and leverage information update Fair robustness weights before weighted latent fits. Fair weights decay smoothly rather than clipping residual influence at the Huber threshold.

Appropriate uses

Calibration containing moderate response or leverage contamination where robust residual weighting is justified.

Limits and validation

The default PRM-style path uses Fair weights and reinterprets huber_k as its tuning constant; Huber IRLS is available only in legacy mode.

Implementation

In the default path the public huber_k value is interpreted as the Fair tuning constant for parity with the referenced implementation. The separately gated legacy branch performs the Huber IRLS algorithm described by older documentation.

Sources and provenance

Current implementation: cpp/src/core/extra_pls.cpp.

API and bindings

C ABI (ABI 2): n4m_estimators_robust_pls_fit. Use the linked public header for the exact signature, configuration, and result handles.

Python (verified public re-export):

from n4m.estimators.regression.robust import robust_pls
result = robust_pls(X, y)

Source signature: robust_pls(X, y, *, huber_k: float = 1.345, max_irls_iter: int = 5, n_components: int = 2, center_x: bool | None = None, scale_x: bool | None = None, center_y: bool | None = None, scale_y: bool | None = None) (n4m/_impl/native.py).

R (source-verified): robust_pls(formula, data, ncomp = 2L, huber_k = 1.345, max_irls_iter = 20L, na.action = stats::na.omit).

The source signature has additional required inputs, so no example call is fabricated.

MATLAB / Octave (source-verified): robust_pls(X, Y, n_components, huber_k, max_irls_iter).

The source signature has additional required inputs, so no example call is fabricated.

Registry parity references 📐

  • 📐 ref.r_chemometrics (R · r) — chemometrics 0.7.x · strict (rmse_rel ≤ 1e-08) — R chemometrics::prm (Partial Robust M-regression). pls4all uses Huber IRLS over weighted SIMPLS; this is an M-estimator variant from the same family. Predictions diverge by O(0.5).

Benchmarks

Archived measurement identity. Backend labels in this table are the raw IDs recorded when the benchmark ran (including historical pls4all.* IDs). They preserve measurement provenance and do not describe a current public Python, R, or MATLAB binding; use the source-verified API and bindings section above for current entry points.

Adaptive wall-clock per cell measured against full_matrix.csv. Only backends that implement this method are listed; libraries without the method are omitted.

Verdict  ·  ✓ ref / ≈ ref / ~ shape mark a reference-gate pass at strict / relaxed / qualitative tolerance  ·  ✓ bind = archived binding-harness result agrees with the C++ baseline  ·  ⇄ cross-check = documented by-design selector/RNG/model, noncanonical API/facade convention, or secondary oracle  ·  ✗ divergent  ·  ⚠ error  ·  — not run. The fastest backend per column is marked 🏆.

Reference gate: strict — numeric equivalence (rmse_rel_tol ≤ 1e-08).

Rows tagged with 📐 are the canonical parity references for this method (declared in parity_timing.registry). C++ and external rows show reference parity; archived language-harness rows show binding parity against the C++ backend. Hover the icon for role and tolerance band.

BackendParity200×50 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ ref 1e-142.07 ms
Python · archived pls4all benchmark
pls4all.python✓ bind1.95 ms🏆
pls4all.sklearn✓ bind2.15 ms
R · archived pls4all benchmark
pls4all.R✓ bind4.38 ms
pls4all.R.formula✓ bind5.55 ms
pls4all.R.mdatools✓ bind5.77 ms
pls4all.R.pls✓ bind6.62 ms
R · external
📐ref.r_chemometricssource17.9 ms
BackendParity200×50 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ ref 1e-142.02 ms
Python · archived pls4all benchmark
pls4all.python✓ bind2.00 ms🏆
pls4all.sklearn✓ bind2.10 ms
R · archived pls4all benchmark
pls4all.R✓ bind5.43 ms
pls4all.R.formula✓ bind6.63 ms
pls4all.R.mdatools✓ bind5.84 ms
pls4all.R.pls✓ bind5.99 ms
R · external
📐ref.r_chemometricssource17.0 ms
BackendParity200×50 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ ref 1e-142.05 ms
Python · archived pls4all benchmark
pls4all.python✓ bind1.98 ms🏆
pls4all.sklearn✓ bind2.25 ms
R · archived pls4all benchmark
pls4all.R✓ bind4.94 ms
pls4all.R.formula✓ bind7.07 ms
pls4all.R.mdatools✓ bind5.59 ms
pls4all.R.pls✓ bind5.68 ms
R · external
📐ref.r_chemometricssource17.5 ms

See also: benchmark overview · methods index · interactive dashboard