pca: PCA for Data Scatter Matrix

Description Usage Arguments Details Value See Also Examples

View source: R/pca.R

Description

Calculate the principal component analysis for a data matrix, and also find the squared prediction error (SPE) and Hotelling's T2 test statistic values for each observation in this data matrix.

Usage

1
pca(data, var.amnt = 0.9, ...)

Arguments

data

A centred-and-scaled data matrix or xts matrix

var.amnt

The energy proportion to preserve in the projection, which dictates the number of principal components to keep. Defaults to 0.90.

...

Lazy dots for additional internal arguments

Details

This function takes in a training data matrix, without the label column, and the energy preservation proportion, which defaults to 95 percent per Kazor et al (2016). This proportion is the sum of the q largest eigenvalues divided by the sum of all p eigenvalues, where q is the number of columns of the p x q projection matrix P. This function then returns the projection matrix P, a diagonal matrix of the reciprocal eigenvalues (LambdaInv), a vector of the SPE test statistic values corresponding to the rows of the data matrix, and a T2 test statistic vector similar to the SPE vector.

This internal function is called by faultFilter().

Value

A list of class "pca" with the following:

See Also

Called by: faultFilter.

Examples

1
2
3
nrml <- mspProcessData(faults = "NOC")
scaledData <- scale(nrml[,-1])
pca(scaledData)

mvMonitoring documentation built on Nov. 17, 2017, 6:31 a.m.