shared3p_statistics_pca.sc

shared3p_statistics_pca.sc

Module for performing principal component analysis.

Functions:

constants

Constants used to specify which result values are needed from the analysis.

Constants

PCA_RETURN_RESIDUAL = 1

uint8

PCA_RETURN_LOADS = 2

uint8

PCA_RETURN_SCORES = 4

uint8

PCA_RETURN_VARIANCES = 8

uint8

PCA_RETURN_PROPORTIONS = 16

PCA_RETURN_RESIDUAL - residual matrix.

PCA_RETURN_LOADS - loads. The columns are eigenvectors of the covariance matrix. Can be used to project data to the principal component space.

PCA_RETURN_SCORES - transformed input values.

PCA_RETURN_VARIANCES - variances of principal components.

PCA_RETURN_PROPORTIONS - proportion of variance explained by principal component.

gspca

Principal component analysis. Note that this method is relatively efficient and precise when a low number of components is required. It uses fixed point numbers internally so it may fail on large inputs due to overflow.

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64

Parameters

X

- data matrix where the columns are variables

n_components

- how many components to compute

iterations

- how many iterations to run the algorithm

returnValues

- indicates which results to return. Use bitwise or if you want multiple results.

PCAResult structure

None

Function Overloads

gspca(D float32[[2]] X, uint n_components, uint iterations, uint8 returnValues)

gspca(D float64[[2]] X, uint n_components, uint iterations, uint8 returnValues)

PCAResult

Structure containing the results of the analysis. Note that each field only has a reasonable value if it was requested when calling gspca. See also return value constants.

PCAResult<domain D :shared3p , type T>

D T

residual

D T

loads

D T

scores

D T

variances

D T

proportions