| msc | R Documentation |
This function performs multiplicative scatter/signal correction (MSC) on an input data of spectra. It corrects for multiplicative and additive effects in the spectral data by regressing against a reference spectrum.
msc(
x,
xref = NULL,
drop_offset = TRUE,
robust = TRUE,
window = NULL,
drop_na = TRUE,
drop.offset = deprecated(),
drop.na = deprecated()
)
x |
A numeric matrix or data frame containing the input spectra. Each row represents a sample, and each column represents a spectral variable. |
xref |
An optional numeric vector representing the reference spectrum.
If |
drop_offset |
A logical value indicating whether the additive offset
|
robust |
A logical value indicating whether the median ( |
window |
An optional list of numeric vectors specifying the column indices of spectral windows. If provided, MSC is performed separately for each window. |
drop_na |
A logical value indicating whether to remove spectra (rows)
containing missing values. If |
drop.offset, drop.na |
Each spectrum \textbf{x}_i is regressed against the reference spectrum,
\textbf{x}_i = a_i + b_i \textbf{x}_{ref} + \textbf{e}_i, and corrected as
(\textbf{x}_i - a_i) / b_i. When window is given, the regression and
correction are carried out separately in each spectral window (piecewise MSC);
variables outside all windows are left unchanged.
To correct new spectra consistently, pass the returned reference as xref.
A list with the following components:
correction |
The corrected spectra. |
offset |
The intercepts/offsets |
slope |
The multiplicative scatter factors/slopes |
reference |
The reference spectrum used. |
Christian L. Goueguel
data(forageLIBS)
spectra <- forageLIBS[-(1:14)] # the spectral channels
res <- msc(spectra)
res$correction[1:3, 1:4]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.