Learn R Programming

ProjectionBasedClustering (version 1.2.1)

PCA: Principal Component Analysis (PCA)

Description

Performs a principal components analysis on the given data matrix projection=SammonsMapping(Data)

Usage

PCA(Data,OutputDimension=2,Scale=FALSE,Center=FALSE,PlotIt=FALSE,Cls)

Value

ProjectedPoints

[1:n,OutputDimension], n by OutputDimension matrix containing coordinates of the Projectio

Rotation

the matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors)

sDev

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)

TransformedData

matrix with PCA transformed Data

Center

the centering used, or FALSE

Scale

the scaling used, or FALSE

Arguments

Data

numerical matrix of data: n cases in rows, d variables in columns

OutputDimension

Number of dimensions in the Outputspace, default=2

Scale

a logical value indicating whether the variables should be scaled to have unit variance before the analysis takes place. The default is FALSE for consistency with S, but in general scaling is advisable. Alternatively, a vector of length equal the number of columns of x can be supplied. The value is passed to scale.

Center

a logical value indicating whether the variables should be shifted to be zero centered. Alternately, a vector of length equal the number of columns of x can be supplied. The value is passed to scale

PlotIt

Default: FALSE, If TRUE: Plots the projection as a 2d visualization. OutputDimension>2: only the first two dimensions will be shown

Cls

[1:n,1] Optional,: only relevant if PlotIt=TRUE. Numeric vector, given Classification in numbers: every element is the cluster number of a certain corresponding element of data.

Author

Michael Thrun

Details

An short overview of different types of projection methods can be found in [Thrun, 2018, p.42, Fig. 4.1] (tools:::Rd_expr_doi("10.1007/978-3-658-20540-9")).

Examples

Run this code
data('Hepta')
Data=Hepta$Data

Proj=PCA(Data)

if (FALSE) {
PlotProjectedPoints(Proj$ProjectedPoints,Hepta$Cls)
}

Run the code above in your browser using DataLab