These functions define the way in which each local fit/prediction is done
within each iteration in the mbl
function.
local_fit_pls(pls_c, modified = FALSE, max_iter = 100, tol = 1e-6)local_fit_wapls(min_pls_c, max_pls_c, modified = FALSE,
max_iter = 100, tol = 1e-6)
local_fit_gpr(noise_variance = 0.001)
An object of class local_fit
mirroring the input arguments.
an integer indicating the number of pls components to be used in
the local regressions when the partial least squares (local_fit_pls
)
method is used.
a logical indicating whether the modified version of the pls
algorithm (Shenk and Westerhaus, 1991 and Westerhaus, 2014). Default is
FALSE
.
an integer indicating the maximum number of iterations in
case tol
is not reached. Defaul is 100.
a numeric value indicating the convergence for calculating the scores. Default is 1-e6.
an integer indicating the minimum number of pls components
to be used in the local regressions when the weighted average partial least
squares (local_fit_wapls
) method is used. See details.
integer indicating the maximum number of pls components
to be used in the local regressions when the weighted average partial least
squares (local_fit_wapls
) method is used. See details.
a numeric value indicating the variance of the noise
for Gaussian process local regressions (local_fit_gpr
). Default is
0.001.
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 (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 = 1s_1:j g_jw_j = 1/(s_1:j xx g_j)where s_1:js_1:j is the root mean square of the
spectral reconstruction error of the unknown (or target) observation(s)
when a total of jj pls components are used and
g_jg_j is the root mean square of the squared regression
coefficients corresponding to the jjth pls component (see
Shenk et al., 1997 for more details).
Gaussian process with dot product covariance (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
(y_uy_u) from its predictor variables
(x_ux_u) is carried out first by computing a prediction
vector (AA). It is derived from a reference/training observations
congaing both a response vector (YY) and predictors (XX) as follows:A = (X X^T + ^2 I)^-1 YA = (X X^T + sigma^2 I)^-1 Ywhere ^2sigma^2 denotes the variance of the noise and II the
identity matrix (with dimensions equal to the number of observations in
XX). The prediction of y_uy_u is then done as follows:y_u = (x_ux_u^T) Ahat y_u = (x_u x_u^T) A
The modified
argument in the pls methods (local_fit_pls()
and local_fit_wapls()
) is used to indicate if
a modified version of the pls algorithm (modified pls or mpls) is to be used.
The modified pls was proposed Shenk and Westerhaus
(1991, see also Westerhaus, 2014) and it differs from the standard pls method
in the way the weights of the predictors (used to compute the matrix of
scores) are obtained. While pls uses the covariance between response(s)
and predictors (and later their deflated versions corresponding at each pls
component iteration) to obtain these weights, the modified pls uses the
correlation as weights. The authors indicate that by using correlation,
a larger potion of the response variable(s) can be explained.
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., 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.
Westerhaus, M. 2014. Eastern Analytical Symposium Award for outstanding Wachievements in near infrared spectroscopy: my contributions to Wnear infrared spectroscopy. NIR news, 25(8), 16-20.
mbl
local_fit_wapls(min_pls_c = 3, max_pls_c = 12)
Run the code above in your browser using DataLab