Principal component analysis
Details

PCA is defined as an 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.

Consider an n × p {\displaystyle n\times p} data 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 l {\displaystyle l} of p -dimensional vectors of weights or coefficients w (k) = (w 1, …, w p) (k) {\displaystyle \mathbf {w} _{(k)}=(w_{1},\dots,w_{p})_{(k)}} that map each row vector x (i) = (x 1, …, x p) (i) {\displaystyle \mathbf {x} _{(i)}=(x_{1},\dots,x_{p})_{(i)}} of X to a new vector of principal component scores t (i) = (t 1, …, t l) (i) {\displaystyle \mathbf {t} _{(i)}=(t_{1},\dots,t_{l})_{(i)}}, given by

in such a way that the individual variables t 1, …, t l {\displaystyle t_{1},\dots,t_{l}} 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 l {\displaystyle l} is usually selected to be strictly less than p {\displaystyle p} to reduce dimensionality).

The above may equivalently be written in matrix form as

where T i k = t k (i) {\displaystyle {\mathbf {T} }_{ik}={t_{k}}_{(i)}}, X i j = x j (i) {\displaystyle {\mathbf {X} }_{ij}={x_{j}}_{(i)}}, and W j k = w j (k) {\displaystyle {\mathbf {W} }_{jk}={w_{j}}_{(k)}}.
oulipo:avoid_letter[o], combination:repeat_prompt