IAE Academy

PCA formulas

Dimensionality reduction and principal component analysis. 13 formulas for GATE DA Machine Learning, each with when to use it. Each is explained in the topic notes.

All 13 PCA formulas

SAMPLE MEAN AND CENTRED DATA

Centre each feature (column) to mean zero. denotes the centred matrix, whose rows are .

SAMPLE COVARIANCE MATRIX

Symmetric and positive semi-definite. Diagonal entries are feature variances; off-diagonal entries are covariances. Some texts divide by instead. The eigenvectors and the proportions of variance do not change; every eigenvalue is scaled by the same factor.

PRINCIPAL DIRECTIONS

The eigenvectors of the symmetric matrix are chosen orthonormal. is the -th principal direction (component). A direction is fixed only up to sign.

SPECTRAL DECOMPOSITION AND COVARIANCE OF SCORES

is orthogonal and . The scores (defined below) have the diagonal covariance .

VARIANCE ALONG A PRINCIPAL DIRECTION

Projections onto different components are uncorrelated: for .

VARIANCE ALONG ANY UNIT DIRECTION

The largest possible projected variance is , reached at . The smallest is , reached at .

TOTAL VARIANCE

Total variance is unchanged by rotating to the principal axes. For standardised data it equals .

PROPORTION OF VARIANCE EXPLAINED

Choose the smallest whose cumulative proportion reaches a stated target, such as 90 percent.

PROJECTION (SCORES) ONTO $K$ COMPONENTS

has orthonormal columns. The coordinate along is .

RECONSTRUCTION AND ERROR

The are eigenvalues of with divisor . With divisor , the mean squared error equals the sum of the discarded eigenvalues exactly. Among all -dimensional affine subspaces (all rank- linear reconstructions of the centred data), projecting onto the top components gives the smallest total squared reconstruction error. Maximising the retained variance and minimising the reconstruction error lead to the same components.

SVD OF THE CENTRED DATA

The columns of (right singular vectors) are the principal directions. The are the singular values in decreasing order. The are eigenvalues of with divisor .

SCORES FROM THE SVD

This uses the first columns of and and the top-left block of . The best rank- approximation of is .

GRAM-MATRIX ROUTE (USEFUL WHEN D > N)

The matrix has the same non-zero eigenvalues as . When it is the smaller matrix to decompose.

Where this was asked: 2025 (1), 2026 (1). See the 2 previous-year questions on PCA. This shows what was asked, not what will be asked.