opls_gs: orthogonal scores algorithm of partial leat squares (opls)

View source: R/RcppExports.R

opls_gsR Documentation

orthogonal scores algorithm of partial leat squares (opls)

Description

Computes orthogonal scores partial least squares (opls) regressions with the NIPALS algorithm. It allows multiple response variables. It does not return the variance information of the components. NOTE: For internal use only!

Usage

opls_gs(Xr, 
        Yr,
        Xu, 
        ncomp,
        scale,     
        response = FALSE, 
        reconstruction = TRUE,
        similarity = TRUE,
        fresponse = TRUE,
        algorithm = "pls")

Arguments

Xr

a matrix of predictor variables for the training set.

Yr

a matrix of a single response variable for the training set.

Xu

a matrix of predictor variables for the test set.

ncomp

the number of pls components.

scale

logical indicating whether X must be scaled.

response

logical indicating whether to compute the prediction of Yu.

reconstruction

logical indicating whether to compute the reconstruction error of Xu.

similarity

logical indicating whether to compute the the distance score between Xr and Xu (in the pls space).

fresponse

logical indicating whether to compute the score of the variance not explained for Yu.

algorithm

(for weights computation) a character string indicating what method to use. Options are: 'pls' for pls (using covariance between X and Y) or 'mpls' for modified pls (using correlation between X and Y).

Value

a list containing the following elements:

  • ncomp the number of components.

  • pred_response the response predictions for Xu.

  • rmse_reconstruction the rmse of the reconstruction for Xu.

  • score_dissimilarity the distance score between Xr and Xu.

Author(s)

Leonardo Ramirez-Lopez


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