SMPCA: Robust principal components

View source: R/RobPCA_SM.R

pcaRobSR Documentation

Robust principal components

Description

This function computes robust principal components based on the minimization of the "residual" M-scale.

Usage

pcaRobS(X, ncomp, desprop = 0.9, deltasca = 0.5, maxit = 100)

Arguments

X

a data matrix with observations in rows.

ncomp

desired (maximum) number of components

desprop

desired (minimum) proportion of explained variability (default = 0.9)

deltasca

"delta" parameter of the scale M-estimator (default=0.5)

maxit

maximum number of iterations (default= 100)

Value

A list with the following components:

q

The actual number of principal components

propex

The actual proportion of unexplained variability

eigvec

Eigenvectors, in a p x q matrix

fit

an n x p matrix with the rank-q approximation to X

repre

An n x q matrix with representation of data in R^q (scores)

propSPC

A vector of length p with the cumulative explained variance from initial SPC

Author(s)

Ricardo Maronna, rmaronna@retina.ar, based on original code by D. Pen~a and J. Prieto

References

http://www.wiley.com/go/maronna/robust

Examples

data(bus)
X0 <- as.matrix(bus)
X1 <- X0[,-9]
ss <- apply(X1, 2, mad)
mu <- apply(X1, 2, median)
X <- scale(X1, center=mu, scale=ss)
q <- 3  #compute three components
rr <- pcaRobS(X, q, 0.99)
round(rr$eigvec, 3)


msalibian/RobStatTM documentation built on Jan. 11, 2024, 12:49 a.m.