Computes orthogonal socres partial least squares (opls) regressions with the NIPALS algorithm. It allows multiple response variables. For internal use only!
pca_nipals(X, ncomp, center, scale,
maxiter, tol,
pcSelmethod = "var",
pcSelvalue = 0.01)
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.
a matrix of predictor variables.
the number of pls components.
logical indicating whether X
must be scaled.
maximum number of iterations.
limit for convergence of the algorithm in the nipals algorithm.
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'
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.
Leonardo Ramirez-Lopez