# Singular Value Decomposition versus Principal Component Analysis

### From Wikimization

(Difference between revisions)

(New page: == Singular Value Decomposition <i>versus</i> Principal Component Analysis == from <i>SVD meets PCA</i>, slide by Cleve Moler “''The Wikipedia pages on SVD and PCA are quite good and c...) |
Current revision (19:43, 17 September 2018) (edit) (undo) |
||

(10 intermediate revisions not shown.) | |||

Line 1: | Line 1: | ||

- | + | from [https://www.mathworks.com/videos/the-singular-value-decomposition-saves-the-universe-1481294462044.html <i>SVD meets PCA</i>] | |

- | + | slide [17:46] by Cleve Moler. | |

- | + | ||

“''The Wikipedia pages on SVD and PCA are quite good and contain a number of useful links, although not to each other.''” | “''The Wikipedia pages on SVD and PCA are quite good and contain a number of useful links, although not to each other.''” | ||

Line 28: | Line 27: | ||

coef = V(:,1:rho).*sense2 | coef = V(:,1:rho).*sense2 | ||

</pre> | </pre> | ||

+ | |||

+ | <i>coef, score, latent</i> definitions from | ||

+ | [https://www.mathworks.com/help/stats/pca.html Matlab pca()] | ||

+ | command. | ||

+ | |||

+ | Terminology like <i>variance</i> of principal components (PCs) can be found here: | ||

+ | [https://stats.stackexchange.com/questions/134282/relationship-between-svd-and-pca-how-to-use-svd-to-perform-pca Relationship between SVD and PCA]. | ||

+ | <br><b>(</b><i>Standard deviation</i> squared equals variance.<b>)</b> | ||

+ | <br>Sign of principal component vector is not unique. |

## Current revision

from *SVD meets PCA*
slide [17:46] by Cleve Moler.

“*The Wikipedia pages on SVD and PCA are quite good and contain a number of useful links, although not to each other.*”

MATLAB News & Notes, Cleve’s Corner, 2006

%relationship of pca to svd m=3; n=7; A = randn(m,n); [coef,score,latent] = pca(A) X = A - mean(A); [U,S,V] = svd(X,'econ'); % S vs. latent rho = rank(X); latent = diag(S(:,1:rho)).^2/(m-1) % U vs. score sense = sign(score).*sign(U*S(:,1:rho)); %account for negated left singular vector score = U*S(:,1:rho).*sense % V vs. coef sense2 = sign(coef).*sign(V(:,1:rho)); %account for corresponding negated right singular vector coef = V(:,1:rho).*sense2

*coef, score, latent* definitions from
Matlab pca()
command.

Terminology like *variance* of principal components (PCs) can be found here:
Relationship between SVD and PCA.
**(***Standard deviation* squared equals variance.**)**

Sign of principal component vector is not unique.