pca_nipals: Principal components based on the non-linear iterative...

View source: R/RcppExports.R

pca_nipalsR Documentation

Principal components based on the non-linear iterative partial least squares (nipals) algorithm

Description

Computes orthogonal socres partial least squares (opls) regressions with the NIPALS algorithm. It allows multiple response variables. For internal use only!

Usage

pca_nipals(X, ncomp, center, scale,
           maxiter, tol,
           pcSelmethod = "var",
           pcSelvalue = 0.01)

Arguments

X

a matrix of predictor variables.

ncomp

the number of pls components.

scale

logical indicating whether X must be scaled.

maxiter

maximum number of iterations.

tol

limit for convergence of the algorithm in the nipals algorithm.

pcSelmethod

the method for selecting the number of components. Options are: 'cumvar' (for selecting the number of principal components based on a given cumulative amount of explained variance) and "var" (for selecting the number of principal components based on a given amount of explained variance). Default is 'var'

pcSelvalue

a numerical value that complements the selected method (pcSelmethod). If "cumvar" is chosen, it must be a value (larger than 0 and below 1) indicating the maximum amount of cumulative variance that the retained components should explain. If "var" is chosen, it must be a value (larger than 0 and below 1) indicating that components that explain (individually) a variance lower than this threshold must be excluded. If "manual" is chosen, it must be a value specifying the desired number of principal components to retain. Default is 0.01.

Value

a list containing the following elements:

  • pc_scores: a matrix of principal component scores.

  • pc_loadings: a matrix of of principal component loadings.

  • variance: a matrix of the variance of the principal components.

  • scale: a list conating two objects: center and scale, which correspond to the vectors used to center and scale the input matrix.

Author(s)

Leonardo Ramirez-Lopez


resemble documentation built on May 29, 2024, 8:49 a.m.