Learn R Programming

pls (version 1.0-2)

msc: 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, \dots)
## S3 method for class 'msc':
makepredictcall(var, call)

Arguments

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.

encoding

latin1

Details

makepredictcall.msc is an internal utility function; it is noe meant for interactive use. See makepredictcall for details.

References

Mar/N�s

See Also

mvr, pcr, plsr

Examples

Run this code
data(NIR)
## Direct correction:
Ztrain <- msc(NIR$X[NIR$train,])
Ztest <- predict(Ztrain, NIR$X[!NIR$train,])

## Used in formula:
mod <- plsr(y ~ msc(X), ncomp = 6, data = NIR[NIR$train,])
pred <- predict(mod, newdata = NIR[!NIR$train,]) # Automatically scatter correction

Run the code above in your browser using DataLab