pcaL1: L1 Principal Components Analysis

Description Usage Arguments Value References Examples

View source: R/PCAandFA.R

Description

Uses the L1 singular value decomposition in the function svdL1 to construct an L1-norm set of principal components. L1 PCA can be more resistant to outliers, as well as often has intrinsic sparsity in the loadings matrix. The raw L1 eigenvectors are orthonormalized prior to computation of the principal components due to the L1 singular value decomposition not being orthnormal. However, the non-orthogonalized L1-PCA results can be returned by setting the argument orth = FALSE. See the pcaR1 function for an intrinsically orthogonal L1-norm based method.

Usage

1
2
3
4
5
6
7
8
9
pcaL1(
  x,
  ncomp = min(nrow(x) - 1, ncol(x)),
  scale = T,
  interp = F,
  orth = T,
  maxit = 500,
  tol = 1e-06
)

Arguments

x

a matrix or data frame containing only numeric variables

ncomp

the number of components to retain.

scale

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

interp

should values be interpolated during the calculation of L1 weighted svd? Since the calculations entail calculating weighted medians, and weighted medians are not always unique, this will smooth the values as to obtain a unique solution. this can come at the cost of accuracy, however, as well as substantially slow down both the rate of convergence and rate of calculations at each iteration, so the default is FALSE. However, if convergence problems occur with this option set to FALSE, it may be worth trying interp=TRUE.

orth

should the L1-eigenvectors be orthogonalized using a QR decomposition? the default is TRUE. setting to FALSE returns loadings and scores based on the raw L1 eigenvectors.

maxit

the maximum number of iterations for the L1-SVD algorithm. defaults to 500.

tol

convergence tolerance. defaults to 1e-6

Value

an object of class PrincipalComp

References

Hawkins, D.M.; Liu, L.; Young, S.S. (2001) Robust Singular Value Decomposition, National Institute of Statistical Sciences, Technical Report Number

Examples

1
pcaL1(x, 3)

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