PCA Dimension Reduction

Reduce dimensions using Principal Component Analysis. Extracts principal components that capture maximum variance. Visualizes with scree plot (variance…

Extracts principal components that capture maximum variance. Visualizes with scree plot (variance explained) and biplot (scores + loadings).

What Is Principal Component Analysis (PCA)?

PCA is a dimensionality reduction technique that transforms correlated variables into a smaller set of uncorrelated variables called principal components. Each component captures the maximum remaining variance in the data, ordered by importance. The first few components often capture 80-95% of total variance.

Mathematically, PCA computes the eigenvectors and eigenvalues of the data's covariance (or correlation) matrix. The eigenvectors define the directions (loadings) of the new axes, and the eigenvalues quantify the variance captured along each axis. Data is typically standardized (zero mean, unit variance) before PCA to prevent variables with larger scales from dominating.

The scree plot shows eigenvalues vs. component number — the 'elbow' suggests how many components to retain. The biplot visualizes both scores (data points in PC space) and loadings (original variable contributions), enabling interpretation of what each component represents.

Formula: Covariance Matrix: C = (1/(n−1)) XᵀX (X centered) Eigendecomposition: C·v = λ·v PC scores: Z = X·V Variance explained = λₖ / Σλᵢ Standardized (default): divide each centered column by its standard deviation first — C becomes the correlation matrix R, and Σλᵢ = number of variables

Example Calculation

Five parts measured on three dimensions in mm: length 24/26/25/28/27, width 35/35/37/38/40, height 13/14/14/15/14. The covariance matrix has eigenvalues λ₁ = 6.21, λ₂ = 1.22, λ₃ = 0.07, a total variance of 7.50. PC1 explains 6.21/7.50 = 82.7%, PC2 16.3%, cumulative 99.0% — keeping 2 components reduces three dimensions to two and preserves 99% of the variance. All three variables share one unit, so the covariance matrix is the right one to decompose; variables in different units would need standardizing first, or the one with the largest numbers dominates PC1. To reproduce these numbers in the calculator, clear Standardize variables — it is on by default, which decomposes the correlation matrix instead.

When to Use This Calculator

Common Mistakes to Avoid

How to Interpret Results

Related Standards & References

Frequently Asked Questions

Should I standardize my data before PCA?

Yes, almost always. If variables have different units or scales (e.g., height in cm and weight in kg), PCA on raw data will be dominated by the variable with the largest variance. Standardizing to zero mean and unit variance ensures all variables contribute equally. Use the correlation matrix instead of the covariance matrix for the same effect.

How many principal components should I keep?

Common rules: (1) Keep components until cumulative variance explained reaches 80-95%. (2) Use the scree plot 'elbow' — retain components before the curve flattens. (3) Kaiser's rule — keep components with eigenvalue > 1 (for correlation-based PCA). The best choice depends on the trade-off between information loss and dimensionality reduction needed.