pls_diagnostic_t2 — Hotelling T² score¶
Group: Diagnostic · Registry tolerance: 1e-08
Description¶
PLS Hotelling T² (§9)
Registry note — R
mdatools::plsis the only widely installable external reference. Both use SIMPLS-style but differ on score normalization conventions — tolerance is wide enough to flag the R ref’s presence.
Parameters¶
Name |
Type |
Default |
Notes |
|---|---|---|---|
|
|
|
registry benchmark cell value |
Explanations¶
Bibliographic source¶
Hotelling, H. (1931). The generalization of Student’s ratio. Annals of Mathematical Statistics 2(3), 360–378. DOI 10.1214/aoms/1177732979.
Mathematical principle¶
Hotelling T² measures how unusual a sample is within the latent score space: \(T_i^2 = \mathbf{t}_i^{\top} \boldsymbol{\Lambda}^{-1} \mathbf{t}_i\) where \(\boldsymbol{\Lambda}\) is the diagonal matrix of score variances. Under multivariate normality of the scores, \(\frac{n(n-k)}{k(n^2-1)} T^2 \sim F_{k, n-k}\), giving an exact upper control limit at any \(\alpha\).
T² complements the Q residual (next entry): Q measures the distance to the model (variation in \(\mathbf{X}\) that the latent space does not explain), while T² measures the distance within the model (unusual score combination on otherwise well-explained samples). Joint T²/Q monitoring catches both kinds of out-of-control points.
Reported per-sample as a 1-D vector aligned with the rows of the input.
Appropriate uses¶
Flagging observations with unusual leverage in the fitted PLS score space.
Limits and validation¶
T-squared detects score-space leverage rather than large residuals; thresholds require an appropriate reference population.
Implementation¶
n4m_metrics_pls_diagnostics_compute with stat=’t2’. Reference: R mdatools 0.15.0 (Kucheryavskiy).
Sources and provenance¶
Current implementation: cpp/src/core/pls_diagnostics.cpp.
API and bindings¶
C ABI (ABI 2): n4m_metrics_pls_diagnostics_compute. Use the linked public header for the exact signature, configuration, and result handles.
Python: no current AST-verified public n4m re-export was found for this method. The linked C ABI above is the documented surface in this checkout.
R: no current source-verified entry point was found for this catalog method.
MATLAB / Octave: no current source-verified entry point was found for this catalog method.
Registry parity references 📐
📐
ref.r_mdatools(R · r) —mdatools0.15.0 · strict (rmse_rel ≤ 1e-08) — Rmdatools::plswithpredict()$xdecomp$T2 / $Q. DModX is derived locally from $Q + DOF. mdatools uses different SIMPLS deflation / normalization conventions than pls4all, so cross-implementation parity is qualitative.
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.
| Backend | Parity | 200×30 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ ref 3e-15 | 1.19 ms🏆 |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 1.22 ms |
pls4all.sklearn | ✓ bind | 1.31 ms |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ 1e-13 | 2.67 ms |
pls4all.R.formula | ✓ 1e-13 | 3.38 ms |
pls4all.R.mdatools | ✓ 1e-13 | 3.70 ms |
pls4all.R.pls | ✓ 1e-13 | 4.11 ms |
| R · external | ||
📐ref.r_mdatools | source | 14.2 ms |
| Backend | Parity | 200×30 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ ref 3e-15 | 1.19 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 1.19 ms🏆 |
pls4all.sklearn | ✓ bind | 1.37 ms |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ 1e-13 | 2.74 ms |
pls4all.R.formula | ✓ 1e-13 | 3.29 ms |
pls4all.R.mdatools | ✓ 1e-13 | 3.43 ms |
pls4all.R.pls | ✓ 1e-13 | 3.70 ms |
| R · external | ||
📐ref.r_mdatools | source | 13.5 ms |
| Backend | Parity | 200×30 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ ref 3e-15 | 1.21 ms🏆 |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 2.06 ms |
pls4all.sklearn | ✓ bind | 1.34 ms |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ 1e-13 | 2.78 ms |
pls4all.R.formula | ✓ 1e-13 | 3.45 ms |
pls4all.R.mdatools | ✓ 1e-13 | 3.65 ms |
pls4all.R.pls | ✓ 1e-13 | 3.45 ms |
| R · external | ||
📐ref.r_mdatools | source | 13.5 ms |
See also: benchmark overview · methods index · interactive dashboard