Skip to main content
aifinhub

Calculator

Correlation Matrix Visualizer

Pearson correlation heatmap, condition number, eigenvalue spectrum, effective-N. Diagnostics for redundant strategies before allocating. Free, client-side.

Inputs
Form inputs / CSV
Runtime
Instant
Privacy
Client-side · no upload
API key
Not required
Methodology
Open →

Education · Not investment advice. BaFin/EU framework. Past performance does not indicate future results. Editorial standards Sponsor disclosure Corrections

Upload a returns CSV

Wide format: date,strategy_1,strategy_2,.... Each column is one strategy or asset return series. Up to about 20 columns renders legibly. Nothing leaves your browser.

What this tool computes

Classical multi-strategy correlation diagnostics. The synthetic demo includes a deliberately-redundant "clone_of_momentum" column so you can see how the condition number and effective-N reflect redundancy. Load a CSV or the demo to begin.

How to use

Step-by-step

Full calculator guide →
  1. 1

    Upload return series for the asset universe (rows = time periods, columns = assets).

  2. 2

    Pick correlation type: Pearson (linear), Spearman (rank-based, robust to outliers).

  3. 3

    Toggle Ledoit-Wolf shrinkage if the asset count approaches or exceeds the observation count.

  4. 4

    Read the heatmap. Hierarchical clustering reorders assets so related groups appear as visible blocks.

  5. 5

    Identify diversification gaps: clusters with low cross-correlation are diversification candidates; clusters with high mutual correlation are concentration risk.

For agents

Use in an agent

Same math, same result shape as the UI above — as a static ES module. No HTTP request, no auth, no rate limit.

import { compute } from "https://aifinhub.io/engines/correlation-matrix-visualizer.js";

Contract: /contracts/correlation-matrix-visualizer.json Full agent guide →

Glossary references

Terms used by this tool

All glossary →

Questions people ask next

FAQ

How is correlation computed?

Pearson correlation by default — the standard linear correlation. Spearman (rank correlation) is available as an option for non-linear relationships and for series with outliers. Both are documented on the methodology page.

What does shrinkage do?

Ledoit-Wolf shrinkage pulls extreme correlation estimates toward zero (or toward a target structure like equicorrelation). Reduces noise in the matrix without biasing the structure too much. Critical when you have more assets than observations — without shrinkage, the sample correlation matrix is rank-deficient and unusable for optimization.

Why is the diagonal sometimes not exactly 1.0?

After shrinkage, the diagonal can drift slightly — a small bias the tool doesn't correct because it's shrinking the entire matrix uniformly. The methodology page documents this. For most uses, the drift (typically 0.95-1.0) is harmless.

How many observations do I need?

At minimum, more observations than assets. For a 50-asset matrix, 50+ observations is the floor; 200+ is the comfortable zone for Pearson. Below the floor, the matrix is rank-deficient. The tool warns at the boundary.

Why are some clusters in the heatmap obvious and others not?

The tool runs hierarchical clustering on the correlation distances and reorders the matrix to put related assets together. Strong clusters (e.g., financial stocks, commodity ETFs) become visible blocks. Weak clusters or assets with mixed exposures don't pop out — that's a feature, not a bug. The cluster dendrogram is on the methodology page.

Complementary tools

Planning estimates only — not financial, tax, or investment advice.