pp_msc — Multiplicative scatter correction (MSC)

Group: Preprocessing · C ABI: n4m_transform_msc_*

Description

Multiplicative Scatter Correction.

Full binding docstring
Multiplicative Scatter Correction.

Fit learns the mean reference spectrum from the training matrix. Transform
regresses each row against that reference and applies the conventional
row-wise MSC correction used by prospectr and pls.

Parameters

No constructor parameters.

API and bindings

C ABI (ABI 2): n4m_transform_msc_create · n4m_transform_msc_destroy · n4m_transform_msc_fit · n4m_transform_msc_get_reference · n4m_transform_msc_inverse_transform · n4m_transform_msc_is_fitted · n4m_transform_msc_reference_size · n4m_transform_msc_set_reference · n4m_transform_msc_transform. Use the linked public header for the exact signature, configuration, and result handles.

Python (verified public re-export):

from n4m.transform.scatter import MSC

Source signature: MSC().

R (source-verified): msc_fit(X).

library(n4m)
result <- msc_fit(X)

MATLAB / Octave: no current source-verified entry point was found for this catalog method.

Explanations

Bibliographic source

Geladi, MacDougall & Martens (1985), Linearization and Scatter-Correction for Near-Infrared Reflectance Spectra of Meat, Applied Spectroscopy 39, 491–500, https://doi.org/10.1366/0003702854248656.

Mathematical principle

Fit stores the training mean reference \(r\). Each row is fit as \(x_i=a_i+b_i r+e_i\) by ordinary least squares and corrected to \((x_i-a_i)/b_i\), removing row-wise additive and multiplicative scatter.

Appropriate uses

Diffuse-reflectance calibration where particle size or path length mainly changes offset and scale.

Limits and validation

MSC assumes a linear relation to a representative reference and becomes unstable when the fitted slope is near zero. Training-reference estimation must stay within folds, and chemical variation correlated with scatter can be altered.

Implementation

n4m.transform.scatter.MSC uses n4m_transform_msc_*; reference fitting and row-wise OLS correction are in preprocessing/scatter/msc.c.

The ABI-2 implementation is the n4m_transform_msc_* lifecycle in libn4m.

Sources and provenance

https://doi.org/10.1366/0003702854248656; https://github.com/GBeurier/nirs4all-methods/blob/main/cpp/src/core/preprocessing/scatter/msc.c


See also: methods index · interactive dashboard