This function accepts a PLS model of class
PLScalibration and new
data as a
spectra.matrix. It uses the pls::predict.mvr method for
predicting new data and also provides a mahalanobis distance (to the
multivariate center of the calibration dataset) for each new sample.
In order to do conduct the prediction, the new data are subsetted with
subsetSpectra() and then preprocessed with
according to the optimal transformation information stored in the PLS
An object of class
New data (scans) in the same units and resolution as the
spectra used to fit the PLS model. These spectra should be raw (without
preprocessing) if the spectra used to fit the model were not manually
manipulated before the use of
Returns named a vector of predicted values with the following
"mahalanobis" - The mahalanobis distance of each new spectrum from the calibration mean.
"mahalanobis_threshold" - The maximum mahalanobis distance in the calibration dataset.
"outlier" - Logical. TRUE is "mahalanobis" is greater than "mahalanobis_threshold."
Daniel M Griffith
1 2 3 4 5 6 7 8 9 10
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.