pca
Performs a principal component analysis on a data matrix.
A principal component analysis of a data matrix of observations in a dimensional space returns a transformation matrix, to perform a change of basis on the data. The first component of the new basis is the direction that maximizes the variance of the projected data.
Input argument:
The following Name, Value pair arguments can be used:
"Algorithm"
defines the algorithm to use:
"svd"
(default), for singular value decomposition
"eig"
for eigenvalue decomposition
"Centered"
is a boolean indicator for centering the observation data.
It is true
by default.
"Economy"
is a boolean indicator for the economy size output. It is
true
by default. Hence, pca
returns only the elements of
latent that are not necessarily zero, and the corresponding columns of
coeff and score, that is, when , only the first
.
"NumComponents"
defines the number of components to return.
If , then only the first columns of coeff and
score are returned.
"Rows"
defines how to handle missing values:
"complete"
(default), missing values are removed before
computation.
"pairwise"
(only valid when "Algorithm"
is
"eig"
), the covariance of rows with missing data is computed using
the available data, but the covariance matrix could be not positive definite,
which triggers the termination of pca
.
"complete"
, missing values are not allowed, pca
terminates with an error if there are any.
"Weights"
defines observation weights as a vector of positive values
of length .
"VariableWeights"
defines variable weights:
"variance"
to use the sample variance as weights.
Return values:
Matlab compatibility note: the alternating least square method ’als’ and associated options ’Coeff0’, ’Score0’, and ’Options’ are not yet implemented
See also: barttest, factoran, pcacov, pcares
Source Code: pca