msc {pls} | R Documentation |
Multiplicative Scatter Correction
Description
Performs multiplicative scatter/signal correction on a data matrix.
Usage
msc(X, reference = NULL)
## S3 method for class 'msc'
predict(object, newdata, ...)
## S3 method for class 'msc'
makepredictcall(var, call)
Arguments
X , newdata |
numeric matrices. The data to scatter correct. |
reference |
numeric vector. Spectre to use as reference. If
|
object |
an object inheriting from class |
... |
other arguments. Currently ignored. |
var |
A variable. |
call |
The term in the formula, as a call. |
Details
makepredictcall.msc
is an internal utility function; it is not meant
for interactive use. See makepredictcall
for details.
Value
Both msc
and predict.msc
return a multiplicative
scatter corrected matrix, with attribute "reference"
the vector used
as reference spectre. The matrix is given class c("msc", "matrix")
.
For predict.msc
, the "reference"
attribute of object
is
used as reference spectre.
Author(s)
Bjørn-Helge Mevik and Ron Wehrens
References
Martens, H., Næs, T. (1989) Multivariate calibration. Chichester: Wiley.
See Also
Examples
data(yarn)
## Direct correction:
Ztrain <- msc(yarn$NIR[yarn$train,])
Ztest <- predict(Ztrain, yarn$NIR[!yarn$train,])
## Used in formula:
mod <- plsr(density ~ msc(NIR), ncomp = 6, data = yarn[yarn$train,])
pred <- predict(mod, newdata = yarn[!yarn$train,]) # Automatically scatter corrected