pls_diagnostic_dmodx — DModX (distance to the model in X)¶
Group: Diagnostic · Registry tolerance: 1e-08
Description¶
PLS Distance-to-Model X (§9)
Registry note — mdatools has no native DModX; the R script computes it from
$xdecomp$Qand the same dof formula pls4all uses.
Parameters¶
Name |
Type |
Default |
Notes |
|---|---|---|---|
|
|
|
registry benchmark cell value |
Explanations¶
Bibliographic source¶
Eriksson, L., Byrne, T., Johansson, E., Trygg, J. & Vikström, C. (2013). Multi- and Megavariate Data Analysis. Basic Principles and Applications, 3rd ed., Umetrics Academy, §4.7. Verified primary catalogue: https://search.worldcat.org/title/891362497.
Mathematical principle¶
Let Q be an observation’s squared X reconstruction residual and let a be the number of components. The implementation reports \(\sqrt{Q/(p-a)}/\sigma\), where \(\sigma=\sqrt{\sum Q_{ref}/((p-a)(n_{ref}-a-1))}\) when a reference set is supplied.
Appropriate uses¶
Standardizing X reconstruction distance for model-population screening.
Limits and validation¶
The implementation uses p-a degrees of freedom and a reference residual scale; without reference data sigma is fixed to one.
Implementation¶
Valid degrees of freedom require p>a and, for reference scaling, n_ref>a+1. With no reference residuals the implementation sets sigma to one rather than estimating a model-population scale.
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 2e-15 | 1.25 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 1.25 ms🏆 |
pls4all.sklearn | ✓ bind | 1.41 ms |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ 7e-16 | 4.16 ms |
pls4all.R.formula | ✓ 7e-16 | 4.79 ms |
pls4all.R.mdatools | ✓ 7e-16 | 5.71 ms |
pls4all.R.pls | ✓ 7e-16 | 4.47 ms |
| R · external | ||
📐ref.r_mdatools | source | 19.8 ms |
| Backend | Parity | 200×30 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ ref 2e-15 | 1.28 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 1.25 ms🏆 |
pls4all.sklearn | ✓ bind | 1.41 ms |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ 7e-16 | 6.86 ms |
pls4all.R.formula | ✓ 7e-16 | 20.8 ms |
pls4all.R.mdatools | ✓ 7e-16 | 14.5 ms |
pls4all.R.pls | ✓ 7e-16 | 18.2 ms |
| R · external | ||
📐ref.r_mdatools | source | 43.6 ms |
| Backend | Parity | 200×30 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ ref 2e-15 | 6.12 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 2.29 ms |
pls4all.sklearn | ✓ bind | 1.45 ms🏆 |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ 7e-16 | 3.74 ms |
pls4all.R.formula | ✓ 7e-16 | 4.94 ms |
pls4all.R.mdatools | ✓ 7e-16 | 5.32 ms |
pls4all.R.pls | ✓ 7e-16 | 4.64 ms |
| R · external | ||
📐ref.r_mdatools | source | 21.1 ms |
See also: benchmark overview · methods index · interactive dashboard