Skip to main content
aifinhub

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 →

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

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.

Risk-free (ann)%

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

Full calculator guide →
  1. 1

    Upload return series for each asset (rows = time periods, columns = assets). Minimum 60 observations per asset for stable covariance estimation.

  2. 2

    Pick constraints: long-only, max-weight per asset, minimum-position threshold.

  3. 3

    Compute the frontier. Read max-Sharpe portfolio (tangency), min-variance portfolio, and the curve between them.

  4. 4

    Toggle Ledoit-Wolf shrinkage on. Shrinkage reduces noise in the covariance matrix and stabilizes weights.

  5. 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

All glossary →

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).

Complementary tools

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