Principal component analysis: Difference between revisions

Content deleted Content added
A relevant reference was added to the page.
m removed typo
 
(192 intermediate revisions by 89 users not shown)
Line 1:
{{Short description|Method of data analysis}}
[[File:GaussianScatterPCA.svg|300px|thumb|rightupright=1.3|PCA of a [[multivariate Gaussian distribution]] centered at (1, 3) with a standard deviation of 3 in roughly the (0.866, 0.5) direction and of 1 in the orthogonal direction. The vectors shown are the [[Eigenvalues and eigenvectors|eigenvectors]] of the [[covariance matrix]] scaled by the square root of the corresponding eigenvalue, and shifted so their tails are at the mean.]]
{{Machine learning bar}}
'''Principal component analysis''' ('''PCA''') is a [[Linear map|linear]] [[dimensionality reduction]] technique with applications in [[exploratory data analysis]], visualization and [[data preprocessing]].
 
The data is [[linear map|linearly transformed]] onto a new [[coordinate system]] such that the directions (principal components) capturing the largest variation in the data can be easily identified.
The '''principal components''' of a collection of points in a [[real coordinate space]] are a sequence of <math>p</math> [[unit vector]]s, where the <math>i</math>-th vector is the direction of a line that best fits the data while being [[orthogonal]] to the first <math>i-1</math> vectors. Here, a best-fitting line is defined as one that minimizes the average squared [[Distance from a point to a line|distance from the points to the line]]. These directions constitute an [[orthonormal basis]] in which different individual dimensions of the data are [[Linear correlation|linearly uncorrelated]]. '''Principal component analysis''' ('''PCA''') is the process of computing the principal components and using them to perform a [[change of basis]] on the data, sometimes using only the first few principal components and ignoring the rest.
 
The '''principal components''' of a collection of points in a [[real coordinate space]] are a sequence of <math>p</math> [[unit vector]]s, where the <math>i</math>-th vector is the direction of a line that best fits the data while being [[orthogonal]] to the first <math>i-1</math> vectors. Here, a best-fitting line is defined as one that minimizes the average squared [[perpendicular distance|perpendicular]] [[Distance from a point to a line|distance from the points to the line]]. These directions (i.e., principal components) constitute an [[orthonormal basis]] in which different individual dimensions of the data are [[Linear correlation|linearly uncorrelated]]. Many studies use the first two principal components in order to plot the data in two dimensions and to visually identify clusters of closely related data points.<ref>{{cite journal |last1=Gewers |first1=Felipe L. |last2=Ferreira |first2=Gustavo R. |last3=Arruda |first3=Henrique F. De |last4=Silva |first4=Filipi N. |last5=Comin |first5=Cesar H. |last6=Amancio |first6=Diego R. |last7=Costa |first7=Luciano Da F. |title=Principal Component Analysis: A Natural Approach to Data Exploration |journal=ACM Comput. Surv. |date=24 May 2021 |volume=54 |issue=4 |pages=70:1–70:34 |doi=10.1145/3447755 |url=https://dl.acm.org/doi/abs/10.1145/3447755|arxiv=1804.02502 }}</ref>
In data analysis, the first principal component of a set of <math>p</math> variables, presumed to be jointly normally distributed, is the derived variable formed as a linear combination of the original variables that explains the most variance. The second principal component explains the most variance in what is left once the effect of the first component is removed, and we may proceed through <math>p</math> iterations until all the variance is explained. PCA is most commonly used when many of the variables are highly correlated with each other and it is desirable to reduce their number to an independent set.
 
Principal component analysis has applications in many fields such as [[population genetics]], [[microbiome]] studies, and [[atmospheric science]].<ref>{{Cite journal |last1=Jolliffe |first1=Ian T. |last2=Cadima |first2=Jorge |date=2016-04-13 |title=Principal component analysis: a review and recent developments |journal=Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences |volume=374 |issue=2065 |pages=20150202 |bibcode=2016RSPTA.37450202J |doi=10.1098/rsta.2015.0202 |pmc=4792409 |pmid=26953178}}</ref>
PCA is used in [[exploratory data analysis]] and for making [[predictive modeling|predictive models]]. It is commonly used for [[dimensionality reduction]] by projecting each data point onto only the first few principal components to obtain lower-dimensional data while preserving as much of the data's variation as possible. The first principal component can equivalently be defined as a direction that maximizes the variance of the projected data. The <math>i</math>-th principal component can be taken as a direction orthogonal to the first <math>i-1</math> principal components that maximizes the variance of the projected data.
 
== Overview ==
For either objective, it can be shown that the principal components are [[eigenvectors]] of the data's [[covariance matrix]]. Thus, the principal components are often computed by eigendecomposition of the data covariance matrix or [[singular value decomposition]] of the data matrix. PCA is the simplest of the true eigenvector-based multivariate analyses and is closely related to [[factor analysis]]. Factor analysis typically incorporates more ___domain specific assumptions about the underlying structure and solves eigenvectors of a slightly different matrix. PCA is also related to [[Canonical correlation|canonical correlation analysis (CCA)]]. CCA defines coordinate systems that optimally describe the [[cross-covariance]] between two datasets while PCA defines a new [[orthogonal coordinate system]] that optimally describes variance in a single dataset.<ref>{{Cite journal|author1=Barnett, T. P. |author2=R. Preisendorfer. |name-list-style=amp |title=Origins and levels of monthly and seasonal forecast skill for United States surface air temperatures determined by canonical correlation analysis |journal=Monthly Weather Review |volume=115 |issue=9 |pages=1825 |year=1987 |doi=10.1175/1520-0493(1987)115<1825:oaloma>2.0.co;2|bibcode=1987MWRv..115.1825B|doi-access=free }}</ref><ref>{{Cite book |last1=Hsu|first1=Daniel |first2=Sham M.|last2=Kakade |first3=Tong|last3=Zhang |title=A spectral algorithm for learning hidden markov models |arxiv=0811.4413 |year=2008 |bibcode=2008arXiv0811.4413H}}</ref><ref name="mark2017">{{cite journal|last1=Markopoulos|first1=Panos P.|last2=Kundu|first2=Sandipan|last3=Chamadia|first3=Shubham |last4=Pados|first4=Dimitris A.|title=Efficient L1-Norm Principal-Component Analysis via Bit Flipping|journal=IEEE Transactions on Signal Processing|date=15 August 2017|volume=65|issue=16|pages=4252–4264|doi=10.1109/TSP.2017.2708023|arxiv=1610.01959|bibcode=2017ITSP...65.4252M|s2cid=7931130}}</ref><ref name="l1tucker">{{cite journal|last1=Chachlakis|first1=Dimitris G.|last2=Prater-Bennette|first2=Ashley|last3=Markopoulos|first3=Panos P.|title=L1-norm Tucker Tensor Decomposition|journal=IEEE Access|date=22 November 2019|volume=7|pages=178454–178465|doi=10.1109/ACCESS.2019.2955134|arxiv=1904.06455|doi-access=free}}</ref> [[Robust statistics|Robust]] and [[Lp space|L1-norm]]-based variants of standard PCA have also been proposed.<ref name="mark2014">{{cite journal|last1=Markopoulos|first1=Panos P.|last2=Karystinos|first2=George N.|last3=Pados|first3=Dimitris A.|title=Optimal Algorithms for L1-subspace Signal Processing|journal=IEEE Transactions on Signal Processing|date=October 2014|volume=62|issue=19|pages=5046–5058|doi=10.1109/TSP.2014.2338077|arxiv=1405.6785|bibcode=2014ITSP...62.5046M|s2cid=1494171}}</ref><ref>{{cite journal |last1=Zhan |first1=J. |last2=Vaswani |first2=N. |date=2015 |title=Robust PCA With Partial Subspace Knowledge |url=https://doi.org/10.1109/tsp.2015.2421485 |journal=IEEE Transactions on Signal Processing |volume=63 |pages=3332-3347 | doi=10.1109/tsp.2015.2421485}}</ref><ref>{{cite book|last1=Kanade|first1=T.|last2=Ke|first2=Qifa |title=Robust L1 Norm Factorization in the Presence of Outliers and Missing Data by Alternative Convex Programming|journal=2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'05)|volume=1|pages=739|date=June 2005|doi=10.1109/CVPR.2005.309|publisher=IEEE|isbn=978-0-7695-2372-9|citeseerx=10.1.1.63.4605|s2cid=17144854}}</ref><ref name="l1tucker" />
When performing PCA, the first principal component of a set of <math>p</math> variables is the derived variable formed as a linear combination of the original variables that explains the most variance. The second principal component explains the most variance in what is left once the effect of the first component is removed, and we may proceed through <math>p</math> iterations until all the variance is explained. PCA is most commonly used when many of the variables are highly correlated with each other and it is desirable to reduce their number to an [[linear independence|independent set]].
The first principal component can equivalently be defined as a direction that maximizes the variance of the projected data. The <math>i</math>-th principal component can be taken as a direction orthogonal to the first <math>i-1</math> principal components that maximizes the variance of the projected data.
 
For either objective, it can be shown that the principal components are [[eigenvectors]] of the data's [[covariance matrix]]. Thus, the principal components are often computed by [[Eigendecomposition of a matrix|eigendecomposition]] of the data covariance matrix or [[singular value decomposition]] of the data matrix. PCA is the simplest of the true eigenvector-based multivariate analyses and is closely related to [[factor analysis]]. Factor analysis typically incorporates more ___domain-specific assumptions about the underlying structure and solves eigenvectors of a slightly different matrix. PCA is also related to [[Canonical correlation|canonical correlation analysis (CCA)]]. CCA defines coordinate systems that optimally describe the [[cross-covariance]] between two datasets while PCA defines a new [[orthogonal coordinate system]] that optimally describes variance in a single dataset.<ref>{{Cite journal|author1=Barnett, T. P. |author2=R. Preisendorfer. |name-list-style=amp |title=Origins and levels of monthly and seasonal forecast skill for United States surface air temperatures determined by canonical correlation analysis |journal=Monthly Weather Review |volume=115 |issue=9 |pages=1825 |year=1987 |doi=10.1175/1520-0493(1987)115<1825:oaloma>2.0.co;2|bibcode=1987MWRv..115.1825B|doi-access=free }}</ref><ref>{{Cite book |last1=Hsu|first1=Daniel |first2=Sham M.|last2=Kakade |first3=Tong|last3=Zhang |title=A spectral algorithm for learning hidden markov models |arxiv=0811.4413 |year=2008 |bibcode=2008arXiv0811.4413H}}</ref><ref name="mark2017">{{cite journal|last1=Markopoulos|first1=Panos P.|last2=Kundu|first2=Sandipan|last3=Chamadia|first3=Shubham |last4=Pados|first4=Dimitris A.|title=Efficient L1-Norm Principal-Component Analysis via Bit Flipping|journal=IEEE Transactions on Signal Processing|date=15 August 2017|volume=65|issue=16|pages=4252–4264|doi=10.1109/TSP.2017.2708023|arxiv=1610.01959|bibcode=2017ITSP...65.4252M|s2cid=7931130}}</ref><ref name="l1tucker">{{cite journal|last1=Chachlakis|first1=Dimitris G.|last2=Prater-Bennette|first2=Ashley|last3=Markopoulos|first3=Panos P.|title=L1-norm Tucker Tensor Decomposition|journal=IEEE Access|date=22 November 2019|volume=7|pages=178454–178465|doi=10.1109/ACCESS.2019.2955134|arxiv=1904.06455|doi-access=free|bibcode=2019IEEEA...7q8454C }}</ref> [[Robust principal component analysis|Robust]] and [[Lp space|L1-norm]]-based variants of standard PCA have also been proposed.<ref name="mark2014">{{cite journal|last1=Markopoulos|first1=Panos P.|last2=Karystinos|first2=George N.|last3=Pados|first3=Dimitris A.|title=Optimal Algorithms for L1-subspace Signal Processing|journal=IEEE Transactions on Signal Processing|date=October 2014|volume=62|issue=19|pages=5046–5058|doi=10.1109/TSP.2014.2338077|arxiv=1405.6785|bibcode=2014ITSP...62.5046M|s2cid=1494171}}</ref><ref>{{cite journal |last1=Zhan |first1=J. |last2=Vaswani |first2=N. |date=2015 |title=Robust PCA With Partial Subspace Knowledge |url=https://doi.org/10.1109/tsp.2015.2421485 |journal=IEEE Transactions on Signal Processing |volume=63 |issue=13 |pages=3332–3347 | doi=10.1109/tsp.2015.2421485|arxiv=1403.1591 |bibcode=2015ITSP...63.3332Z |s2cid=1516440 }}</ref><ref>{{cite book|last1=Kanade|first1=T.|last2=Ke|first2=Qifa |title=2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'05) |chapter=Robust L₁ Norm Factorization in the Presence of Outliers and Missing Data by Alternative Convex Programming |volume=1|pages=739–746|date=June 2005|doi=10.1109/CVPR.2005.309|publisher=IEEE|isbn=978-0-7695-2372-9|citeseerx=10.1.1.63.4605|s2cid=17144854}}</ref><ref name="l1tucker" />
 
== History ==
 
PCA was invented in 1901 by [[Karl Pearson]],<ref>{{Cite journal|author=Pearson, K. |author-link=Karl Pearson |year=1901 |title=On Lines and Planes of Closest Fit to Systems of Points in Space |journal=Philosophical Magazine |volume=2 |issue=11 |pages=559–572 |doi=10.1080/14786440109462720|s2cid=125037489 |url=https://zenodo.org/record/1430636 }}</ref> as an analogue of the [[principal axis theorem]] in mechanics; it was later independently developed and named by [[Harold Hotelling]] in the 1930s.<ref>Hotelling, H. (1933). Analysis of a complex of statistical variables into principal components. ''[[Journal of Educational Psychology]]'', '''24''', 417–441, and 498–520.<br> {{cite journal |last1=Hotelling |first1=H |year=1936 |title=Relations between two sets of variates |journal=[[Biometrika]] |volume=28 |issue=3/4|pages=321–377 |doi=10.2307/2333955|jstor=2333955}}</ref> Depending on the field of application, it is also named the discrete [[Karhunen–Loève theorem|Karhunen–Loève]] transform (KLT) in [[signal processing]], the [[Harold Hotelling|Hotelling]] transform in multivariate quality control, [[proper orthogonal decomposition]] (POD) in mechanical engineering, [[singular value decomposition]] (SVD) of '''X''' (invented in the last quarter of the 19th century<ref>
{{cite journal |last1=Stewart|first1=G. W. |year=1993 |title=On the early history of the singular value decomposition |journal=[[SIAM Review]] |volume=35 |issue=4|pages=551–566|doi=10.1137/1035134|url=http://purl.umn.edu/1868 |hdl=1903/566 |hdl-access=free }}</ref>), [[Eigendecomposition|eigenvalue decomposition]] (EVD) of '''X'''<sup>T</sup>'''X''' in linear algebra, [[factor analysis]] (for a discussion of the differences between PCA and factor analysis see Ch.&nbsp;7 of Jolliffe's ''Principal Component Analysis''),<ref name="Jolliffe2002">{{Cite book |last=Jolliffe |first=I. T. |url=http://link.springer.com/10.1007/b98835 |title=Principal Component Analysis |date=2002 |publisher=Springer-Verlag |isbn=978-0-387-95442-4 |series=Springer Series in Statistics |___location=New York |language=en |doi=10.1007/b98835}}</ref> [[Eckart–Young theorem]] (Harman, 1960), or [[empirical orthogonal functions]] (EOF) in meteorological science, empirical eigenfunction decomposition (SirovichLorenz, 19871956), empirical componenteigenfunction analysisdecomposition (LorenzSirovich, 19561987), quasiharmonic modes (Brooks et al., 1988), [[Spectral theorem|spectral decomposition]] in noise and vibration, and [[Mode shape|empirical modal analysis]] in structural dynamics.
 
== Intuition ==
[[File:SCREE_plot.jpg|thumb|A scree plot that is meant to help interpret the PCA and decide how many components to retain. The start of the bend in the line (point of inflexion or "knee") should indicate how many components are retained, hence in this example, three factors should be retained.]]
 
PCA can be thought of as fitting a ''p''-dimensional [[ellipsoid]] to the data, where each axis of the ellipsoid represents a principal component. If some axis of the ellipsoid is small, then the variance along that axis is also small.
 
To find the axes of the ellipsoid, we must first center the values of each variable in the dataset on 0 by subtracting the mean of the variable's observed values from each of those values. These transformed values are used instead of the original observed values for each of the variables. Then, we compute the [[covariance matrix]] of the data and calculate the eigenvalues and corresponding eigenvectors of this covariance matrix. Then we must [[Normalization (statistics)|normalize]] each of the orthogonal eigenvectors to turn them into unit vectors. Once this is done, each of the mutually-orthogonal unit eigenvectors can be interpreted as an axis of the ellipsoid fitted to the data. This choice of basis will transform the covariance matrix into a diagonalized form, in which the diagonal elements represent the variance of each axis. The proportion of the variance that each eigenvector represents can be calculated by dividing the eigenvalue corresponding to that eigenvector by the sum of all eigenvalues.
 
[[Biplot]]s and [[scree plot]]s (degree of [[explained variance]]) are used to explaininterpret findings of the PCA.
[[File:SCREE_plot.jpg|thumb|The above picture is of a scree plot that is meant to help interpret the PCA and decide how many components to retain. The start of the bend in the line (point of inflexion) should indicate how many components are retained, hence in this example, three factors should be retained.]]
 
== Details ==
PCA is defined as an [[orthogonal transformation|orthogonal]] [[linear transformation]] on a real [[inner product space]] that transforms the data to a new [[coordinate system]] such that the greatest variance by some scalar projection of the data comes to lie on the first coordinate (called the first principal component), the second greatest variance on the second coordinate, and so on.<ref name="Jolliffe2002"/>
 
Consider an <math>n \times p</math> data [[Matrix (mathematics)|matrix]], '''X''', with column-wise zero [[empirical mean]] (the sample mean of each column has been shifted to zero), where each of the ''n'' rows represents a different repetition of the experiment, and each of the ''p'' columns gives a particular kind of feature (say, the results from a particular sensor).
 
Mathematically, the transformation is defined by a set of size <math>l</math> of ''p''-dimensional vectors of weights or coefficients <math>\mathbf{w}_{(k)} = (w_1, \dots, w_p)_{(k)} </math> that map each row vector <math>\mathbf{x}_{(i)} = (x_1, \dots, x_p)_{(i)}</math> of '''X''' to a new vector of principal component ''scores'' <math>\mathbf{t}_{(i)} = (t_1, \dots, t_l)_{(i)}</math>, given by
 
:<math>{t_{k}}_{(i)} = \mathbf{x}_{(i)} \cdot \mathbf{w}_{(k)} \qquad \mathrm{for} \qquad i = 1,\dots,n \qquad k = 1,\dots,l </math>
in such a way that the individual variables <math>t_1, \dots, t_l</math> of '''t''' considered over the data set successively inherit the maximum possible variance from '''X''', with each coefficient vector '''w''' constrained to be a [[unit vector]] (where <math>l</math> is usually selected to be strictly less than <math>p</math> to reduce dimensionality).
 
The above may equivalently be written in matrix form as
:<math>\mathbf{T} = \mathbf{X} \mathbf{W}</math>
where
<math>{\mathbf{T}}_{ik} = {t_{k}}_{(i)}</math>,
<math>{\mathbf{X}}_{ij} = {x_{j}}_{(i)}</math>, and
<math>{\mathbf{W}}_{jk} = {w_{j}}_{(k)}</math>.
 
=== First component ===
Line 97 ⟶ 111:
 
=== Dimensionality reduction ===
The transformation '''TP''' = '''X''' '''W''' maps a data vector '''x'''<sub>(''i'')</sub> from an original space of ''px'' variables to a new space of ''p'' variables which are uncorrelated over the dataset. However, not all the principal components need to be kept. Keeping only the first ''L'' principal components, produced by using only the first ''L'' eigenvectors, gives the truncated transformation
To non-dimensionalize the centered data, let ''X<sub>c</sub>'' represent the characteristic values of data vectors ''X<sub>i</sub>'', given by:
 
:* <math>\mathbf{T}_L = |X\mathbf|_{X} \mathbf{Winfty}_L</math> (maximum norm),
* <math>\frac{1}{n} \|X\|_1</math> (mean absolute value), or
 
* <math>\frac{1}{\sqrt{n}} \|X\|_2</math> (normalized Euclidean norm),
where the matrix '''T'''<sub>L</sub> now has ''n'' rows but only ''L'' columns. In other words, PCA learns a linear transformation <math> t = W_L^\mathsf{T} x, x \in \mathbb{R}^p, t \in \mathbb{R}^L,</math> where the columns of {{math|''p'' × ''L''}} matrix <math>W_L</math> form an orthogonal basis for the ''L'' features (the components of representation ''t'') that are decorrelated.<ref>{{Cite journal |author=Bengio, Y.|year=2013|title=Representation Learning: A Review and New Perspectives |journal=IEEE Transactions on Pattern Analysis and Machine Intelligence |volume=35 |issue=8 |pages=1798–1828 |doi=10.1109/TPAMI.2013.50|pmid=23787338|display-authors=etal|arxiv=1206.5538|s2cid=393948}}</ref> By construction, of all the transformed data matrices with only ''L'' columns, this score matrix maximises the variance in the original data that has been preserved, while minimising the total squared reconstruction error <math>\|\mathbf{T}\mathbf{W}^T - \mathbf{T}_L\mathbf{W}^T_L\|_2^2</math> or <math>\|\mathbf{X} - \mathbf{X}_L\|_2^2</math>.
for a dataset of size ''n''. These norms are used to transform the original space of variables ''x, y'' to a new space of uncorrelated variables ''p, q'' (given ''Y<sub>c</sub>'' with same meaning), such that <math>p_i = \frac{X_i}{X_c}, \quad q_i = \frac{Y_i}{Y_c}</math>;
and the new variables are linearly related as: <math>q = \alpha p</math>.
To find the optimal linear relationship, we minimize the total squared reconstruction error:
<math>E(\alpha) = \frac{1}{1 - \alpha^2} \sum_{i=1}^{n} (\alpha p_i - q_i)^2</math>; such that setting the derivative of the error function to zero <math>(E'(\alpha) = 0)</math> yields:<math>\alpha = \frac{1}{2} \left( -\lambda \pm \sqrt{\lambda^2 + 4} \right)</math> where<math>\lambda = \frac{p \cdot p - q \cdot q}{p \cdot q}</math>.<ref name="Holmes2023" />
 
[[File:PCA of Haplogroup J using 37 STRs.png|thumb|right|A principal components analysis scatterplot of [[Y-STR]] [[haplotype]]s calculated from repeat-count values for 37 Y-chromosomal STR markers from 354 individuals.<br /> PCA has successfully found linear combinations of the markers that separate out different clusters corresponding to different lines of individuals' Y-chromosomal genetic descent.]]
Line 108 ⟶ 126:
Similarly, in [[regression analysis]], the larger the number of [[explanatory variable]]s allowed, the greater is the chance of [[overfitting]] the model, producing conclusions that fail to generalise to other datasets. One approach, especially when there are strong correlations between different possible explanatory variables, is to reduce them to a few principal components and then run the regression against them, a method called [[principal component regression]].
 
Dimensionality reduction may also be appropriate when the variables in a dataset are noisy. If each column of the dataset contains independent identically distributed Gaussian noise, then the columns of '''T''' will also contain similarly identically distributed Gaussian noise (such a distribution is invariant under the effects of the matrix '''W''', which can be thought of as a high-dimensional rotation of the co-ordinate axes). However, with more of the total variance concentrated in the first few principal components compared to the same noise variance, the proportionate effect of the noise is less—the first few components achieve a higher [[signal-to-noise ratio]]. PCA thus can have the effect of concentrating much of the signal into the first few principal components, which can usefully be captured by dimensionality reduction; while the later principal components may be dominated by noise, and so disposed of without great loss. If the dataset is not too large, the significance of the principal components can be tested using [[Bootstrapping (statistics)#Parametric bootstrap|parametric bootstrap]], as an aid in determining how many principal components to retain.<ref>{{Cite journal|author=Forkman J., Josse, J., Piepho, H. P. |year=2019 |title= Hypothesis tests for principal component analysis when variables are standardized |journal= Journal of Agricultural, Biological, and Environmental Statistics|volume=24 |issue=2 |pages= 289–308 |doi=10.1007/s13253-019-00355-5|doi-access=free |bibcode=2019JABES..24..289F }}</ref>
 
=== Singular value decomposition ===
Line 114 ⟶ 132:
The principal components transformation can also be associated with another matrix factorization, the [[singular value decomposition]] (SVD) of '''X''',
:<math>\mathbf{X} = \mathbf{U}\mathbf{\Sigma}\mathbf{W}^T</math>
Here '''Σ''' is an ''n''-by-''p'' [[Diagonal matrix|rectangular diagonal matrix]] of positive numbers ''σ''<sub>(''k'')</sub>, called the singular values of '''X'''; '''U''' is an ''n''-by-''n'' matrix, the columns of which are orthogonal unit vectors of length ''n'' called the left singular vectors of '''X'''; and '''W''' is a ''p''-by-''p'' matrix whose columns are orthogonal unit vectors of length ''p'' and called the right singular vectors of '''X'''.
 
In terms of this factorization, the matrix '''X'''<sup>T</sup>'''X''' can be written
Line 135 ⟶ 153:
so each column of '''T''' is given by one of the left singular vectors of '''X''' multiplied by the corresponding singular value. This form is also the [[polar decomposition]] of '''T'''.
 
Efficient algorithms exist to calculate the SVD of '''X''' without having to form the matrix '''X'''<sup>T</sup>'''X''', so computing the SVD is now the standard way to calculate a principal components analysis from a data matrix,<ref>{{citationCite book needed|reasonlast1=ABoyd reference|first1=Stephen to|url=http://dx.doi.org/10.1017/cbo9780511804441 SVD|title=Convex algorithmsOptimization that|last2=Vandenberghe outperform|first2=Lieven eigendecomposition|date=2004-03-08 of|publisher=Cambridge theUniversity covariancePress matrix is needed, particularly in cases where n is greater than p|datedoi=August10.1017/cbo9780511804441 2014|isbn=978-0-521-83378-3}},</ref> unless only a handful of components are required.
 
As with the eigen-decomposition, a truncated {{math|''n'' × ''L''}} score matrix '''T'''<sub>L</sub> can be obtained by considering only the first L largest singular values and their singular vectors:
:<math>\mathbf{T}_L = \mathbf{U}_L\mathbf{\Sigma}_L = \mathbf{X} \mathbf{W}_L </math>
The truncation of a matrix '''M''' or '''T''' using a truncated singular value decomposition in this way produces a truncated matrix that is the nearest possible matrix of [[Rank (linear algebra)|rank]] ''L'' to the original matrix, in the sense of the difference between the two having the smallest possible [[Frobenius norm]], a result known as the [[Low-rank approximation#Proof of Eckart–Young–Mirsky theorem (for Frobenius norm)|Eckart–Young theorem]] [1936].
 
<blockquote>
'''Theorem (Optimal k‑dimensional fit).'''
Let P be an n×m data matrix whose columns have been mean‑centered and scaled, and let
<math>P = U \,\Sigma\, V^{T}</math>
be its singular value decomposition. Then the best rank‑k approximation to P in the least‑squares (Frobenius‑norm) sense is
<math>P_{k} = U_{k}\,\Sigma_{k}\,V_{k}^{T}</math>,
where V<sub>k</sub> consists of the first k columns of V. Moreover, the relative residual variance is
<math>R(k)=\frac{\sum_{j=k+1}^{m}\sigma_{j}^{2}}{\sum_{j=1}^{m}\sigma_{j}^{2}}</math>.
</blockquote><ref name="Holmes2023" />
 
== Further considerations ==
Line 145 ⟶ 173:
The singular values (in '''Σ''') are the square roots of the [[eigenvalue]]s of the matrix '''X'''<sup>T</sup>'''X'''. Each eigenvalue is proportional to the portion of the "variance" (more correctly of the sum of the squared distances of the points from their multidimensional mean) that is associated with each eigenvector. The sum of all the eigenvalues is equal to the sum of the squared distances of the points from their multidimensional mean. PCA essentially rotates the set of points around their mean in order to align with the principal components. This moves as much of the variance as possible (using an orthogonal transformation) into the first few dimensions. The values in the remaining dimensions, therefore, tend to be small and may be dropped with minimal loss of information (see [[Principle Component Analysis#PCA and information theory|below]]). PCA is often used in this manner for [[dimensionality reduction]]. PCA has the distinction of being the optimal orthogonal transformation for keeping the subspace that has largest "variance" (as defined above). This advantage, however, comes at the price of greater computational requirements if compared, for example, and when applicable, to the [[discrete cosine transform]], and in particular to the DCT-II which is simply known as the "DCT". [[Nonlinear dimensionality reduction]] techniques tend to be more computationally demanding than PCA.
 
PCA is sensitive to the scaling of the variables. Mathematically this sensitivity comes from the way a rescaling changes the sample‑covariance matrix that PCA diagonalises.<ref name="Holmes2023">
PCA is sensitive to the scaling of the variables. If we have just two variables and they have the same [[sample variance]] and are completely correlated, then the PCA will entail a rotation by 45° and the "weights" (they are the cosines of rotation) for the two variables with respect to the principal component will be equal. But if we multiply all values of the first variable by 100, then the first principal component will be almost the same as that variable, with a small contribution from the other variable, whereas the second component will be almost aligned with the second original variable. This means that whenever the different variables have different units (like temperature and mass), PCA is a somewhat arbitrary method of analysis. (Different results would be obtained if one used Fahrenheit rather than Celsius for example.) Pearson's original paper was entitled "On Lines and Planes of Closest Fit to Systems of Points in Space" – "in space" implies physical Euclidean space where such concerns do not arise. One way of making the PCA less arbitrary is to use variables scaled so as to have unit variance, by standardizing the data and hence use the autocorrelation matrix instead of the autocovariance matrix as a basis for PCA. However, this compresses (or expands) the fluctuations in all dimensions of the signal space to unit variance.
{{cite book
|last=Holmes
|first=Mark H.
|title=Introduction to Scientific Computing and Data Analysis
|series=Texts in Computational Science and Engineering
|edition=2nd
|year=2023
|publisher=Springer
|isbn=978-3-031-22429-4
|pages=475–490
}}
</ref>
 
Let <math>\mathbf X_\text{c}</math> be the *centered* data matrix (''n'' rows, ''p'' columns) and define the covariance
<math>\Sigma = \frac{1}{n}\,\mathbf X_\text{c}^{\mathsf T}\mathbf X_\text{c}.</math>
If the <math>j</math>‑th variable is multiplied by a factor <math>\alpha_j</math> we obtain
<math>\mathbf X_\text{c}^{(\alpha)} = \mathbf X_\text{c}D,\qquad
D = \operatorname{diag}(\alpha_1,\ldots,\alpha_p).</math>
Hence the new covariance is
<math>\Sigma^{(\alpha)} = D^{\mathsf T}\,\Sigma\,D.</math>
 
Because the eigenvalues and eigenvectors of <math>\Sigma^{(\alpha)}</math> are those of <math>\Sigma</math> scaled by <math>D</math>, the principal axes rotate toward any column whose variance has been inflated, exactly as the 2‑D example below illustrates.
 
If we have just two variables and they have the same [[sample variance]] and are completely correlated, then the PCA will entail a rotation by 45° and the "weights" (they are the cosines of rotation) for the two variables with respect to the principal component will be equal. But if we multiply all values of the first variable by 100, then the first principal component will be almost the same as that variable, with a small contribution from the other variable, whereas the second component will be almost aligned with the second original variable. This means that whenever the different variables have different units (like temperature and mass), PCA is a somewhat arbitrary method of analysis. (Different results would be obtained if one used Fahrenheit rather than Celsius for example.) Pearson's original paper was entitled "On Lines and Planes of Closest Fit to Systems of Points in Space" – "in space" implies physical Euclidean space where such concerns do not arise. One way of making the PCA less arbitrary is to use variables scaled so as to have unit variance, by standardizing the data and hence use the autocorrelation matrix instead of the autocovariance matrix as a basis for PCA. However, this compresses (or expands) the fluctuations in all dimensions of the signal space to unit variance.
 
Classical PCA assumes the cloud of points has already been translated so its centroid is at the origin.<ref name="Holmes2023" />
 
Write each observation as
<math>\mathbf q_i = \boldsymbol\mu + \mathbf z_i,\qquad
\boldsymbol\mu = \tfrac{1}{n}\sum_{i=1}^{n}\mathbf q_i.</math>
 
Without subtracting <math>\boldsymbol\mu</math> we are in effect diagonalising
 
<math>\Sigma_{\text{unc}} \;=\; n\,\boldsymbol\mu\boldsymbol\mu^{\mathsf T}
\;+\;\tfrac{1}{n}\,\mathbf Z^{\mathsf T}\mathbf Z,</math>
 
where <math>\mathbf Z</math> is the centered matrix.
The rank‑one term <math>n\,\boldsymbol\mu\boldsymbol\mu^{\mathsf T}</math> often dominates, forcing the leading eigenvector to point almost exactly toward the mean and obliterating any structure in the centred part <math>\mathbf Z</math>.
After mean subtraction that term vanishes and the principal axes align with the true directions of maximal variance.
 
Mean subtraction (a.k.a. "mean centering") is necessary for performing classical PCA to ensure that the first principal component describes the direction of maximum variance. If mean subtraction is not performed, the first principal component might instead correspond more or less to the mean of the data. A mean of zero is needed for finding a basis that minimizes the [[Minimum mean square error|mean square error]] of the approximation of the data.<ref>A. A. Miranda, Y. A. Le Borgne, and G. Bontempi. [http://www.ulb.ac.be/di/map/yleborgn/pub/NPL_PCA_07.pdf New Routes from Minimal Approximation Error to Principal Components], Volume 27, Number 3 / June, 2008, Neural Processing Letters, Springer</ref>
 
Mean-centering is unnecessary if performing a principal components analysis on a correlation matrix, as the data are already centered after calculating correlations. Correlations are derived from the cross-product of two standard scores (Z-scores) or statistical moments (hence the name: ''Pearson Product-Moment Correlation''). Also see the article by Kromrey & Foster-Johnson (1998) on ''"Mean-centering in Moderated Regression: Much Ado About Nothing"''. Since [[Covariance matrix#Relation to the correlation matrix|covariances are correlations of normalized variables]] ([[Standard score#Calculation|Z- or standard-scores]]) a PCA based on the correlation matrix of '''X''' is [[Equality (mathematics)|equal]] to a PCA based on the covariance matrix of '''Z''', the standardized version of '''X'''.
 
PCA is a popular primary technique in [[pattern recognition]]. It is not, however, optimized for class separability.<ref>{{Cite book| last=Fukunaga|first=Keinosuke|author-link=Keinosuke Fukunaga | title = Introduction to Statistical Pattern Recognition |publisher=Elsevier | year = 1990 | url=https://dl.acm.org/doi/book/10.5555/92131| isbn=978-0-12-269851-4}}</ref> However, it has been used to quantify the distance between two or more classes by calculating center of mass for each class in principal component space and reporting Euclidean distance between center of mass of two or more classes.<ref>{{cite journal|last1=Alizadeh|first1=Elaheh|last2=Lyons|first2=Samanthe M|last3=Castle|first3=Jordan M|last4=Prasad|first4=Ashok|title=Measuring systematic changes in invasive cancer cell shape using Zernike moments|journal=Integrative Biology|date=2016|volume=8|issue=11|pages=1183–1193|doi=10.1039/C6IB00100A|pmid=27735002|url=https://pubs.rsc.org/en/Content/ArticleLanding/2016/IB/C6IB00100A|url-access=subscription}}</ref> The [[linear discriminant analysis]] is an alternative which is optimized for class separability.
 
== Table of symbols and abbreviations ==
Line 162 ⟶ 228:
! Indices
|-
| <math>\mathbf{X} = \{[ X_{ij} \}]</math>
| data matrix, consisting of the set of all data vectors, one vector per row
| <math> n \times p</math>
Line 182 ⟶ 248:
| ''scalar''
|-
| <math>\mathbf{u} = \{[ u_j \}]</math>
| vector of empirical [[mean]]s, one mean for each column ''j'' of the data matrix
| <math> p \times 1</math>
| <math> j = 1 \ldots p </math>
|-
| <math>\mathbf{s} = \{[ s_j \}]</math>
| vector of empirical [[standard deviation]]s, one standard deviation for each column ''j'' of the data matrix
| <math> p \times 1</math>
| <math> j = 1 \ldots p </math>
|-
| <math>\mathbf{h} = \{[ h_i \}]</math>
| vector of all 1's
| <math> 1 \times n</math>
| <math> i = 1 \ldots n </math>
|-
| <math>\mathbf{B} = \{[ B_{ij} \}]</math>
| [[Standard deviation|deviations]] from the mean of each column ''j'' of the data matrix
| <math> n \times p</math>
| <math> i = 1 \ldots n </math> <br /> <math> j = 1 \ldots p </math>
|-
| <math>\mathbf{Z} = \{[ Z_{ij} \}] </math>
| [[z-score]]s, computed using the mean and standard deviation for each rowcolumn ''mj'' of the data matrix
| <math> n \times p</math>
| <math> i = 1 \ldots n </math> <br /> <math> j = 1 \ldots p </math>
|-
| <math>\mathbf{C} = \{[ C_{jj'} \}] </math>
| [[covariance matrix]]
| <math> p \times p </math>
| <math> j = 1 \ldots p </math> <br /><math> j' = 1 \ldots p </math>
|-
| <math>\mathbf{R} = \{[ R_{jj'} \}] </math>
| [[correlation matrix]]
| <math> p \times p </math>
| <math> j = 1 \ldots p </math> <br /><math> j' = 1 \ldots p </math>
|-
| <math> \mathbf{V} = \{[ V_{jj'} \}] </math>
| matrix consisting of the set of all [[eigenvectors]] of '''C''', one eigenvector per column
| <math> p \times p </math>
| <math> j = 1 \ldots p </math> <br /><math> j' = 1 \ldots p </math>
|-
| <math>\mathbf{D} = \{[ D_{jj'} \}] </math>
| [[diagonal matrix]] consisting of the set of all [[eigenvalues]] of '''C''' along its [[principal diagonal]], and 0 for all other elements ( note <math>\mathbf{\Lambda}</math> used above )
| <math> p \times p </math>
| <math> j = 1 \ldots p </math> <br /><math> j' = 1 \ldots p </math>
|-
| <math>\mathbf{W} = \{[ W_{jl} \}] </math>
| matrix of basis vectors, one vector per column, where each basis vector is one of the eigenvectors of '''C''', and where the vectors in '''W''' are a sub-set of those in '''V'''
| <math> p \times L</math>
| <math> j = 1 \ldots p </math> <br /><math> l = 1 \ldots L</math>
|-
| <math>\mathbf{T} = \{[ T_{il} \}] </math>
| matrix consisting of ''n'' row vectors, where each vector is the projection of the corresponding data vector from matrix '''X''' onto the basis vectors contained in the columns of matrix '''W'''.
| <math> n \times L</math>
Line 238 ⟶ 304:
|}
 
 
== Properties and limitations of PCA ==
== Properties and limitations ==
 
=== Properties ===
Line 246 ⟶ 313:
:<big>'''''Property 1'':'''</big> For any integer ''q'', 1 ≤ ''q'' ≤ ''p'', consider the orthogonal [[linear transformation]]
::<math>y =\mathbf{B'}x</math>
:where <math>y</math> is a ''q-element'' vector and <math>\mathbf{B'}</math> is a (''q'' × ''p'') matrix, and let <math>\mathbf{{\Sigma}}_y = \mathbf{B'}\mathbf{\Sigma}\mathbf{B}</math> be the [[variance]]-[[covariance]] matrix for <math>y</math>. Then the trace of <math>\mathbf{\Sigma}_y</math>, denoted <math>\operatorname{tr} (\mathbf{\Sigma}_y)</math>, is maximized by taking <math>\mathbf{B} = \mathbf{A}_q</math>, where <math>\mathbf{A}_q</math> consists of the first ''q'' columns of <math>\mathbf{A}</math> <math>(\mathbf{B'}</math> is the transpose of <math>\mathbf{B})</math>. (<math>\mathbf{A}</math> is not defined here)
 
:<big>'''''Property 2'':'''</big> Consider again the [[orthonormal transformation]]
Line 267 ⟶ 334:
The applicability of PCA as described above is limited by certain (tacit) assumptions<ref>Jonathon Shlens, [https://arxiv.org/abs/1404.1100 A Tutorial on Principal Component Analysis.]</ref> made in its derivation. In particular, PCA can capture linear correlations between the features but fails when this assumption is violated (see Figure 6a in the reference). In some cases, coordinate transformations can restore the linearity assumption and PCA can then be applied (see [[Kernel principal component analysis|kernel PCA]]).
 
Another limitation is the mean-removal process before constructing the covariance matrix for PCA. In fields such as astronomy, all the signals are non-negative, and the mean-removal process will force the mean of some astrophysical exposures to be zero, which consequently creates unphysical negative fluxes,<ref name="soummer12"/> and forward modeling has to be performed to recover the true magnitude of the signals.<ref name="pueyo16">{{Cite journal|arxiv= 1604.06097 |last1= Pueyo|first1= Laurent |title= Detection and Characterization of Exoplanets using Projections on Karhunen Loeve Eigenimages: Forward Modeling |journal= The Astrophysical Journal |volume= 824|issue= 2|pages= 117|year= 2016|doi= 10.3847/0004-637X/824/2/117|bibcode = 2016ApJ...824..117P|s2cid= 118349503|doi-access= free}}</ref> As an alternative method, [[non-negative matrix factorization]] focusing only on the non-negative elements in the matrices, which is well-suited for astrophysical observations.<ref name="blantonRoweis07"/><ref name="zhu16"/><ref name="ren18"/> See more at [[#Non-negative matrix factorization|Relationthe relation between PCA and Nonnon-negative Matrixmatrix Factorizationfactorization]].
 
PCA is at a disadvantage if the data has not been standardized before applying the algorithm to it. PCA transforms the original data into data that is relevant to the principal components of that data, which means that the new data variables cannot be interpreted in the same ways that the originals were. They are linear interpretations of the original variables. Also, if PCA is not performed properly, there is a high likelihood of information loss.<ref>{{cite web | title=What are the Pros and cons of the PCA? | website=i2tutorials | date=September 1, 2019 | url=https://www.i2tutorials.com/what-are-the-pros-and-cons-of-the-pca/ | access-date=June 4, 2021}}</ref>
 
PCA relies on a linear model. If a dataset has a pattern hidden inside it that is nonlinear, then PCA can actually steer the analysis in the complete opposite direction of progress.<ref name=abbott>{{cite book | title=Applied Predictive Analytics | last=Abbott | first=Dean | isbn=9781118727966 | date=May 2014 | publisher=Wiley}}</ref>{{Page needed|date=June 2021}} Researchers at Kansas State University discovered that the sampling error in their experiments impacted the bias of PCA results. "If the number of subjects or blocks is smaller than 30, and/or the researcher is interested in PC's beyond the first, it may be better to first correct for the serial correlation, before PCA is conducted".<ref name=jiang /> The researchers at Kansas State also found that PCA could be "seriously biased if the autocorrelation structure of the data is not correctly handled".<ref name=jiang>{{cite journal| title=Bias in Principal Components Analysis Due to Correlated Observations| url=https://newprairiepress.org/agstatconference/2000/proceedings/13/ |last1=Jiang | first1=Hong| last2=Eskridge | first2=Kent M.| year=2000 | journal=Conference on Applied Statistics in Agriculture |issn=2475-7772| doi=10.4148/2475-7772.1247| doi-access=free}}</ref>
 
=== PCA and information theory ===
Line 290 ⟶ 357:
The optimality of PCA is also preserved if the noise <math>\mathbf{n}</math> is iid and at least more Gaussian (in terms of the [[Kullback–Leibler divergence]]) than the information-bearing signal <math>\mathbf{s}</math>.<ref>{{cite journal|last=Geiger|first=Bernhard|author2=Kubin, Gernot|title=Signal Enhancement as Minimization of Relevant Information Loss|journal=Proc. ITG Conf. On Systems, Communication and Coding|date=January 2013|arxiv=1205.6935|bibcode=2012arXiv1205.6935G}}</ref> In general, even if the above signal model holds, PCA loses its information-theoretic optimality as soon as the noise <math>\mathbf{n}</math> becomes dependent.
 
== Computing PCAComputation using the covariance method ==
 
The following is a detailed description of PCA using the covariance method (see<ref>See also the tutorial [http://www.cs.otago.ac.nz/cosc453/student_tutorials/principal_components.pdf here])</ref> as opposed to the correlation method.<ref>{{cite web|title=Engineering Statistics Handbook Section 6.5.5.2|url=http://www.itl.nist.gov/div898/handbook/pmc/section5/pmc552.htm|access-date=19 January 2015}}</ref>
 
The goal is to transform a given data set '''X''' of dimension ''p'' to an alternative data set '''Y''' of smaller dimension ''L''. Equivalently, we are seeking to find the matrix '''Y''', where '''Y''' is the [[Karhunen–Loève theorem|Karhunen–Loève]] transform (KLT) of matrix '''X''':
 
:<math display="block"> \mathbf{Y} = \mathbb{KLT} \{ \mathbf{X} \} </math>
<ol>
 
<li>
; Organize the data set
'''Organize the data set'''
 
{{pb}}
Suppose you have data comprising a set of observations of ''p'' variables, and you want to reduce the data so that each observation can be described with only ''L'' variables, ''L'' < ''p''. Suppose further, that the data are arranged as a set of ''n'' data vectors <math>\mathbf{x}_1 \ldots \mathbf{x}_n</math> with each <math>\mathbf{x}_i </math> representing a single grouped observation of the ''p'' variables.
* Write <math>\mathbf{x}_1 \ldots \mathbf{x}_n</math> as row vectors, each with ''p'' elements.
* Place the row vectors into a single matrix '''X''' of dimensions ''n'' × ''p''.
</li>
<li>
'''Calculate the empirical mean'''
 
; Calculate the empirical mean
* Find the empirical mean along each column ''j'' = 1,&nbsp;...,&nbsp;''p''.
* Place the calculated mean values into an empirical mean vector '''u''' of dimensions ''p'' × 1. <math display="block">u_j = \frac{1}{n} \sum_{i=1}^n X_{ij} </math>
</li>
*:<math>u_j = \frac{1}{n} \sum_{i=1}^n X_{ij} </math>
<li>
 
; '''Calculate the deviations from the mean'''
{{pb}}
Mean subtraction is an integral part of the solution towards finding a principal component basis that minimizes the mean square error of approximating the data.<ref>A.A. Miranda, Y.-A. Le Borgne, and G. Bontempi. [http://www.ulb.ac.be/di/map/yleborgn/pub/NPL_PCA_07.pdf New Routes from Minimal Approximation Error to Principal Components], Volume 27, Number 3 / June, 2008, Neural Processing Letters, Springer</ref> Hence we proceed by centering the data as follows:
* Subtract the empirical mean vector <math> \mathbf{u}^{T} </math> from each row of the data matrix '''X'''.
* Store mean-subtracted data in the ''n'' × ''p'' matrix '''B'''. <math display="block">\mathbf{B} = \mathbf{X} - \mathbf{h}\mathbf{u}^T </math> where '''h''' is an {{math|''n'' × 1}} column vector of all&nbsp;1s: <math display="block">h_i = 1 \, \qquad \qquad \text{for } i = 1, \ldots, n </math>
*:<math>\mathbf{B} = \mathbf{X} - \mathbf{h}\mathbf{u}^T </math>
*: where '''h''' is an {{math|''n'' × 1}} column vector of all&nbsp;1s:
*::<math>h_i = 1 \, \qquad \qquad \text{for } i = 1, \ldots, n </math>
 
In some applications, each variable (column of '''B''') may also be scaled to have a variance equal to 1 (see [[Z-score]]).<ref>{{Cite journal|author1=Abdi. H. |author2=Williams, L.J. |name-list-style=amp | author-link=AbdiWilliams | year = 2010 | title = Principal component analysis | journal = Wiley Interdisciplinary Reviews: Computational Statistics | volume = 2 | issue=4 | pages = 433–459 | doi = 10.1002/wics.101 |arxiv=1108.4372 |s2cid=122379222 }}</ref> This step affects the calculated principal components, but makes them independent of the units used to measure the different variables.
</li>
<li>
'''Find the covariance matrix'''
 
; Find the covariance matrix
* Find the ''p'' × ''p'' empirical [[covariance matrix]] '''C''' from matrix '''B''': <math display="block">\mathbf{C} = { 1 \over {n-1} } \mathbf{B}^{*} \mathbf{B}</math> where <math> *</math> is the [[conjugate transpose]] operator. If '''B''' consists entirely of real numbers, which is the case in many applications, the "conjugate transpose" is the same as the regular [[transpose]].
* The reasoning behind using {{math|''n'' − 1}} instead of ''n'' to calculate the covariance is [[Bessel's correction]].
</li>
<li>
'''Find the eigenvectors and eigenvalues of the covariance matrix'''
 
* Compute the matrix '''V''' of [[eigenvector]]s which [[diagonalizable matrix|diagonalizes]] the covariance matrix '''C''': <math display="block">\mathbf{V}^{-1} \mathbf{C} \mathbf{V} = \mathbf{D} </math> where '''D''' is the [[diagonal matrix]] of [[eigenvalue]]s of '''C'''. This step will typically involve the use of a computer-based algorithm for [[Eigendecomposition of a matrix|computing eigenvectors and eigenvalues]]. These algorithms are readily available as sub-components of most [[matrix algebra]] systems, such as [[SAS (software)|SAS]],<ref>{{Cite web | url=http://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_princomp_sect001.htm | title=SAS/STAT(R) 9.3 User's Guide}}</ref> [[R (programming language)|R]], [[MATLAB]],<ref>[http://www.mathworks.com/access/helpdesk/help/techdoc/ref/eig.html#998306 eig function] Matlab documentation</ref><ref>{{Cite web|url=https://www.mathworks.com/matlabcentral/fileexchange/24634-face-recognition-system-pca-based|title=Face Recognition System-PCA based|website=www.mathworks.com|date=19 June 2023 }}</ref> [[Mathematica]],<ref>[http://reference.wolfram.com/mathematica/ref/Eigenvalues.html Eigenvalues function] Mathematica documentation</ref> [[SciPy]], [[IDL (programming language)|IDL]] ([[Interactive Data Language]]), or [[GNU Octave]] as well as [[OpenCV]].
; Find the eigenvectors and eigenvalues of the covariance matrix
* Compute the matrix '''V''' of [[eigenvector]]s which [[diagonalizable matrix|diagonalizes]] the covariance matrix '''C''': <math display="block">\mathbf{V}^{-1} \mathbf{C} \mathbf{V} = \mathbf{D} </math> where '''D''' is the [[diagonal matrix]] of [[eigenvalue]]s of '''C'''. This step will typically involve the use of a computer-based algorithm for [[Eigendecomposition of a matrix|computing eigenvectors and eigenvalues]]. These algorithms are readily available as sub-components of most [[matrix algebra]] systems, such as [[SAS (software)|SAS]],<ref>{{Cite web | url=http://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_princomp_sect001.htm | title=SAS/STAT(R) 9.3 User's Guide}}</ref> [[R (programming language)|R]], [[MATLAB]],<ref>[http://www.mathworks.com/access/helpdesk/help/techdoc/ref/eig.html#998306 eig function] Matlab documentation</ref><ref>[http://www.mathworks.com/matlabcentral/fileexchange/24634 MATLAB PCA-based Face recognition software]</ref> [[Mathematica]],<ref>[http://reference.wolfram.com/mathematica/ref/Eigenvalues.html Eigenvalues function] Mathematica documentation</ref> [[SciPy]], [[IDL (programming language)|IDL]] ([[Interactive Data Language]]), or [[GNU Octave]] as well as [[OpenCV]].
* Matrix '''D''' will take the form of an ''p'' × ''p'' diagonal matrix, where <math display="block">D_{k\ell} = \lambda_k \qquad \text{for } k = \ell</math> is the ''j''th eigenvalue of the covariance matrix '''C''', and <math display="block">D_{k\ell} = 0 \qquad \text{for } k \ne \ell.</math>
* Matrix '''V''', also of dimension ''p'' × ''p'', contains ''p'' column vectors, each of length ''p'', which represent the ''p'' eigenvectors of the covariance matrix '''C'''.
* The eigenvalues and eigenvectors are ordered and paired. The ''j''th eigenvalue corresponds to the ''j''th eigenvector.
* Matrix '''V''' denotes the matrix of ''right'' eigenvectors (as opposed to ''left'' eigenvectors). In general, the matrix of right eigenvectors need ''not'' be the (conjugate) transpose of the matrix of left eigenvectors.
</li>
<li>
'''Rearrange the eigenvectors and eigenvalues'''
 
; Rearrange the eigenvectors and eigenvalues
* Sort the columns of the eigenvector matrix '''V''' and eigenvalue matrix '''D''' in order of ''decreasing'' eigenvalue.
* Make sure to maintain the correct pairings between the columns in each matrix.
</li>
<li>
'''Compute the cumulative energy content for each eigenvector'''
* The eigenvalues represent the distribution of the source data's energy{{Clarify|date=March 2011}} among each of the eigenvectors, where the eigenvectors form a [[basis (linear algebra)|basis]] for the data. The cumulative energy content ''g'' for the ''j''th eigenvector is the sum of the energy content across all of the eigenvalues from 1 through ''j'' divided by the sum of energy content across all eigenvalues (shown in step 8):{{Citation needed|date=March 2011}} <math display="block">g_j = \sum_{k=1}^j D_{kk} \qquad \text{for } j = 1,\dots,p </math>
</li>
<li>
'''Select a subset of the eigenvectors as basis vectors'''
 
; Compute the cumulative energy content for each eigenvector
* The eigenvalues represent the distribution of the source data's energy{{Clarify|date=March 2011}} among each of the eigenvectors, where the eigenvectors form a [[basis (linear algebra)|basis]] for the data. The cumulative energy content ''g'' for the ''j''th eigenvector is the sum of the energy content across all of the eigenvalues from 1 through ''j'':
*:<math>g_j = \sum_{k=1}^j D_{kk} \qquad \text{for } j = 1,\dots,p </math>{{Citation needed|date=March 2011}}
 
; Select a subset of the eigenvectors as basis vectors
* Save the first ''L'' columns of '''V''' as the ''p'' × ''L'' matrix '''W''': <math display="block"> W_{kl} = V_{k\ell} \qquad \text{for } k = 1,\dots,p \qquad \ell = 1,\dots,L </math> where <math display="block">1 \leq L \leq p.</math>
* Use the vector '''g''' as a guide in choosing an appropriate value for ''L''. The goal is to choose a value of ''L'' as small as possible while achieving a reasonably high value of ''g'' on a percentage basis. For example, you may want to choose ''L'' so that the cumulative energy ''g'' is above a certain threshold, like 90 percent. In this case, choose the smallest value of ''L'' such that <math display="block"> \frac{g_L}{g_p} \ge 0.9 </math>
</li>
<li>
'''Project the data onto the new basis'''
 
; Project the data onto the new basis
* The projected data points are the rows of the matrix <math display="block"> \mathbf{T} = \mathbf{B} \cdot \mathbf{W}</math>
That is, the first column of <math>\mathbf{T}</math> is the projection of the data points onto the first principal component, the second column is the projection onto the second principal component, etc.
</li>
</ol>
 
== Derivation of PCA using the covariance method ==
 
Let '''X''' be a ''d''-dimensional random vector expressed as column vector. Without loss of generality, assume '''X''' has zero mean.
Line 403 ⟶ 483:
| year = 1986
| doi = 10.1016/0003-2670(86)80028-9
| bibcode = 1986AcAC..185....1G
}}</ref>
}}</ref>
For large data matrices, or matrices that have a high degree of column collinearity, NIPALS suffers from loss of orthogonality of PCs due to machine precision [[round-off errors]] accumulated in each iteration and matrix deflation by subtraction.<ref>{{cite book |last=Kramer |first=R. |year=1998 |title=Chemometric Techniques for Quantitative Analysis |publisher=CRC Press |___location=New York |isbn= 9780203909805|url=https://books.google.com/books?id=iBpOzwAOfHYC}}</ref> A [[Gram–Schmidt]] re-orthogonalization algorithm is applied to both the scores and the loadings at each iteration step to eliminate this loss of orthogonality.<ref>{{cite journal |first=M. |last=Andrecut |title=Parallel GPU Implementation of Iterative PCA Algorithms |journal=Journal of Computational Biology |volume=16 |issue=11 |year=2009 |pages=1593–1599 |doi=10.1089/cmb.2008.0221 |pmid=19772385 |arxiv=0811.1081 |s2cid=1362603 }}</ref> NIPALS reliance on single-vector multiplications cannot take advantage of high-level [[BLAS]] and results in slow convergence for clustered leading singular values—both these deficiencies are resolved in more sophisticated matrix-free block solvers, such as the Locally Optimal Block Preconditioned Conjugate Gradient ([[LOBPCG]]) method.
 
Line 419 ⟶ 500:
| url = http://www.jmlr.org/papers/volume9/warmuth08a/warmuth08a.pdf}}</ref>
 
== PCA and qualitativeQualitative variables ==
In PCA, it is common that we want to introduce qualitative variables as supplementary elements. For example, many quantitative variables have been measured on plants. For these plants, some qualitative variables are available as, for example, the species to which the plant belongs. These data were subjected to PCA for quantitative variables. When analyzing the results, it is natural to connect the principal components to the qualitative variable ''species''.
For this, the following results are produced.
Line 426 ⟶ 507:
* For each center of gravity and each axis, p-value to judge the significance of the difference between the center of gravity and origin.
 
These results are what is called ''introducing a qualitative variable as supplementary element''. This procedure is detailed in and Husson, Lê, & Pagès (2009) and Pagès (2013).
Few software offer this option in an "automatic" way. This is the case of [http://www.coheris.com/produits/analytics/logiciel-data-mining/ SPAD] that historically, following the work of [[Ludovic Lebart]], was the first to propose this option, and the R package [http://factominer.free.fr/ FactoMineR].
 
Line 432 ⟶ 513:
 
=== Intelligence ===
The earliest application of factor analysis was in locating and measuring components of human intelligence. itIt was believed that intelligence had various uncorrelated components such as spatial intelligence, verbal intelligence, induction, deduction etc and that scores on these could be adduced by factor analysis from results on various tests, to give a single index known as the [[Intelligence quotient|Intelligence Quotient]] (IQ). The pioneering statistical psychologist [[Charles Spearman|Spearman]] actually developed factor analysis in 1904 for his [[Two-factor theory of intelligence|two-factor theory]] of intelligence, adding a formal technique to the science of [[psychometrics]]. In 1924 [[Louis Leon Thurstone|Thurstone]] looked for 56 factors of intelligence, developing the notion of Mental Age. Standard IQ tests today are based on this early work.<ref name="Kaplan, R.M. 2010">Kaplan, R.M., & Saccuzzo, D.P. (2010). ''Psychological Testing: Principles, Applications, and Issues.'' (8th ed.). Belmont, CA: Wadsworth, Cengage Learning.</ref>
 
=== Residential differentiation ===
In 1949, Shevky and Williams introduced the theory of '''factorial ecology''', which dominated studies of residential differentiation from the 1950s to the 1970s.<ref>{{Cite book |last1=Shevky |first1=Eshref |title=The Social Areas of Los Angeles: Analysis and Typology |last2=Williams |first2=Marilyn |publisher=University of California Press |year=1949}}</ref> Neighbourhoods in a city were recognizable or could be distinguished from one another by various characteristics which could be reduced to three by factor analysis. These were known as 'social rank' (an index of occupational status), 'familism' or family size, and 'ethnicity'; Cluster analysis could then be applied to divide the city into clusters or precincts according to values of the three key factor variables. An extensive literature developed around factorial ecology in urban geography, but the approach went out of fashion after 1980 as being methodologically primitive and having little place in postmodern geographical paradigms.
 
One of the problems with factor analysis has always been finding convincing names for the various artificial factors. In 2000, Flood revived the factorial ecology approach to show that principal components analysis actually gave meaningful answers directly, without resorting to factor rotation. The principal components were actually dual variables or shadow prices of 'forces' pushing people together or apart in cities. The first component was 'accessibility', the classic trade-off between demand for travel and demand for space, around which classical urban economics is based. The next two components were 'disadvantage', which keeps people of similar status in separate neighbourhoods (mediated by planning), and ethnicity, where people of similar ethnic backgrounds try to co-locate.<ref>Flood, J (2000). Sydney divided: factorial ecology revisited. Paper to the APA Conference 2000, Melbourne, November and to the 24th ANZRSAI Conference, Hobart, December 2000.[https://www.academia.edu/5135339/Sydney_Divided_Factorial_Ecology_Revisited]</ref>
 
About the same time, the Australian Bureau of Statistics defined distinct indexes of advantage and disadvantage taking the first principal component of sets of key variables that were thought to be important. These SEIFA indexes are regularly published for various jurisdictions, and are used frequently in spatial analysis.<ref>{{Cite web |last= |first= |date=2011 |title=Socio-Economic Indexes for Areas |url=https://www.abs.gov.au/websitedbs/censushome.nsf/home/seifa |access-date=2022-05-05 |website=Australian Bureau of Statistics |language=en}}</ref>
 
=== Development indexes ===
PCA can be used as a formal method for the development of indexes. As an alternative [[confirmatory composite analysis]] has been proposed to develop and assess indexes.<ref>{{cite journal |last1=Schamberger |first1=Tamara |last2=Schuberth |first2=Florian |last3=Henseler |first3=Jörg |title=Confirmatory composite analysis in human development research |journal=International Journal of Behavioral Development |date=2023 |volume=47 |issue=1 |pages=88–100 |doi=10.1177/01650254221117506|hdl=10362/143639 |hdl-access=free }}</ref>
PCA has been the only formal method available for the development of indexes, which are otherwise a hit-or-miss ''ad hoc'' undertaking.
 
The [[City development index|City Development Index]] was developed by PCA from about 200 indicators of city outcomes in a 1996 survey of 254 global cities. The first principal component was subject to iterative regression, adding the original variables singly until about 90% of its variation was accounted for. The index ultimately used about 15 indicators but was a good predictor of many more variables. Its comparative value agreed very well with a subjective assessment of the condition of each city. The coefficients on items of infrastructure were roughly proportional to the average costs of providing the underlying services, suggesting the Index was actually a measure of effective physical and social investment in the city.
 
The country-level [[Human Development Index]] (HDI) from [[United Nations Development Programme|UNDP]], which has been published since 1990 and is very extensively used in development studies,<ref>{{Cite web |last=Human Development Reports |title=Human Development Index |url=https://hdr.undp.org/en/content/human-development-index-hdi |access-date=2022-05-06 |website=United Nations Development Programme}}</ref> has very similar coefficients on similar indicators, strongly suggesting it was originally constructed using PCA.
Line 451 ⟶ 532:
In 1978 [[Luigi Luca Cavalli-Sforza|Cavalli-Sforza]] and others pioneered the use of principal components analysis (PCA) to summarise data on variation in human gene frequencies across regions. The components showed distinctive patterns, including gradients and sinusoidal waves. They interpreted these patterns as resulting from specific ancient migration events.
 
Since then, PCA has been ubiquitous in population genetics, with thousands of papers using PCA as a display mechanism. Genetics varies largely according to proximity, so the first two principal components actually show spatial distribution and may be used to map the relative geographical ___location of different population groups, thereby showing individuals who have wandered from their original locations.<ref>{{Cite journal |last1=Novembre |first1=John |last2=Stephens |first2=Matthew |date=2008 |title=Interpreting principal component analyses of spatial population genetic variation |journal=Nat Genet |volume=40 |issue=5 |pages=646–49 |doi=10.1038/ng.139 |pmid=18425127 |pmc=3989108 }}</ref>
 
PCA in genetics has been technically controversial, in that the technique has been performed on discrete non-normal variables and often on binary allele markers. The lack of any measures of standard error in PCA are also an impediment to more consistent usage. In August 2022, the molecular biologist [[Eran Elhaik]] published a theoretical paper in [[Scientific Reports]] analyzing 12 PCA applications. He concluded that it was easy to manipulate the method, which, in his view, generated results that were 'erroneous, contradictory, and absurd.' Specifically, he argued, the results achieved in population genetics were characterized by cherry-picking and [[circular reasoning]].<ref>{{cite journal | first = Eran | last = Elhaik | author-link = Eran Elhaik | doi = 10.1038/s41598-022-14395-4 | title = Principal Component Analyses (PCA)‑based findings in population genetic studies are highly biased and must be reevaluated | journal = [[Scientific Reports]] | volume = 12 | at = 14683 | year = 2022| issue = 1 | pmid = 36038559 | pmc = 9424212 | bibcode = 2022NatSR..1214683E | s2cid = 251932226 | doi-access = free }}</ref>
 
=== Market research and indexes of attitude ===
Market research has been an extensive user of PCA. It is used to develop customer satisfaction or customer loyalty scores for products, and with clustering, to develop market segments that may be targeted with advertising campaigns, in much the same way as factorial ecology will locate geographical areas with similar characteristics.<ref>{{Cite journal |last1=DeSarbo |first1=Wayne |last2=Hausmann |first2=Robert |last3=Kukitz |first3=Jeffrey |date=2007 |title=Restricted principal components analysis for marketing research |url=https://www.researchgate.net/publication/247623679 |journal=Journal of Marketing in Management |volume=2 |pages=305–328 |via=ResearchgateResearchGate}}</ref>
 
PCA rapidly transforms large amounts of data into smaller, easier-to-digest variables that can be more rapidly and readily analyzed. In any consumer questionnaire, there are series of questions designed to elicit consumer attitudes, and principal components seek out latent variables underlying these attitudes. For example, the Oxford Internet Survey in 2013 asked 2000 people about their attitudes and beliefs, and from these analysts extracted four principal component dimensions, which they identified as 'escape', 'social networking', 'efficiency', and 'problem creating'.<ref>{{Cite book |last1=Dutton |first1=William H |url=http://oxis.oii.ox.ac.uk/wp-content/uploads/2014/11/OxIS-2013.pdf |title=Cultures of the Internet: The Internet in Britain |last2=Blank |first2=Grant |publisher=Oxford Internet Institute |year=2013 |pages=6}}</ref>
 
Another example from [[Joe Flood (policy analyst)|Joe Flood]] in 2008 extracted an attitudinal index toward housing from 28 attitude questions in a national survey of 2697 households in Australia. The first principal component represented a general attitude toward property and home ownership. The index, or the attitude questions it embodied, could be fed into a General Linear Model of tenure choice. The strongest determinant of private renting by far was the attitude index, rather than income, marital status or household type.<ref>{{Cite journal |last=Flood |first=Joe |date=2008 |title=Multinomial Analysis for Housing Careers Survey |url=https://www.academia.edu/33218811 |access-date=6 May 2022 |website=Paper to the European Network for Housing Research Conference, Dublin}}</ref>
 
=== Quantitative finance ===
In [[quantitative finance]], PCA is used<ref name="Miller">See Ch. 9 in Michael B. Miller (2013). ''Mathematics and Statistics for Financial Risk Management'', 2nd Edition. Wiley {{ISBN|978-1-118-75029-2}}</ref>
{{See also|Portfolio optimization}}
in [[financial risk management]], and has been applied to [[Financial modeling#Quantitative finance|other problems]] such as [[portfolio optimization]].
In [[quantitative finance]], principal component analysis can be directly applied to the [[risk management]] of [[interest rate derivative]] portfolios.<ref name=PHIRS>[http://www.tradinginterestrates.com The Pricing and Hedging of Interest Rate Derivatives: A Practical Guide to Swaps], J H M Darbyshire, 2016, {{isbn|978-0995455511}}</ref> Trading multiple [[swap (finance)|swap instruments]] which are usually a function of 30–500 other market quotable swap instruments is sought to be reduced to usually 3 or 4 principal components, representing the path of interest rates on a macro basis. Converting risks to be represented as those to factor loadings (or multipliers) provides assessments and understanding beyond that available to simply collectively viewing risks to individual 30–500 buckets.
 
PCA is commonly used in problems involving [[fixed income]] securities and [[Bond fund|portfolios]], and [[interest rate derivative]]s.
Valuations here depend on the entire [[yield curve]], comprising numerous highly correlated instruments, and PCA is used to define a set of components or factors that explain rate movements,<ref name="Hull"/>
thereby facilitating the modelling.
One common risk management application is to [[Value at risk#Computation methods|calculating value at risk]], VaR, applying PCA to the [[Monte Carlo methods in finance|Monte Carlo simulation]].
<ref>§III.A.3.7.2 in Carol Alexander and Elizabeth Sheedy, eds. (2004). ''The Professional Risk Managers’ Handbook''. [[PRMIA]]. {{isbn|978-0976609704}}</ref>
Here, for each simulation-sample, the components are stressed, and rates, and [[Monte Carlo methods for option pricing#Methodology|in turn option values]], are then reconstructed;
with VaR calculated, finally, over the entire run.
PCA is also used in [[hedge (finance)|hedging]] exposure to [[interest rate risk]], given [[Key rate duration|partial duration]]s and other sensitivities.
<ref name="Hull">§9.7 in [[John C. Hull (economist)|John Hull]] (2018). ''Risk Management and Financial Institutions,'' 5th Edition. Wiley. {{isbn|1119448115}}</ref>
Under both, the first three, typically, principal components of the system are of interest ([[Fixed-income attribution#Modeling the yield curve|representing]] "shift", "twist", and "curvature").
These principal components are derived from an eigen-decomposition of the [[covariance matrix]] of [[yield curve|yield]] at predefined maturities;
<ref>[https://www-2.rotman.utoronto.ca/~hull/RMFI/PCA_6thEdition_Example.xls example decomposition], [[John C. Hull (economist)|John Hull]]</ref>
and where the [[variance]] of each component is its [[eigenvalue]] (and as the components are [[orthogonal]], no correlation need be incorporated in subsequent modelling).
 
For [[equity (finance)|equity]], an optimal portfolio is one where the [[expected return]] is maximized for a given level of risk, or alternatively, where risk is minimized for a given return; see [[Markowitz model]] for discussion.
Thus, one approach is to reduce portfolio risk, where [[asset allocation|allocation strategies]] are applied to the "principal portfolios" instead of the underlying [[Capital stock|stock]]s.
A second approach is to enhance portfolio return, using the principal components to select companies' stocks with upside potential.
<ref>Libin Yang. [https://ir.canterbury.ac.nz/bitstream/handle/10092/10293/thesis.pdf?sequence=1 ''An Application of Principal Component Analysis to Stock Portfolio Management'']. Department of Economics and Finance, [[University of Canterbury]], January 2015.</ref>
<ref>Giorgia Pasini (2017); [https://ijpam.eu/contents/2017-115-1/12/12.pdf Principal Component Analysis for Stock Portfolio Management]. ''International Journal of Pure and Applied Mathematics''. Volume 115 No. 1 2017, 153–167</ref>
PCA has also been used to understand relationships <ref name="Miller"/> between international [[equity market]]s, and within markets between groups of companies in industries or [[Stock market index#Types of indices by coverage|sectors]].
 
PCA may also be applied to [[Stress test (financial)|stress testing]],<ref name="IMF">See Ch. 25 § "Scenario testing using principal component analysis" in Li Ong (2014). [https://www.elibrary.imf.org/display/book/9781484368589/9781484368589.xml "A Guide to IMF Stress Testing Methods and Models"], [[International Monetary Fund]]</ref> essentially an analysis of a bank's ability to endure [[List of bank stress tests|a hypothetical adverse economic scenario]]. Its utility is in "distilling the information contained in [several] [[Macroeconomic model|macroeconomic variables]] into a more manageable data set, which can then [be used] for analysis."<ref name="IMF"/> Here, the resulting factors are linked to e.g. interest rates – based on the largest elements of the factor's [[eigenvector]] – and it is then observed how a "shock" to each of the factors affects the implied assets of each of the banks.
PCA has also been applied to [[Stock|equity portfolios]] in a similar fashion,<ref>Giorgia Pasini (2017); [https://ijpam.eu/contents/2017-115-1/12/12.pdf Principal Component Analysis for Stock Portfolio Management]. ''International Journal of Pure and Applied Mathematics''. Volume 115 No. 1 2017, 153–167</ref> both to [[Risk return ratio|portfolio risk]] and to [[Risk–return spectrum|risk return]]. One application is to reduce portfolio risk, where [[asset allocation|allocation strategies]] are applied to the "principal portfolios" instead of the underlying stocks.<ref>Libin Yang. [https://ir.canterbury.ac.nz/bitstream/handle/10092/10293/thesis.pdf?sequence=1 ''An Application of Principal Component Analysis to Stock Portfolio Management'']. Department of Economics and Finance, [[University of Canterbury]], January 2015.</ref> A second is to enhance portfolio return, using the principal components to [[Stock selection criterion|select stocks]] with upside potential.{{citation needed|date=November 2019}}
 
=== Neuroscience ===
A variant of principal components analysis is used in [[neuroscience]] to identify the specific properties of a stimulus that increases a [[neuron]]'s probability of generating an [[action potential]].<ref>{{cite journal|last1=Chapin|first1=John|last2=Nicolelis |first2=Miguel|title=Principal component analysis of neuronal ensemble activity reveals multidimensional somatosensory representations|journal=Journal of Neuroscience Methods|date=1999|volume=94|issue=1|pages=121–140|doi=10.1016/S0165-0270(99)00130-2|pmid=10638820|s2cid=17786731 }}</ref><ref name="brenner00">Brenner, N., Bialek, W., & de Ruyter van Steveninck, R.R. (2000).</ref> This technique is known as [[Spike-triggered covariance|spike-triggered covariance analysis]]. In a typical application an experimenter presents a [[white noise]] process as a stimulus (usually either as a sensory input to a test subject, or as a [[Electric current|current]] injected directly into the neuron) and records a train of action potentials, or spikes, produced by the neuron as a result. Presumably, certain features of the stimulus make the neuron more likely to spike. In order to extract these features, the experimenter calculates the [[covariance matrix]] of the ''spike-triggered ensemble'', the set of all stimuli (defined and discretized over a finite time window, typically on the order of 100 ms) that immediately preceded a spike. The [[Eigenvectors and eigenvalues|eigenvectors]] of the difference between the spike-triggered covariance matrix and the covariance matrix of the ''prior stimulus ensemble'' (the set of all stimuli, defined over the same length time window) then indicate the directions in the [[Vector space|space]] of stimuli along which the variance of the spike-triggered ensemble differed the most from that of the prior stimulus ensemble. Specifically, the eigenvectors with the largest positive eigenvalues correspond to the directions along which the variance of the spike-triggered ensemble showed the largest positive change compared to the varincevariance of the prior. Since these were the directions in which varying the stimulus led to a spike, they are often good approximations of the sought after relevant stimulus features.
 
In neuroscience, PCA is also used to discern the identity of a neuron from the shape of its action potential. [[Spike sorting]] is an important procedure because [[Electrophysiology#Extracellular recording|extracellular]] recording techniques often pick up signals from more than one neuron. In spike sorting, one first uses PCA to reduce the dimensionality of the space of action potential waveforms, and then performs [[Cluster analysis|clustering analysis]] to associate specific action potentials with individual neurons.
Line 507 ⟶ 609:
Principal component analysis creates variables that are linear combinations of the original variables. The new variables have the property that the variables are all orthogonal. The PCA transformation can be helpful as a pre-processing step before clustering. PCA is a variance-focused approach seeking to reproduce the total variable variance, in which components reflect both common and unique variance of the variable. PCA is generally preferred for purposes of data reduction (that is, translating variable space into optimal factor space) but not when the goal is to detect the latent construct or factors.
 
[[Factor analysis]] is similar to principal component analysis, in that factor analysis also involves linear combinations of variables. Different from PCA, factor analysis is a correlation-focused approach seeking to reproduce the inter-correlations among variables, in which the factors "represent the common variance of variables, excluding unique variance".<ref>Timothy A. Brown. [https://books.google.com/books?id=JDb3BQAAQBAJ&printsec=frontcover#v=onepage&q&f=false Confirmatory Factor Analysis for Applied Research Methodology in the social sciences]. Guilford Press, 2006</ref> In terms of the correlation matrix, this corresponds with focusing on explaining the off-diagonal terms (that is, shared co-variance), while PCA focuses on explaining the terms that sit on the diagonal. However, as a side result, when trying to reproduce the on-diagonal terms, PCA also tends to fit relatively well the off-diagonal correlations.<ref name="Jolliffe2002" />{{rp|158}} Results given by PCA and factor analysis are very similar in most situations, but this is not always the case, and there are some problems where the results are significantly different. Factor analysis is generally used when the research purpose is detecting data structure (that is, latent constructs or factors) or [[causal modeling]]. If the factor model is incorrectly formulated or the assumptions are not met, then factor analysis will give erroneous results.<ref>{{cite journal |last1=Meglen|first1=R.R. |title=Examining Large Databases: A Chemometric Approach Using Principal Component Analysis|journal=Journal of Chemometrics |volume=5 |issue=3|pages=163–179 |date=1991 |doi=10.1002/cem.1180050305 |s2cid=120886184 }}</ref>
 
=== {{math|<var>K</var>}}-means clustering ===
Line 513 ⟶ 615:
 
=== Non-negative matrix factorization ===
[[File:Fractional Residual Variances comparison, PCA and NMF.pdf|thumb|500px|Fractional residual variance (FRV) plots for PCA and NMF;<ref name="ren18"/> for PCA, the theoretical values are the contribution from the residual eigenvalues. In comparison, the FRV curves for PCA reaches a flat plateau where no signal are captured effectively; while the NMF FRV curves are decliningdecline continuously, indicating a better ability to capture signal. The FRV curves for NMF also converges to higher levels than PCA, indicating the less-overfitting property of NMF.]]<nowiki> </nowiki>[[Non-negative matrix factorization]] (NMF) is a dimension reduction method where only non-negative elements in the matrices are used, which is therefore a promising method in astronomy,<ref name="blantonRoweis07">{{Cite journal|arxiv=astro-ph/0606170|last1= Blanton|first1= Michael R.|title= K-corrections and filter transformations in the ultraviolet, optical, and near infrared |journal= The Astronomical Journal|volume= 133|issue= 2|pages= 734–754|last2= Roweis|first2= Sam |year= 2007|doi= 10.1086/510127|bibcode = 2007AJ....133..734B|s2cid= 18561804}}</ref><ref name="zhu16"/><ref name="ren18"/> in the sense that astrophysical signals are non-negative. The PCA components are orthogonal to each other, while the NMF components are all non-negative and therefore constructs a non-orthogonal basis.
 
In PCA, the contribution of each component is ranked based on the magnitude of its corresponding eigenvalue, which is equivalent to the fractional residual variance (FRV) in analyzing empirical data.<ref name = "soummer12">{{Cite journal|arxiv=1207.4197|last1= Soummer|first1= Rémi |title= Detection and Characterization of Exoplanets and Disks Using Projections on Karhunen-Loève Eigenimages|journal= The Astrophysical Journal Letters |volume= 755|issue= 2|pages= L28|last2= Pueyo|first2= Laurent|last3= Larkin | first3 = James|year= 2012|doi= 10.1088/2041-8205/755/2/L28|bibcode = 2012ApJ...755L..28S |s2cid= 51088743}}</ref> For NMF, its components are ranked based only on the empirical FRV curves.<ref name = "ren18">{{Cite journal|arxiv=1712.10317|last1= Ren|first1= Bin |title= Non-negative Matrix Factorization: Robust Extraction of Extended Structures|journal= The Astrophysical Journal|volume= 852|issue= 2|pages= 104|last2= Pueyo|first2= Laurent|last3= Zhu | first3 = Guangtun B.|last4= Duchêne|first4= Gaspard |year= 2018|doi= 10.3847/1538-4357/aaa1f2|bibcode = 2018ApJ...852..104R |s2cid= 3966513|doi-access= free}}</ref> The residual fractional eigenvalue plots, that is, <math> 1-\sum_{i=1}^k \lambda_i\Big/\sum_{j=1}^n \lambda_j</math> as a function of component number <math>k</math> given a total of <math>n</math> components, for PCA hashave a flat plateau, where no data is captured to remove the quasi-static noise, then the curves droppeddrop quickly as an indication of over-fitting and captures (random noise).<ref name="soummer12"/> The FRV curves for NMF is decreasing continuously<ref name="ren18"/> when the NMF components are constructed [[Non-negative matrix factorization#Sequential NMF|sequentially]],<ref name="zhu16">{{Cite arXiv|last=Zhu|first=Guangtun B.|date=2016-12-19|title=Nonnegative Matrix Factorization (NMF) with Heteroscedastic Uncertainties and Missing data |eprint=1612.06037|class=astro-ph.IM}}</ref> indicating the continuous capturing of quasi-static noise; then converge to higher levels than PCA,<ref name="ren18"/> indicating the less over-fitting property of NMF.
 
=== Iconography of correlations ===
It is often difficult to interpret the principal components when the data include many variables of various origins, or when some variables are qualitative. This leads the PCA user to a delicate elimination of several variables. If observations or variables have an excessive impact on the direction of the axes, they should be removed and then projected as supplementary elements. In addition, it is necessary to avoid interpreting the proximities between the points close to the center of the factorial plane.
 
[[File:AirMerIconographyCorrelation.jpg|thumb|Iconography of correlations - Geochemistry of marine aerosols]]
The [[iconography of correlations]], on the contrary, which is not a projection on a system of axes, does not have these drawbacks. We can therefore keep all the variables.
 
Line 602 ⟶ 704:
{{cite journal
|author1=Yue Guan
|author2=Jennifer Dy|author2-link=Jennifer Dy
|year=2009
|title=Sparse Probabilistic Principal Component Analysis
Line 623 ⟶ 725:
 
=== Nonlinear PCA ===
[[File:Elmap breastcancer wiki.png|thumb|300px| Linear PCA versus nonlinear Principal Manifolds<ref>[[Alexander Nikolaevich Gorban|A. N. Gorban]], A. Y. Zinovyev, [https://arxiv.org/abs/0809.0490 "Principal Graphs and Manifolds"], In: ''Handbook of Research on Machine Learning Applications and Trends: Algorithms, Methods and Techniques'', Olivas E.S. et al Eds. Information Science Reference, IGI Global: Hershey, PA, USA, 2009. 28–59.</ref> for [[Scientific visualization|visualization]] of [[breast cancer]] [[microarray]] data: a) Configuration of nodes and 2D Principal Surface in the 3D PCA linear manifold. The dataset is curved and cannot be mapped adequately on a 2D principal plane; b) The distribution in the internal 2D non-linear principal surface coordinates (ELMap2D) together with an estimation of the density of points; c) The same as b), but for the linear 2D PCA manifold (PCA2D). The "basal" breast cancer subtype is visualized more adequately with ELMap2D and some features of the distribution become better resolved in comparison to PCA2D. Principal manifolds are produced by the [[elastic map]]s algorithm. Data are available for public competition.<ref>{{cite journal |last1=Wang |first1=Y. |last2=Klijn |first2=J. G. |last3=Zhang |first3=Y. |last4=Sieuwerts |first4=A. M. |last5=Look |first5=M. P. |last6=Yang |first6=F. |last7=Talantov |first7=D. |last8=Timmermans |first8=M. |last9=Meijer-van Gelder |first9=M. E. |last10=Yu |first10=J. |title=Gene expression profiles to predict distant metastasis of lymph-node-negative primary breast cancer |journal=[[The Lancet]] |volume=365 |issue=9460 |pages=671–679 |year=2005 |doi=10.1016/S0140-6736(05)17947-1 |pmid=15721472 |s2cid=16358549 |display-authors=etal}} [https://www.ihes.fr/~zinovyev/princmanif2006/ Data online]</ref> Software is available for free non-commercial use.<ref>{{cite web |first=A. |last=Zinovyev |url=http://bioinfo-out.curie.fr/projects/vidaexpert/ |title=ViDaExpert – Multidimensional Data Visualization Tool |work=[[Curie Institute (Paris)|Institut Curie]] |___location=Paris }} (free for non-commercial use)</ref>]]
 
Most of the modern methods for [[nonlinear dimensionality reduction]] find their theoretical and algorithmic roots in PCA or K-means. Pearson's original idea was to take a straight line (or plane) which will be "the best fit" to a set of data points. [[Trevor Hastie]] expanded on this concept by proposing '''Principal [[curve]]s'''<ref>{{cite journal|author1-last=Hastie|author1-first=T. |author1-link=Trevor Hastie|author2-last=Stuetzle|author2-first=W. |title=Principal Curves|journal=[[Journal of the American Statistical Association]]|date=June 1989|volume=84|issue=406|pages=502–506|doi=10.1080/01621459.1989.10478797 |url=https://web.stanford.edu/~hastie/Papers/Principal_Curves.pdf}}</ref> as the natural extension for the geometric interpretation of PCA, which explicitly constructs a manifold for data [[approximation]] followed by [[Projection (mathematics)|projecting]] the points onto it. See also the [[elastic map]] algorithm and [[principal geodesic analysis]].<ref>A.N. Gorban, asB. isKegl, illustratedD.C. byWunsch, FigA. Zinovyev (Eds.), [https://www.researchgate.net/publication/271642170_Principal_Manifolds_for_Data_Visualisation_and_Dimension_Reduction_LNCSE_58 Principal Manifolds for Data Visualisation and Dimension Reduction],
See also the [[elastic map]] algorithm and [[principal geodesic analysis]].<ref>A.N. Gorban, B. Kegl, D.C. Wunsch, A. Zinovyev (Eds.), [https://www.researchgate.net/publication/271642170_Principal_Manifolds_for_Data_Visualisation_and_Dimension_Reduction_LNCSE_58 Principal Manifolds for Data Visualisation and Dimension Reduction],
LNCSE 58, Springer, Berlin – Heidelberg – New York, 2007. {{isbn|978-3-540-73749-0}}</ref> Another popular generalization is [[kernel PCA]], which corresponds to PCA performed in a reproducing kernel Hilbert space associated with a positive definite kernel.
 
In [[multilinear subspace learning]],<ref name="Vasilescu2003">{{cite journalconference
|first1=HaipingM.A.O. |last1=LuVasilescu
|first2=K.ND. |last2=PlataniotisTerzopoulos
|url=http://www.cs.toronto.edu/~maov/tensorfaces/cvpr03.pdf
|first3=A.N. |last3=Venetsanopoulos
|title=Multilinear Subspace Analysis of Image Ensembles
|url=http://www.dsp.utoronto.ca/~haiping/Publication/SurveyMSL_PR2011.pdf
|conference=Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR’03)
|title=A Survey of Multilinear Subspace Learning for Tensor Data
|___location=Madison, WI
|journal=Pattern Recognition
|year=2003
|volume=44 |number=7 |pages=1540–1551 |year=2011
}}</ref><ref name="Vasilescu2002tensorfaces">{{cite book
|doi=10.1016/j.patcog.2011.01.004
|first1=M.A.O. |last1=Vasilescu
|bibcode=2011PatRe..44.1540L
|first2=D. |last2=Terzopoulos
}}</ref> PCA is generalized to [[multilinear principal component analysis|multilinear PCA]] (MPCA) that extracts features directly from tensor representations. MPCA is solved by performing PCA in each mode of the tensor iteratively. MPCA has been applied to face recognition, gait recognition, etc. MPCA is further extended to uncorrelated MPCA, non-negative MPCA and robust MPCA.
|url=http://www.cs.toronto.edu/~maov/tensorfaces/Springer%20ECCV%202002_files/eccv02proceeding_23500447.pdf
|title=Multilinear Analysis of Image Ensembles: TensorFaces
|series=Lecture Notes in Computer Science 2350; (Presented at Proc. 7th European Conference on Computer Vision (ECCV'02), Copenhagen, Denmark)
|publisher=Springer, Berlin, Heidelberg
|doi=10.1007/3-540-47969-4_30
|isbn=978-3-540-43745-1
|year=2002
}}</ref><ref name="MPCA-MICA2005">{{cite conference
|first1=M.A.O. |last1=Vasilescu
|first2=D. |last2=Terzopoulos
|url=http://www.media.mit.edu/~maov/mica/mica05.pdf
|title=Multilinear Independent Component Analysis
|conference=Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR’05)
|___location=San Diego, CA
|date=June 2005
|volume=1
|pages=547–553}}</ref> PCA is generalized to [[multilinear principal component analysis|multilinear PCA]] (MPCA) that extracts features directly from tensor representations. MPCA is solved by performing PCA in each mode of the tensor iteratively. MPCA has been applied to face recognition, gait recognition, etc. MPCA is further extended to uncorrelated MPCA, non-negative MPCA and robust MPCA.
 
''N''-way principal component analysis may be performed with models such as [[Tucker decomposition]], [[PARAFAC]], multiple factor analysis, co-inertia analysis, STATIS, and DISTATIS.
 
=== Robust PCA ===
While PCA finds the mathematically optimal method (as in minimizing the squared error), it is still sensitive to [[outlier]]s in the data that produce large errors, something that the method tries to avoid in the first place. It is therefore common practice to remove outliers before computing PCA. However, in some contexts, outliers can be difficult to identify.<ref>{{cite Forconference
| example,author in= [[dataKirill mining]]Simonov, algorithmsFedor likeV. [[correlation clustering]]Fomin, thePetr assignmentA. ofGolovach, pointsFahad to clusters and outliers is not known beforehand.Panolan
| title = Refined Complexity of PCA with Outliers
A recently proposed generalization of PCA<ref>{{Cite book | doi = 10.1007/978-3-540-69497-7_27 | title = A General Framework for Increasing the Robustness of PCA-Based Correlation Clustering Algorithms | isbn = 978-3-540-69476-2 | series = Lecture Notes in Computer Science | journal = Scientific and Statistical Database Management| year = 2008 | last1 = Kriegel | first1 = H. P. | last2 = Kröger | first2 = P. | last3 = Schubert | first3 = E. | last4 = Zimek | first4 = A. | volume = 5069 | pages = 418–435 | citeseerx = 10.1.1.144.4864 }}</ref> based on a weighted PCA increases robustness by assigning different weights to data objects based on their estimated relevancy.
| book-title = Proceedings of the 36th International Conference on Machine Learning (ICML 2019)
| date = June 9–15, 2019
| ___location = Long Beach, California, USA
| publisher = PMLR
| volume = 97
| pages = 5818–5826
| url = http://proceedings.mlr.press/v97/simonov19a.html
| editor = Kamalika Chaudhuri, Ruslan Salakhutdinov
}}</ref>
For example, in [[data mining]] algorithms like [[correlation clustering]], the assignment of points to clusters and outliers is not known beforehand.
A recently proposed generalization of PCA<ref>{{Cite book | doi = 10.1007/978-3-540-69497-7_27 | isbn = 978-3-540-69476-2 | series = Lecture Notes in Computer Science | year = 2008 | last1 = Kriegel | first1 = H. P. | last2 = Kröger | first2 = P. | last3 = Schubert | first3 = E. | last4 = Zimek | first4 = A. | title = Scientific and Statistical Database Management | chapter = A General Framework for Increasing the Robustness of PCA-Based Correlation Clustering Algorithms | volume = 5069 | pages = 418–435 | citeseerx = 10.1.1.144.4864 }}</ref> based on a weighted PCA increases robustness by assigning different weights to data objects based on their estimated relevancy.
 
Outlier-resistant variants of PCA have also been proposed, based on L1-norm formulations ([[L1-norm principal component analysis|L1-PCA]]).<ref name="mark2014"/><ref name="mark2017" />
Line 666 ⟶ 796:
=== Discriminant analysis of principal components ===
 
Discriminant analysis of principal components (DAPC) is a multivariate method used to identify and describe clusters of genetically related individuals. Genetic variation is partitioned into two components: variation between groups and within groups, and it maximizes the former. Linear discriminants are linear combinations of alleles which best separate the clusters. Alleles that most contribute to this discrimination are therefore those that are the most markedly different across groups. The contributions of alleles to the groupings identified by DAPC can allow identifying regions of the genome driving the genetic divergence among groups<ref>{{Cite journal|title = Discriminant analysis of principal components: a new method for the analysis of genetically structured populations.|last1=Liao|first1=T.|last2=Jombart|first2=S.|last3=Devillard|first3=F.|last4=Balloux|journal=BMC Genetics|date=2010|volume=11|pages=11:94|doi=10.1186/1471-2156-11-94|pmid = 20950446|pmc=2973851 |doi-access=free }}</ref>
In DAPC, data is first transformed using a principal components analysis (PCA) and subsequently clusters are identified using discriminant analysis (DA).
 
A DAPC can be realized on R using the package Adegenet. (more info: [https://adegenet.r-forge.r-project.org/ adegenet on the web])
 
=== Directional component analysis ===
 
[[Directional component analysis]] (DCA) is a method used in the atmospheric sciences for analysing multivariate datasets.<ref name="jewson"/>
Like PCA, it allows for dimension reduction, improved visualization and improved interpretability of large data-sets.
Also like PCA, it is based on a covariance matrix derived from the input dataset.
The difference between PCA and DCA is that DCA additionally requires the input of a vector direction, referred to as the impact.
Whereas PCA maximises explained variance, DCA maximises probability density given impact.
The motivation for DCA is to find components of a multivariate dataset that are both likely (measured using probability density) and important (measured using the impact).
DCA has been used to find the most likely and most serious heat-wave patterns in weather prediction ensembles
,<ref name="scheretal"/> and the most likely and most impactful changes in rainfall due to climate change
.<ref name="jewsonetal"/>
 
== Software/source code ==
* [[ALGLIB]] - a C++ and C# library that implements PCA and truncated PCA
* [[Analytica (software)|Analytica]] – The built-in EigenDecomp function computes principal components.
* [[ELKI]] – includes PCA for projection, including robust variants of PCA, as well as PCA-based [[Cluster analysis|clustering algorithms]].
Line 678 ⟶ 820:
* [[Julia language|Julia]] – Supports PCA with the <code>pca</code> function in the MultivariateStats package
* [[KNIME]] – A java based nodal arranging software for Analysis, in this the nodes called PCA, PCA compute, PCA Apply, PCA inverse make it easily.
* [[Maple (software)]] – The PCA command is used to perform a principal component analysis on a set of data.
* [[Mathematica]] – Implements principal component analysis with the PrincipalComponents command using both covariance and correlation methods.
* [https://github.com/markrogoyski/math-php MathPHP] – [[PHP]] mathematics library with support for PCA.
* [[MATLAB]] - The SVD function is part of the basic system. In the Statistics Toolbox, the functions <code>princomp</code> and <code>pca</code> (R2012b) give the principal components, while the function <code>pcares</code> gives the residuals and reconstructed matrix for a low-rank PCA approximation.
* [[Matplotlib]] – [[Python (programming language)|Python]] library have a PCA package in the .mlab module.
* [[mlpack]] – Provides an implementation of principal component analysis in [[C++]].
* [https://github.com/mikerabat/mrmath mrmath] – A high performance math library for [[Delphi (software)|Delphi]] and [[Free Pascal|FreePascal]] can perform PCA; including robust variants.
* [[NAG Numerical Library|NAG Library]] – Principal components analysis is implemented via the <code>g03aa</code> routine (available in both the Fortran versions of the Library).
* [[NMath]] – Proprietary numerical library containing PCA for the [[.NET Framework]].
Line 693 ⟶ 837:
* [[R (programming language)|R]] – [[free software|Free]] statistical package, the functions <code>princomp</code> and <code>prcomp</code> can be used for principal component analysis; <code>prcomp</code> uses [[singular value decomposition]] which generally gives better numerical accuracy. Some packages that implement PCA in R, include, but are not limited to: <code>ade4</code>, <code>vegan</code>, <code>ExPosition</code>, <code>dimRed</code>, and <code>FactoMineR</code>.
* [[SAS (software)|SAS]] – Proprietary software; for example, see<ref>{{cite web|title=Principal Components Analysis|url=https://stats.idre.ucla.edu/sas/output/principal-components-analysis/|website=Institute for Digital Research and Education|publisher=UCLA|access-date=29 May 2018}}</ref>
* [[Scikitscikit-learn]] – Python library for machine learning which contains PCA, Probabilistic PCA, Kernel PCA, Sparse PCA and other techniques in the decomposition module.
* [[Scilab]] – Free and open-source, cross-platform numerical computational package, the function <code>princomp</code> computes principal component analysis, the function <code>pca</code> computes principal component analysis with standardized variables.
* [[SPSS]] - Proprietary software most commonly used by social scientists for PCA, factor analysis and associated cluster analysis.
* [[SPSS]] – Proprietary software most commonly used by social scientists for PCA, factor analysis and associated cluster analysis.
* [[Weka (machine learning)|Weka]] – Java library for machine learning which contains modules for computing principal components.
 
Line 705 ⟶ 850:
* [[CUR matrix approximation]] (can replace of low-rank SVD approximation)
* [[Detrended correspondence analysis]]
* [[Directional component analysis]]
* [[Dynamic mode decomposition]]
* [[Eigenface]]
Line 731 ⟶ 877:
 
== References ==
{{Reflist|30em}}|refs=
 
<ref name="jewson">{{cite journal
|first1=S. |last1=Jewson
|year=2020
|title=An Alternative to PCA for Estimating Dominant Patterns of Climate Variability and Extremes, with Application to U.S. and China Seasonal Rainfall
|journal=Atmosphere
|volume=11
|issue=4
|page=354
|doi=10.3390/atmos11040354
|bibcode=2020Atmos..11..354J
|doi-access=free
}}
</ref>
 
<ref name="scheretal">{{cite journal
|first1=S. |last1=Scher
|first2=S. |last2=Jewson
|first3=G. |last3=Messori
|year=2021
|title=Robust Worst-Case Scenarios from Ensemble Forecasts
|journal=Weather and Forecasting
|volume=36
|issue=4
|pages=1357–1373
|doi=10.1175/WAF-D-20-0219.1
|bibcode=2021WtFor..36.1357S
|s2cid=236300040
|doi-access=free
}}</ref>
 
<ref name="jewsonetal">{{cite journal
|first1=S. |last1=Jewson
|first2=G. |last2=Messori
|first3=G. |last3=Barbato
|first4=P. |last4=Mercogliano
|first5=J. |last5=Mysiak
|first6=M. |last6=Sassi
|year=2022
|title=Developing Representative Impact Scenarios From Climate Projection Ensembles, With Application to UKCP18 and EURO-CORDEX Precipitation
|journal=Journal of Advances in Modeling Earth Systems
|volume=15
|issue=1
|doi=10.1029/2022MS003038
|s2cid=254965361
|url=http://urn.kb.se/resolve?urn=urn:nbn:se:uu:diva-492087
|doi-access=free
}}</ref>
 
}}
 
== Further reading ==
Line 749 ⟶ 945:
| url-access = registration
}}
* {{Cite book |last=Jolliffe |first=I. T. |url=http://link.springer.com/10.1007/b98835 |title=Principal Component Analysis |date=2002 |publisher=Springer-Verlag |isbn=978-0-387-95442-4 |series=Springer Series in Statistics |___location=New York |language=en |doi=10.1007/b98835}}
* Husson François, Lê Sébastien & Pagès Jérôme (2009). ''Exploratory Multivariate Analysis by Example Using R''. Chapman & Hall/CRC The R Series, London. 224p. {{isbn|978-2-7535-0938-2}}
* Pagès Jérôme (2014). ''[https://books.google.com/books?id=_RIeBQAAQBAJ&printsec=frontcover#v=snippet&q=%22principal%20component%20analysis+component+analysis%22&f=false Multiple Factor Analysis by Example Using R]''. Chapman & Hall/CRC The R Series London 272 p
 
== External links ==
Line 759 ⟶ 955:
* [https://arxiv.org/abs/1404.1100 A Tutorial on Principal Component Analysis]
* {{YouTube|BfTMmoDFXyE|A layman's introduction to principal component analysis}} (a video of less than 100 seconds.)
* {{YouTube|_UVHneBUBW0FgakZw6K1QQ|StatQuest: StatQuest: Principal Component Analysis (PCA), clearly explainedStep-by-Step}}
* [https://stats.stackexchange.com/a/140579 Layman's explanation in making sense of principal component analysis, eigenvectors & eigenvalues] on [[Stack Overflow]]
* See also the list of [[#Software/source code|Software implementations]]