Skip to content

    Under active development. New calculators and features ship every week. Everything currently runs free while the site matures — pricing pages are a preview, checkout is not open yet.

    Finance / Mean-variance portfolio optimization with a closed-form efficient frontier

    Efficient Frontier Calculator — Markowitz Optimization

    Build the Markowitz efficient frontier for three assets: minimum-variance weights, global minimum variance and tangency portfolios, and target allocations.

    ToolCalculatorExecutionIn browserCategoryFinancial
    ZORVLABS · PORTFOLIO FRONTIER

    Markowitz Efficient Frontier Optimization Matrix

    Exact mean-variance frontier, tangency allocation, global minimum variance portfolio, the covariance matrix, and a utility surface over the weight simplex.
    Numerical Integrity
    closed-form frontier
    Analytic A/B/C/D frontier, exact GMV, exact tangency.
    Target return
    0.0750
    Closest analytic frontier point
    Target vol
    0.0772
    σ from A/B/C/D frontier
    Target utility
    0.0661
    μ - λσ²/2
    Target Sharpe
    0.5185
    (μ - r_f)/σ
    GMV return
    0.0530
    Global minimum variance portfolio
    GMV vol
    0.0545
    1 / √A
    Tangency return
    0.0798
    Σ⁻¹(μ-r_f1) normalized
    Tangency Sharpe
    0.5209
    Capital allocation line slope
    View mode
    Surface mode
    Frontier regime
    Show feasible cloudON
    Risk-free rate r_f
    Risk aversion λ
    Target return
    Asset parameters
    Asset 1 μ
    Asset 1 σ
    Asset 2 μ
    Asset 2 σ
    Asset 3 μ
    Asset 3 σ
    Correlation matrix
    Corr(1,2)
    Corr(1,3)
    Corr(2,3)
    Frontier resolution
    Simplex resolution
    A constant
    336.70689
    1ᵀΣ⁻¹1
    B constant
    17.84493
    1ᵀΣ⁻¹μ
    C constant
    1.10805
    μᵀΣ⁻¹μ
    D constant
    54.64567
    AC − B²
    Efficient frontier: σ²(μ_p) = (A μ_p² − 2B μ_p + C)/D
    GMV weights: w_GMV = Σ⁻¹1 / (1ᵀΣ⁻¹1)
    Tangency: w_T ∝ Σ⁻¹(μ − r_f1)
    Covariance and correlation matrix
    Exact risk coupling from volatilities and correlations
    Covariance ΣA1A2A3A1A2A30.0260.0020.0030.0020.0040.0000.0030.0000.014Correlation ρA1A2A3A1A2A31.0000.2200.1500.2201.0000.0500.1500.0501.000
    2D efficient frontier
    Exact mean-variance frontier with capital allocation line and target point
    Expected return vs volatilityVolatility σExpected return E[R]0.0540.0760.0980.1200.1420.1630.04500.05600.06700.07800.08900.1000Feasible cloudr_f
    GMV • 0.0545 / 0.0530
    Tangency • 0.0860 / 0.0798
    Target • 0.0772 / 0.0750
    3D simplex surface
    Objective surface over the long-only weight simplex
    3D utility surface U(w₁,w₂) over the long-only simplexw₁w₂Usurface grid55 × 55 cells · max U = 0.072888
    Source equations
    Markowitz (1952), mean-variance frontier, and risk-free extension
    Portfolio mean: E[R_p] = wᵀμ.
    Portfolio variance: Var(R_p) = wᵀΣw.
    Efficient frontier: σ²(μ_p) = (Aμ_p² − 2Bμ_p + C)/D.
    Global minimum variance: w_GMV = Σ⁻¹1 / (1ᵀΣ⁻¹1).
    Tangency portfolio: w_T ∝ Σ⁻¹(μ − r_f1), the one-fund separation theorem with a risk-free asset.
    Portfolio weights
    Exact weights for the current target-return point
    w₁
    29.51%
    Equity
    w₂
    31.11%
    Bond
    w₃
    39.38%
    Commodity
    Frontier diagnostics
    Target-return optimization metrics
    Target utility
    0.06608
    μ - λσ²/2
    Target Sharpe
    0.51846
    (μ - r_f)/σ
    GMV variance
    0.00297
    1/A
    Tangency weight sum
    1.000000
    normalized to 1
    finance methodology

    A clear path from inputs to results.

    For do-it-yourself portfolio builders and students of modern portfolio theory who want to see the exact trade-off between risk and return. Enter expected returns, volatilities, and pairwise correlations for three assets, and the calculator computes the closed-form Markowitz efficient frontier, the global minimum variance and tangency portfolios, and the exact weights for your target return. The decision it supports is which mix of assets buys your return goal with the least variance.

    Step-by-step methodWorked exampleAssumptions explained

    How to use

    1. Set the expected return and volatility for each of the three assets with the sliders.
    2. Enter the three pairwise correlations; together with the volatilities they build the covariance matrix shown in the heatmap.
    3. Set the risk-free rate, the risk-aversion coefficient lambda used by the utility surface, and the target return you want the portfolio to hit.
    4. Read the A, B, C, D frontier constants and the two special portfolios: the global minimum variance portfolio and the tangency (maximum-Sharpe) allocation.
    5. Read the target block: the exact weights, volatility, Sharpe ratio, and utility of the frontier point closest to your target return.
    6. Switch the 3D surface between utility and variance to see the objective over the long-only weight simplex, and use the balanced, conservative, or growth presets as starting points.

    The formula

    σp2(μp)=Aμp2−2Bμp+CD,A=1⊤Σ−11,  B=1⊤Σ−1μ,  C=μ⊤Σ−1μ,  D=AC−B2\sigma_p^2(\mu_p) = \frac{A\mu_p^2 - 2B\mu_p + C}{D}, \qquad A = \mathbf{1}^{\top}\Sigma^{-1}\mathbf{1}, \; B = \mathbf{1}^{\top}\Sigma^{-1}\mu, \; C = \mu^{\top}\Sigma^{-1}\mu, \; D = AC - B^2

    Reference: Markowitz, H. (1952), "Portfolio Selection", Journal of Finance 7(1); closed-form frontier constants following Merton (1972), "An Analytic Derivation of the Efficient Portfolio Frontier".

    Worked example

    Three-asset frontier: equity, bond, and commodity

    Inputs
    • Expected returns 10%, 4.5%, and 8%; volatilities 16%, 6%, and 12%; correlations 0.22 (equity-bond), 0.15 (equity-commodity), 0.05 (bond-commodity); risk-free rate 3.5%; risk aversion 3; target return 7.5%.
    Calculation path
    1. 1

      Building the covariance matrix from the volatilities and correlations and inverting it gives the frontier constants A = 336.707, B = 17.845, C = 1.108, and D = 54.646. The global minimum variance portfolio holds 3.1% equity, 78.9% bond, and 18.0% commodity, earning 5.30% with 5.45% volatility (exactly 1/sqrt(A)). The tangency portfolio, proportional to the inverse-covariance-weighted excess returns, holds 35.2% / 20.8% / 44.0% and earns 7.98% at 8.60% volatility, a Sharpe ratio of 0.521. Hitting the 7.5% target exactly requires weights of 29.5% / 31.1% / 39.4%, which costs 7.72% volatility — Sharpe 0.518 and utility 0.0661 at lambda = 3.

    Result

    GMV: 5.45% volatility at a 5.30% return. Tangency: 8.60% volatility at 7.98% (Sharpe 0.52). The 7.5% target costs 7.72% volatility with weights 29.5% equity, 31.1% bond, 39.4% commodity.

    Interpreting the result

    The frontier is the set of portfolios with the least variance for each expected return; anything to its right is dominated. The global minimum variance portfolio is the risk floor, the tangency portfolio maximizes the Sharpe ratio once a risk-free asset exists, and the gap between your target point and the tangency point is the efficiency you give up by insisting on a specific return. Weights are exact for the inputs given, so the practical question is how much you trust those inputs — especially the expected returns.

    Assumptions & limitations

    • Expected returns, volatilities, and correlations are user-supplied point estimates, and estimation error in expected returns propagates strongly into the optimal weights.
    • The analytic frontier solves the unconstrained problem, so individual weights may be negative; the 3D surface only samples long-only weights on the unit simplex w1 + w2 + w3 = 1.
    • Single-period model with a static covariance matrix; the covariance built from your inputs must be positive definite for the inverse to exist.
    • No transaction costs, taxes, minimum lot sizes, or cardinality constraints; rebalancing to frontier weights is assumed frictionless.
    • Utility is the mean-variance form U = mu - (lambda/2) x sigma squared, a good description of preferences when returns are roughly normally distributed.

    Frequently asked questions

    Why does diversification bend the frontier?

    Portfolio variance is wᵀΣw, and the cross terms enter with pairwise correlations. When correlations are below 1, combining assets cancels part of each one’s risk, so a blend can be less volatile than its least volatile component. The lower the correlations, the deeper the bend toward the low-volatility side of the chart.

    What is the global minimum variance portfolio?

    It is the feasible portfolio with the smallest possible variance, with weights equal to the inverse covariance matrix applied to a vector of ones, normalized. Its volatility is 1/sqrt(A). Notably it requires no expected-return estimates at all — only the covariance matrix — which is one reason it tends to be more stable out of sample than return-targeted portfolios.

    What does the risk-aversion coefficient lambda do?

    The utility surface ranks portfolios by U = mu - (lambda/2) x sigma squared, where lambda sets how much expected return you would give up to avoid variance. A higher lambda tilts preferences toward low-variance corners of the simplex, while a lambda near zero flattens the surface toward return-chasing. The target-point utility shown in the diagnostics uses this same coefficient.

    What is the tangency portfolio?

    With a risk-free asset available, the best risky portfolio is the one whose straight line from the risk-free rate touches the frontier at exactly one point — the maximum-Sharpe portfolio. Its weights are proportional to the inverse covariance matrix applied to excess returns, normalized to sum to one. Every investor can then mix that one portfolio with lending or borrowing, which is the one-fund separation theorem.

    Why do the results react so strongly to my expected-return inputs?

    Mean-variance optimization is often called an error maximizer: small differences in estimated returns tilt the inverse-covariance weights aggressively, while volatilities and correlations are comparatively well measured. Expected returns are the hardest quantity in finance to estimate. Nudging each expected return slightly and watching how the tangency weights move is a worthwhile robustness check before acting on any allocation.

    Does the optimizer allow short positions?

    The closed-form frontier constants solve the unconstrained problem, so frontier weights can go negative when a target return or the tangency logic calls for it. The 3D surface, by contrast, only samples long-only portfolios with weights that sum to one. Imposing long-only limits on the frontier itself changes the optimization and requires a numerical solver rather than the closed-form solution shown here.

    Methodology last reviewed 2026-10-06. Results are informational and not financial or engineering advice — see our disclaimer.