Calculator
Efficient Frontier Builder
Markowitz mean-variance frontier: min-variance portfolio, tangency (max-Sharpe) portfolio, per-asset weights. Closed-form, Runs in your browser. Free.
- Inputs
- Form inputs / CSV
- Runtime
- Instant
- Privacy
- Client-side · no upload
- API key
- Not required
- Methodology
- Open →
Upload a multi-asset returns CSV
Wide format: date,asset_1,asset_2,…. Each column is a daily-return series. Minimum 60 observations and 2 assets; maximum 20 assets. Annualisation uses √252. Computation is entirely client-side.
What this tool computes
Classical Markowitz mean-variance optimisation: the efficient frontier, plus the minimum-variance and max-Sharpe (tangency) portfolios, using the closed-form two-fund theorem solution. Load the synthetic four-asset demo or upload your own returns.
How to use
Step-by-step
- 1
Upload return series for each asset (rows = time periods, columns = assets). Minimum 60 observations per asset for stable covariance estimation.
- 2
Pick constraints: long-only, max-weight per asset, minimum-position threshold.
- 3
Compute the frontier. Read max-Sharpe portfolio (tangency), min-variance portfolio, and the curve between them.
- 4
Toggle Ledoit-Wolf shrinkage on. Shrinkage reduces noise in the covariance matrix and stabilizes weights.
- 5
Compare with and without shrinkage. Large weight differences mean the inputs are too noisy for naive Markowitz — use shrinkage or constrain more aggressively.
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/efficient-frontier-builder.js"; Contract: /contracts/efficient-frontier-builder.json Full agent guide →
Glossary references
Terms used by this tool
Questions people ask next
FAQ
How is the frontier constructed?
Quadratic optimization with Markowitz's 1952 mean-variance objective. The tool computes the covariance matrix from your input return series, then solves for portfolio weights that minimize variance at a given target return. Sweeping the target gives the frontier.
Why do the inputs need so many observations?
Covariance estimation is data-hungry. With 10 assets and 60 observations (5 years monthly), the covariance matrix has 55 parameters fit from 60 data points — not enough degrees of freedom for stable estimates. The tool warns at low N. Best practice is 10x observations vs. assets, or use shrinkage.
Does the tool support constraints?
Yes: long-only (no shorting), max-weight per asset (e.g., no more than 30% in one holding), and minimum-position thresholds. The methodology page documents each constraint. Adding constraints reduces the feasible region and shifts the frontier rightward (lower expected return at given risk).
What's wrong with mean-variance optimization?
Two known issues: (1) sensitivity to input estimates — small changes in expected returns produce huge weight swings. (2) underestimation of tail risk — variance ignores skew and kurtosis. The tool lets you toggle a CVaR (Conditional Value at Risk) objective as an alternative. For institutional-grade work, see Black-Litterman or robust optimization.
How are expected returns estimated?
By default, simple historical mean from the input series. The methodology page warns this is a noisy estimator — for medium-sample series, historical mean is barely better than zero. Users can override with their own forward expected-return vector (e.g., from CAPM or analyst estimates).
Related deep dive
All articles →Read further
Long-form context behind the tool output.
- Methodology · Opinion·7 min
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.
Read - Comparison · Benchmark·10 min
Risk Parity vs Kelly: When Each Sizing Framework
Risk parity and Kelly solve different problems. Risk parity wins when correlations are stable and edge is noisy; Kelly wins when edge is concentrated.
Read - Pillar · Guide·10 min
Risk-Adjusted Returns: Benchmark Choice Drives the Report
Engine returns IR 0.708 vs 0.433 and beta 1.246 vs 3.054 on the same returns against two benchmarks. Sharpe is invariant; alpha and IR are not.
Read
Complementary tools
Users of this tool often explore
Correlation Matrix Visualizer
Paste a multi-asset returns CSV. See the Pearson correlation heatmap, condition number, average absolute correlation, and eigenvalue concentration.
Risk-Adjusted Returns Calculator
Paste a returns CSV. Sharpe, Sortino, Calmar, Omega, alpha, beta, tracking error, information ratio, max drawdown, and tail moments — plus.
Fractional Kelly Sizer
Map conviction tiers to fractional Kelly bet sizes with a drawdown Monte Carlo simulator. Client-side. Private by default.