# pcacov

Principal component analysis on covariance matrix

## Syntax

```COEFF = pcacov(V) [COEFF,latent] = pcacov(V) [COEFF,latent,explained] = pcacov(V) ```

## Description

`COEFF = pcacov(V)` performs principal components analysis on the p-by-p covariance matrix `V` and returns the principal component coefficients, also known as loadings. `COEFF` is a p-by-p matrix, with each column containing coefficients for one principal component. The columns are in order of decreasing component variance.

`pcacov` does not standardize `V` to have unit variances. To perform principal components analysis on standardized variables, use the correlation matrix `R = V./(SD*SD')`, where `SD = sqrt(diag(V))`, in place of `V`. To perform principal components analysis directly on the data matrix, use `pca`.

`[COEFF,latent] = pcacov(V)` returns `latent`, a vector containing the principal component variances, that is, the eigenvalues of `V`.

`[COEFF,latent,explained] = pcacov(V)` returns `explained`, a vector containing the percentage of the total variance explained by each principal component.

## Examples

```load hald covx = cov(ingredients); [COEFF,latent,explained] = pcacov(covx) COEFF = 0.0678 -0.6460 0.5673 -0.5062 0.6785 -0.0200 -0.5440 -0.4933 -0.0290 0.7553 0.4036 -0.5156 -0.7309 -0.1085 -0.4684 -0.4844 latent = 517.7969 67.4964 12.4054 0.2372 explained = 86.5974 11.2882 2.0747 0.0397```

## References

 Jackson, J. E. A User's Guide to Principal Components. Hoboken, NJ: John Wiley and Sons, 1991.

 Jolliffe, I. T. Principal Component Analysis. 2nd ed., New York: Springer-Verlag, 2002.

 Krzanowski, W. J. Principles of Multivariate Analysis: A User's Perspective. New York: Oxford University Press, 1988.

 Seber, G. A. F., Multivariate Observations, Wiley, 1984.