Principal Component Analysis, or the discrete Karhunen-Loeve transform KLT, is a technique that has two significant applications in data analysis:
Similarly, there are two formulations of the PCA definition:
A practical example of dimensionality reduction is the equation of a hyperplane in dimensions: there exists a basis of the space that transforms the equation of the plane, reducing it to
dimensions without losing information, thereby saving one dimension in the problem.
Let us consider
random vectors representing the outcomes of some experiment, realizations of a zero-mean random variable, which can be stored in the rows2.1 of the matrix
of dimensions
, which therefore stores
random vectors of dimensionality
and with
.
Each line corresponds to a different result
, and the distribution of these experiments must have a mean, at least the empirical one, equal to zero.
Assuming that the points have zero mean (which can always be achieved by simply subtracting the centroid), their covariance of occurrences is given by
| (2.66) |
The objective of PCA is to find an optimal transformation that transforms the correlated data into uncorrelated data
| (2.67) |
If there exists an orthonormal basis such that the covariance matrix of
expressed in this basis is diagonal, then the axes of this new basis are referred to as the principal components of
(or of the distribution of
). When a covariance matrix is obtained where all elements are
except for those on the diagonal, it indicates that under this new basis of the space, the events are uncorrelated with each other.
This transformation can be found by solving an eigenvalue problem: it can indeed be demonstrated that the elements of the diagonal correlation matrix must be the eigenvalues of , and for this reason, the variances of the projection of the vector
onto the principal components are the eigenvalues themselves:
To achieve this result, there are two approaches. Since
is a symmetric, real, positive definite matrix, it can be decomposed into
This technique, however, requires the explicit computation of
. Given a rectangular matrix
, the SVD technique allows us to precisely find the eigenvalues and eigenvectors of the matrix
, that is, of
, and therefore it is the most efficient and numerically stable method to achieve this result.
Through the SVD, it is possible to decompose the event matrix such that
It is noteworthy that using the SVD, it is not necessary to explicitly compute the covariance matrix
. However, this matrix can be derived later through the equation
| (2.70) |
By comparing this relation with that of equation (2.69), it can also be concluded that
.
It is important to remember the properties of eigenvalues:
By selecting the number of eigenvectors with sufficiently large eigenvalues, it is possible to create an orthonormal basis of the space
such that
obtained as a projection