Learn R Programming

resemble (version 2.2.3)

reconstruction_error: Projection to pls and then re-construction

Description

Projects spectra onto a PLS space and then reconstructs it back.

Usage

reconstruction_error(x, 
                            projection_mat, 
                            xloadings, 
                            scale, 
                            Xcenter, 
                            Xscale, 
                            scale_back = FALSE)

Value

a matrix of 1 row and 1 column.

Arguments

x

a matrix to project.

projection_mat

the projection matrix generated by the opls_get_basics function.

xloadings

the loadings matrix generated by the opls_get_basics function.

scale

logical indicating if scaling is required

Xcenter

a matrix of one row with the centering values

Xscale

a matrix of one row with the scaling values

scale_back

compute the reconstruction error after de-centering the data and de-scaling it.

Author

Leonardo Ramirez-Lopez