Skip to main content
Calcimator

Dimensionality Reduction Calculator

Determine how many principal components to retain based on eigenvalues and target explained variance. Includes scree plot data, Kaiser criterion, and cumulative variance analysis.

About this calculator

This calculator takes up to five eigenvalues, sorts them from largest to smallest regardless of which numbered slot you typed them into (line 12), and walks the running cumulative share of total variance until it clears your Target Variance Explained threshold (lines 26-31) — that crossing point is Components to Keep. The Total Variance field is not part of that arithmetic at all: the variance total the percentages are measured against is recomputed from the five eigenvalues themselves (line 15's `eigenSum`), so changing Total Variance alone moves nothing. A negative eigenvalue is not clamped to zero either — the collection loop only keeps entries where `v >= 0` (line 8), so a negative value is dropped from the count entirely rather than contributing a zero-variance component.

At the defaults (45, 25, 15, 10, 5), the first four eigenvalues already cover 95% of the total, so Components to Keep is 4 and Dimension Reduction reports 20% (1 of 5 dropped); the Kaiser criterion separately flags 2 components (those above the mean eigenvalue of 20). Raising Eigenvalue 5 — the smallest — actually raises Components to Keep, because it inflates the variance total every share is normalized against (line 15) enough to push the first four components' cumulative share just under the 95% line, forcing a fifth component in. What this does not account for: negative-eigenvalue inputs contributing anything to the total, or the Kaiser criterion changing which components it flags once a perturbation is large enough to cross the running average — this calculator's Target Variance field, unlike some others on the site, uses `??` rather than `||` (line 4), so a literal 0 there is respected and then clamped into the 1-100 range rather than silently replaced.

Inputs

Results

Components to Keep

4

Variance Explained

95%

Dimension Reduction20%
Kaiser Criterion Components2
Total Components5
Largest Eigenvalue45
Smallest Eigenvalue5
How to Use This Calculator
  1. Enter the total variance and each principal component's eigenvalue (up to five).
  2. Set the minimum explained variance threshold (e.g., 95%).
  3. Review the number of components needed to reach your variance threshold.
  4. Plot the scree plot to identify the elbow and confirm the component count.
  5. Use the selected components as input features for downstream modeling.

How the result changes with Eigenvalue 1 (Largest)

Eigenvalue 1 (Largest)Components to KeepVariance Explained
235100%
345100%
68495.93%
113497.02%

What each input means

Total Variance
The total variance across all original features (sum of all eigenvalues ideally).
Eigenvalue 1 (Largest)
Eigenvalue for the first principal component (largest variance direction).
Eigenvalue 2
Eigenvalue for the second principal component.
Eigenvalue 3
Eigenvalue for the third principal component.
Eigenvalue 4
Eigenvalue for the fourth principal component.
Eigenvalue 5 (Smallest)
Eigenvalue for the fifth principal component (smallest variance direction).
Target Variance Explained (%)
The minimum percentage of total variance you want your retained components to explain. 95% is common.

How this is calculated

Worked example, using the default values

  1. Identify Input Parameters
    4 parameters
    Total Variance = 100, Eigenvalue 1 (Largest) = 45, Eigenvalue 2 = 25, Eigenvalue 3 = 15 = 7 input(s) provided
  2. Calculate Components to Keep
    Components to Keep
    4 = 4
  3. Calculate Variance Explained
    95 = 95
  4. Calculate Dimension Reduction
    Dimension Reduction
    20 = 20
  5. Calculate Kaiser Criterion Components
    Kaiser Criterion Components
    2 = 2

Engine last updated . Checked against 1 independently-derived test — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.

Frequently Asked Questions

Does changing Total Variance change Components to Keep or Explained Variance?

No. Every percentage this calculator reports is measured against a variance total it recomputes itself from the five eigenvalues you enter (line 15), never from the Total Variance field — that input plays no role in the arithmetic at all, so changing it alone leaves Components to Keep, Explained Variance, and every other output unchanged.

Why does raising Eigenvalue 5, the smallest one, increase how many components I need to keep?

Every component's share of variance is normalized against the sum of all five eigenvalues (line 15), and Eigenvalue 5 contributes to that sum even though it rarely gets kept itself. Growing it inflates the total enough that the first four components' combined share dips just under the 95% target (lines 26-31), so the running total has to reach a fifth component before it crosses the threshold.

Does it matter which numbered slot (Eigenvalue 1 through 5) I put each value in?

No — the calculator re-sorts all five eigenvalues from largest to smallest before doing anything else (line 12), so principal components are always ranked by their actual magnitude rather than by which input box you typed them into. Labeling one entry "Eigenvalue 1 (Largest)" is a convenience for you, not a requirement the code enforces.

What happens if I enter a negative eigenvalue?

It is dropped from the analysis entirely rather than being treated as zero variance. The collection loop only keeps a value when `v !== undefined && v !== null && v >= 0` (line 8), so a negative entry reduces Total Components by one instead of adding a component that explains no variance — the two are not the same outcome.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Math & Statistics.