get_wapls_weights: Internal function for computing the weights of the PLS...

View source: R/local_helpers.R

get_wapls_weightsR Documentation

Internal function for computing the weights of the PLS components necessary for weighted average PLS

Description

internal

Usage

get_wapls_weights(pls_model, original_x, type = "w1", new_x = NULL, pls_c)

Arguments

pls_model

either an object returned by the pls_cv function or an object as returned by the opls_get_basics function which contains a pls model.

original_x

the original spectral matrix which was used for calibrating the pls model.

type

type of weight to be computed. The only available option (for the moment) is "w1". See details on the mbl function where it is explained how "w1" is computed whitin the "wapls" regression.

new_x

a vector of a new spectral observation. When "w1" is selected, new_x must be specified.

pls_c

a vector of length 2 which contains both the minimum and maximum number of PLS components for which the weights must be computed.

Value

get_wapls_weights returns a vector of weights for each PLS component specified

Author(s)

Leonardo Ramirez-Lopez and Antoine Stevens


resemble documentation built on April 21, 2023, 1:13 a.m.