predict.EMSC: Predict Method for EMSC

Description Usage Arguments See Also Examples

View source: R/EMSC_results.R

Description

Prediction for EMSC ojects. Corrections are calculated for the new matrix based on the EMSC model used in the input object.

Usage

1
2
## S3 method for class 'EMSC'
predict(object, newdata = NULL, ...)

Arguments

object

An object fitted by the EMSC function.

newdata

A matrix or object convertable to a matrix containing observations as rows.

...

unused.

See Also

EMSC EMSC_model

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(fishoil)
Raman.cal <- fishoil$Raman[  1:90,  850:3300]
Raman.val <- fishoil$Raman[-(1:90), 850:3300]
EMSC.cal  <- EMSC(Raman.cal)
EMSC.val  <- predict(EMSC.cal, Raman.val)
identical(EMSC.cal$model, EMSC.val$model) # Same model, reference spectrum, etc.

matplot(t(EMSC.cal$corrected), type = 'l', col = 'black', lty = 1, ylab = 'Intensity')
matplot(t(EMSC.val$corrected), type = 'l', col = 'red', lty = 2, add = TRUE)
legend('topleft', legend = c('Calibration','Validation'), lty = 1:2, col = 1:2)

EMSC documentation built on Sept. 21, 2021, 1:06 a.m.