Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

SMPCA

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

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)

RobStatTM

Robust Statistics: Theory and Methods

v1.0.2
GPL (>= 3)
Authors
Matias Salibian-Barrera [cre], Victor Yohai [aut], Ricardo Maronna [aut], Doug Martin [aut], Gregory Brownson [aut] (ShinyUI), Kjell Konis [aut], Kjell Konis [cph] (erfi), Christophe Croux [ctb] (WBYlogreg, BYlogreg), Gentiane Haesbroeck [ctb] (WBYlogreg, BYlogreg), Martin Maechler [cph] (lmrob.fit, lmrob..M..fit, lmrob.S), Manuel Koller [cph] (lmrob.fit, .vcov.avar1, lmrob.S, lmrob.lar), Matias Salibian-Barrera [aut]
Initial release
2020-03-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.