pcaCurve: Curvilinear Principal Components Analysis

Description Usage Arguments Value References Examples

View source: R/PCAandFA.R

Description

This performs a curvilinear component analysis, which is a method of PCA that is capable of capturing non-linear trends in the data. The algorithm takes an initial set of scores as a starting point, along with a distance matrix, to unfold the multidimensional manifold. Then a neural network is used to minimize a cost function to find a projection of the input data which function as principal component scores. In this function the eigenvalues and loadings matrix are approximated by matrix-multiplying the transposed data x by the transposed pseudoinverse of the scores. The original data set is then reconstructed from this approximated loadings matrix and set of scores and the eigenvalues of this reconstruction are returned as the approximate eigenvalues. This is simply to facilitate plotting and ease of interpretation, but do keep in mind the eigenvalues and loadings matrix returned here are approximations.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
pcaCurve(
  x,
  ncomp = min(nrow(x) - 2, ncol(x) - 1),
  init = c("mds", "pca", "pcaSphere"),
  lambda = NULL,
  alpha = 0.5,
  Lp = 2,
  scale = T,
  maxit = 1000,
  tol = 1e-12
)

Arguments

x

a data frame or matrix of numeric variables

ncomp

the number of desired principal components.

init

linear component scores to initialize the nonlinear estimator. can be one of "mds", "pca", or "pcaSphere". "mds" uses the cmdscale function to compute the classical multidimensional scaling. alternatively, a matrix of component scores with the number of columns equal to 'ncomp' can be supplied.

lambda

the initial influence radius. if left as NULL, it defaults to twice the maximum of the vector of absolute average deviations for each component.

alpha

initial learning rate. defaults to 0.5.

Lp

a norm for the Minkowski distance metric. defaults to 2.

scale

should the variables be scaled prior to analysis? Defaults to TRUE.

maxit

maximum number of iterations. defaults to 1000.

tol

convergence tolerance. defaults to 1e-12.

Value

an object of class PrincipalComp

References

Demartines, P.; Herault, J. (1997) Curvilinear component analysis: a self-organizing neural network for nonlinear mapping of data sets. IEEE Transactions on Neural Networks archive. 8, 1, 148-154.

Examples

1

abnormally-distributed/cvreg documentation built on May 3, 2020, 3:45 p.m.