Description Usage Arguments Value Author(s) Examples

This function is a wrapper for `mvr()`

in the pls package. The
function fits a Partial Least Squares (PLS) model relating a set of spectra
to a component variable. The function uses leave-one-out crossvalidation to
calculate the optimal number of latent vectors to use in the PLS regression.
The optimal number of latent vectors is the minimum number of factors that
result in a predicted residual error sum of squares (PRESS) statistic with
a probability less than or equal to 0.75.

1 2 3 |

`component` |
A vector of y-values. One for each spectrum. |

`spectra` |
An object of class |

`optimal_params` |
An object of class |

`optimal_model` |
A row index (default = 1; i.e., the top model) for the
parameters desired in the |

`validation` |
What model validation should be taken, if any? ("none" =
no validation; "LOO" = leave-one-out cross validation; "testset" =
validation using a data subset specified as |

`training_set` |
A logical vector of |

`parallel` |
Logical. The default is |

`max_comps` |
What is the maximum number of latent vectors to possibly include in the PLS regression. An integer. |

Returns an object of class `PLScalibration`

. The object is a
list containing the pls model and the calibration/validation statistics. See
below:

model - PLS model of class `mvr`

form the `pls`

package

rank -
the number of latent vectors (factors, ranks, etc) chosen for the model

RMSEP - root mean squared error of prediction

R2_Cal - model calibration
R2

R2_Val - model validation R2

regions - the spectra regions used in
model fitting

preproc - the preprocessing steps used before model
fitting

training_set - logical indicating those spectra used in the
calibration fitting

data - data used in model fitting

Daniel M Griffith

1 2 3 4 5 6 | ```
# See main leaf.spec-package example. But:
## Not run:
data(shootout)
temp <- calibrate(component = shootout_wetlab$N, spectra = shootout_scans, validation = "LOO")
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.