Description Usage Arguments Details Value Author(s) References See Also Examples

These functions define the way in which each local fit/prediction is done
within each iteration in the `mbl`

function.

1 2 3 4 5 | ```
local_fit_pls(pls_c)
local_fit_wapls(min_pls_c, max_pls_c)
local_fit_gpr(noise_variance = 0.001)
``` |

`pls_c` |
an integer indicating the number of pls components to be used in
the local regressions when the partial least squares ( |

`min_pls_c` |
an integer indicating the minimum number of pls components
to be used in the local regressions when the weighted average partial least
squares ( |

`max_pls_c` |
integer indicating the maximum number of pls components
to be used in the local regressions when the weighted average partial least
squares ( |

`noise_variance` |
a numeric value indicating the variance of the noise
for Gaussian process local regressions ( |

These functions are used to indicate how to fit
the regression models within the `mbl`

function.

There are three possible options for performing these regressions:

Partial least squares (pls,

`local_fit_pls`

): It uses the orthogonal scores (non-linear iterative partial least squares, nipals) algorithm. The only parameter which needs to be optimized is the number of pls components.Weighted average pls (

\mjdeqn`local_fit_wapls`

): This method was developed by Shenk et al. (1997) and it used as the regression method in the widely known LOCAL algorithm. It uses multiple models generated by multiple pls components (i.e. between a minimum and a maximum number of pls components). At each local partition the final predicted value is a ensemble (weighted average) of all the predicted values generated by the multiple pls models. The weight for each component is calculated as follows:w_j = \frac1s_1:j\times g_jw_j = 1/(s_1:j xx g_j)

where \mjeqns_1:js_1:j is the root mean square of the spectral residuals of the unknown (or target) obasevation(s) when a total of \mjeqnjj pls components are used and \mjeqng_jg_j is the root mean square of the regression coefficients corresponding to the \mjeqnjjth pls component (see Shenk et al., 1997 for more details).

Gaussian process with dot product covariance (

\mjdeqn`local_fit_gpr):`

Gaussian process regression is a probabilistic and non-parametric Bayesian method. It is commonly described as a collection of random variables which have a joint Gaussian distribution and it is characterized by both a mean and a covariance function (Rasmussen and Williams, 2006). The covariance function used in the implemented method is the dot product. The only parameter to be taken into account in this method is the noise. In this method, the process for predicting the response variable of a new sample (\mjeqny_uy_u) from its predictor variables (\mjeqnx_ux_u) is carried out first by computing a prediction vector (\mjeqnAA). It is derived from a reference/training observations congaing both a response vector (\mjeqnYY) and predictors (\mjeqnXX) as follows:A = (X X^T + \sigma^2 I)^-1 YA = (X X^T + sigma^2 I)^-1 Y

where \mjeqn\sigma^2sigma^2 denotes the variance of the noise and \mjeqnII the identity matrix (with dimensions equal to the number of observations in \mjeqnXX). The prediction of \mjeqny_uy_u is then done as follows:

\mjdeqn\haty_u = (x_ux_u^T) Ahat y_u = (x_u x_u^T) A

An object of class `local_fit`

mirroring the input arguments.

Shenk, J., Westerhaus, M., and Berzaghi, P. 1997. Investigation of a LOCAL calibration procedure for near infrared instruments. Journal of Near Infrared Spectroscopy, 5, 223-232.

Rasmussen, C.E., Williams, C.K. Gaussian Processes for Machine Learning. Massachusetts Institute of Technology: MIT-Press, 2006.

1 | ```
local_fit_wapls(min_pls_c = 3, max_pls_c = 12)
``` |

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.