Description Usage Arguments Details Value Author(s) References Examples
A fast and simple algorithm for approximating the PP-estimators for PCA: Croux and Ruiz-Gazen (2005)
1 2 3 4 5 |
formula |
a formula with no response variable, referring only to numeric variables. |
data |
an optional data frame (or similar: see
|
subset |
an optional vector used to select rows (observations) of the
data matrix |
na.action |
a function which indicates what should happen
when the data contain |
... |
arguments passed to or from other methods. |
x |
a numeric matrix (or data frame) which provides the data for the principal components analysis. |
k |
number of principal components to compute. If |
kmax |
maximal number of principal components to compute.
Default is |
scale |
a value indicating whether and how the variables should be
scaled. If |
trace |
whether to print intermediate results. Default is |
PcaProj
, serving as a constructor for objects of class PcaProj-class
is a generic function with "formula" and "default" methods. For details see PCAproj
and the relevant references.
An S4 object of class PcaProj-class
which is a subclass of the
virtual class PcaRobust-class
.
Valentin Todorov valentin.todorov@chello.at
C. Croux, A. Ruiz-Gazen (2005). High breakdown estimators for principal components: The projection-pursuit approach revisited, Journal of Multivariate Analysis, 95, 206–226.
Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. Journal of Statistical Software, 32(3), 1–47. URL http://www.jstatsoft.org/v32/i03/.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # multivariate data with outliers
library(mvtnorm)
x <- rbind(rmvnorm(200, rep(0, 6), diag(c(5, rep(1,5)))),
rmvnorm( 15, c(0, rep(20, 5)), diag(rep(1, 6))))
# Here we calculate the principal components with PCAgrid
pc <- PcaProj(x, 6)
# we could draw a biplot too:
biplot(pc)
# we could use another calculation method and another objective function, and
# maybe only calculate the first three principal components:
pc <- PcaProj(x, 3, method="qn", CalcMethod="sphere")
biplot(pc)
# now we want to compare the results with the non-robust principal components
pc <- PcaClassic(x)
# again, a biplot for comparision:
biplot(pc)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.