| fit_methods | R Documentation |
These functions create configuration objects that specify how local
regression models are fitted within the mbl function.
fit_pls(ncomp, method = c("pls", "mpls", "simpls"),
scale = FALSE, max_iter = 100L, tol = 1e-6)
fit_wapls(min_ncomp, max_ncomp, method = c("mpls", "pls", "simpls"),
scale = FALSE, max_iter = 100L, tol = 1e-6)
fit_gpr(noise_variance = 0.001, center = TRUE, scale = TRUE)
ncomp |
an integer indicating the number of PLS components to use
in local regressions when |
min_ncomp |
an integer indicating the minimum number of PLS components
to use in local regressions when |
max_ncomp |
an integer indicating the maximum number of PLS components
to use in local regressions when |
method |
a character string indicating the PLS algorithm to use. Options are:
Default is |
scale |
logical indicating whether predictors must be scaled.
Default is |
max_iter |
an integer indicating the maximum number of iterations
for convergence in the NIPALS algorithm. Only used when
|
tol |
a numeric value indicating the convergence tolerance for
calculating scores in the NIPALS algorithm. Only used when
|
noise_variance |
a numeric value indicating the variance of the noise
for Gaussian process local regressions ( |
center |
logical indicating whether predictors should be centered
before fitting. Only used for |
These functions create configuration objects that are passed to
mbl to specify how local regression models are fitted.
There are three fitting methods available:
fit_pls)Uses orthogonal scores partial least squares regression. Three algorithm variants are available:
Standard PLS (method = 'pls'): Uses the NIPALS
algorithm with covariance-based weights.
Modified PLS (method = 'mpls'): Uses the NIPALS
algorithm with correlation-based weights. Proposed by Shenk and
Westerhaus (1991), this approach gives equal influence to all
predictors regardless of their variance scale.
SIMPLS (method = 'simpls'): Uses the SIMPLS
algorithm (de Jong, 1993), which deflates the cross-product matrix
rather than X itself. This is computationally faster, especially for
wide matrices, and produces identical predictions to standard PLS.
The only parameter to optimise is the number of PLS components
(ncomp).
fit_wapls)This method was developed by Shenk et al. (1997) and is used as the
regression method in the LOCAL algorithm. It fits multiple PLS models
using different numbers of components (from min_ncomp to
max_ncomp). The final prediction is a weighted average of
predictions from all models, where the weight for component \mjeqnjj
is:
w_j = \frac1s_1:j \times g_jw_j = 1/(s_1:j * g_j)
where \mjeqns_1:js_1:j is the root mean square of the spectral reconstruction error of the target observation(s) when \mjeqnjj PLS components are used, and \mjeqng_jg_j is the root mean square of the squared regression coefficients for the \mjeqnjjth component.
The same algorithm variants ('pls', 'mpls', 'simpls')
are available. The default is 'mpls' following the original LOCAL
implementation.
fit_gpr)Gaussian process regression is a non-parametric Bayesian method characterised by a mean and covariance function. This implementation uses a dot product covariance.
The prediction vector \mjeqnAA is computed from training data (\mjeqnXX, \mjeqnYY) as:
\mjdeqnA = (X X^T + \sigma^2 I)^-1 YA = (X X^T + sigma^2 I)^-1 Y
where \mjeqn\sigma^2sigma^2 is the noise variance and \mjeqnII is the identity matrix. Prediction for a new observation \mjeqnx_ux_u is:
\mjdeqn\haty_u = x_u X^T Ahat y_u = x_u X^T A
The only parameter is the noise variance (noise_variance).
An object of class c("fit_<method>", "fit_method")
containing the specified parameters. This object is passed to
mbl to configure local model fitting.
de Jong, S. (1993). SIMPLS: An alternative approach to partial least squares regression. Chemometrics and Intelligent Laboratory Systems, 18(3), 251-263.
Rasmussen, C.E., Williams, C.K. (2006). Gaussian Processes for Machine Learning. MIT Press.
Shenk, J.S., & Westerhaus, M.O. (1991). Populations structuring of near infrared spectra and modified partial least squares regression. Crop Science, 31(6), 1548-1555.
Shenk, J., Westerhaus, M., & Berzaghi, P. (1997). Investigation of a LOCAL calibration procedure for near infrared instruments. Journal of Near Infrared Spectroscopy, 5, 223-232.
Westerhaus, M. (2014). Eastern Analytical Symposium Award for outstanding achievements in near infrared spectroscopy: my contributions to near infrared spectroscopy. NIR news, 25(8), 16-20.
mbl
# PLS with 10 components using standard algorithm
fit_pls(ncomp = 10)
# PLS with modified algorithm (correlation-based weights)
fit_pls(ncomp = 10, method = "mpls")
# PLS with SIMPLS (faster, no iteration)
fit_pls(ncomp = 10, method = "simpls")
# Weighted average PLS (LOCAL-style)
fit_wapls(min_ncomp = 3, max_ncomp = 12)
# Weighted average PLS with SIMPLS
fit_wapls(min_ncomp = 3, max_ncomp = 15, method = "simpls")
# Gaussian process regression
fit_gpr()
fit_gpr(noise_variance = 0.01)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.