Calculator
Portfolio Correlation Matrix
Pearson correlation heatmap, condition number, eigenvalue spectrum, effective-N. Diagnostics for redundant strategies before allocating. Free,
Runs in your browser. Nothing you enter is uploaded, and no account or API key is needed.
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 it
- Upload a wide-format returns CSV (an optional date column, then one column per asset or strategy, one row per period) or load the five-strategy demo. You need at least 30 rows.
- Read the average absolute correlation and the effective number of independent bets: 5 strategies with an effective N near 2 behave like 2.
- Read the heatmap: red cells are positive correlations, blue cells negative, deeper color is stronger. Hover a cell for three decimals.
- Check concentration and conditioning: a first-eigenvalue share above 60% means one factor dominates, and a condition number above 1,000 (or an eigenvalue near 0) means some series are near-duplicates.
- Drop or merge the redundant series (the demo's clone_of_momentum shows the pattern) and re-run to see effective N rise.
Questions people ask
How is correlation computed?
Sample Pearson correlation on the columns you upload: cov(x, y) / (σx · σy), with n − 1 in both the covariance and the standard deviations. There is no rank (Spearman) option. Upload periodic returns rather than price levels; trending prices produce high correlations that say little about diversification.
What does shrinkage do?
The tool does not shrink the matrix; it reports the raw sample correlation. Shrinkage estimators such as Ledoit-Wolf pull noisy estimates toward a simpler target and matter most when the number of assets approaches the number of observations. If you see a very large condition number or an eigenvalue near zero here, that is the situation where a shrunk matrix would be safer for portfolio optimization.
Why is the diagonal sometimes not exactly 1.0?
It always is: the matrix is unshrunk, so every series correlates exactly 1 with itself, and the heatmap shows a dot on the diagonal instead of the number. The eigenvalues therefore always sum to the number of series.
How many observations do I need?
The tool requires at least 30 rows. Beyond that, the matrix is only invertible when you have more observations than series; with close to as many series as rows, the smallest eigenvalue heads to zero and the condition number explodes. Several hundred daily rows give much more stable estimates than a few dozen.
Why are some clusters in the heatmap obvious and others not?
The heatmap keeps your column order; it does not reorder or cluster assets. Put related columns next to each other in the CSV to see blocks. For a numeric read on concentration, use the first-eigenvalue share and the effective number of independent bets: a share above 60% means one common factor dominates.
Related tools
- Calculators Efficient Frontier Calculator
Paste a multi-asset returns CSV. See the Markowitz mean-variance frontier, the minimum-variance portfolio, the max-Sharpe (tangency) portfolio.
- Calculators Risk-Adjusted Returns Calculator
Paste a returns CSV. Sharpe, Sortino, Calmar, Omega, alpha, beta, tracking error, information ratio, max drawdown, and tail moments — plus.
- Calculators Kelly Criterion Calculator
Size positions with full, half, quarter, or eighth Kelly and stress-test the choice with a drawdown Monte Carlo simulator. Client-side. Private by default.
Articles
- 7 min read Markowitz 1952 Portfolio Selection: A Worked Example
Markowitz 1952 Portfolio Selection on a real stocks/bonds/gold tape: the E-V rule, why variance holds diversification, and a live efficient frontier.
- 9 min read How to Read a Backtest Report: 2026 Cheat Sheet
Five questions a backtest report must answer — edge real, persistent, cheap to trade, bearable, explainable — with the statistics that verify each.
- 11 min read Multi-Timeframe Signal Integration With LLMs
LLMs belong on weekly fundamentals, not intraday microstructure. A two-layer architecture: weekly LLM thesis plus rule-based intraday invalidation gates.
Workflows that use this tool
- Workflow Size your bets
Compute Kelly fraction, drawdown bounds, and correlated exposure across a book.
Use it from code
The same calculation as a JavaScript module you can import. It runs where you import it, with no request, key or rate limit.
import { compute } from "https://aifinhub.io/engines/correlation-matrix-visualizer.js";