Pca-class {rrcov} | R Documentation |
Class "Pca" - virtual base class for all classic and robust PCA classes
Description
The class Pca
searves as a base class for deriving all other
classes representing the results of the classical and robust Principal
Component Analisys methods
Objects from the Class
A virtual Class: No objects may be created from it.
Slots
call
:Object of class
"language"
center
:Object of class
"vector"
the center of the datascale
:Object of class
"vector"
the scaling applied to each variable of the datarank
:Object of class
"numeric"
the rank of the data matrixloadings
:Object of class
"matrix"
the matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors)eigenvalues
:Object of class
"vector"
the eigenvaluesscores
:Object of class
"matrix"
the scores - the value of the projected on the space of the principal components data (the centred (and scaled if requested) data multiplied by theloadings
matrix) is returned. Hence,cov(scores)
is the diagonal matrixdiag(eigenvalues)
k
:Object of class
"numeric"
number of (choosen) principal componentssd
:Object of class
"Uvector"
Score distances within the robust PCA subspaceod
:Object of class
"Uvector"
Orthogonal distances to the robust PCA subspacecutoff.sd
:Object of class
"numeric"
Cutoff value for the score distancescutoff.od
:Object of class
"numeric"
Cutoff values for the orthogonal distancesflag
:Object of class
"Uvector"
The observations whose score distance is larger than cutoff.sd or whose orthogonal distance is larger than cutoff.od can be considered as outliers and receive a flag equal to zero. The regular observations receive a flag 1- crit.pca.distances
criterion to use for computing the cutoff values for the orthogonal and score distances. Default is 0.975.
n.obs
:Object of class
"numeric"
the number of observationseig0
:Object of class
"vector"
all eigenvaluestotvar0
:Object of class
"numeric"
the total variance explained (=sum(eig0)
)
Methods
- getCenter
signature(obj = "Pca")
: center of the data- getScale
signature(obj = "Pca")
: return the scaling applied to each variable- getEigenvalues
signature(obj = "Pca")
: the eigenvalues of the covariance/correlation matrix, though the calculation is actually done with the singular values of the data matrix)- getLoadings
signature(obj = "Pca")
: returns the matrixloadings
(i.e., a matrix whose columns contain the eigenvectors). The function prcomp returns this matrix in the element rotation.- getPrcomp
signature(obj = "Pca")
: returns an S3 objectprcomp
for compatibility with the functions prcomp() and princomp(). Thus the standard plots screeplot() and biplot() can be used- getScores
signature(obj = "Pca")
: returns the rotated data (the centred (and scaled if requested) data multiplied by the loadings matrix).- getSdev
signature(obj = "Pca")
: returns the standard deviations of the principal components (i.e., the square roots of the eigenvalues of the covariance/correlation matrix, though the calculation is actually done with the singular values of the data matrix)- plot
signature(x = "Pca")
: produces a distance plot (ifk=rank
) or distance-distance plot (ifk<rank
)signature(x = "Pca")
: prints the results. The difference to the show() method is that additional parametesr are possible.- show
signature(object = "Pca")
: prints the results- predict
signature(object = "Pca")
: calculates prediction using the results inobject
. An optional data frame or matrix in which to look for variables with which to predict. If omitted, the scores are used. If the original fit used a formula or a data frame or a matrix with column names, newdata must contain columns with the same names. Otherwise it must contain the same number of columns, to be used in the same order. See alsopredict.prcomp
andpredict.princomp
- screeplot
signature(x = "Pca")
: plots the variances against the number of the principal component. See alsoplot.prcomp
andplot.princomp
Author(s)
Valentin Todorov valentin.todorov@chello.at
References
Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. Journal of Statistical Software, 32(3), 1–47. doi:10.18637/jss.v032.i03.
See Also
PcaClassic
, PcaClassic-class
, PcaRobust-class
Examples
showClass("Pca")