Asset Allocation Calculator — Efficient Frontier & CAL
Find your optimal portfolio mix: efficient frontier, tangency portfolio, capital allocation line, and the risky share that fits your risk tolerance.
Capital Allocation Matrix
σp2 = wTΣw
U(w) ≈ wTμ − (λ/2)wTΣw
E[Rc] = rf + y(E[RT] − rf)
σc = |y|σT
A clear path from inputs to results.
Decide how much of your portfolio belongs in risky assets versus cash or bonds. Enter expected returns, volatilities, and correlation for two assets plus a risk-free rate, and the matrix maps the efficient frontier, the tangency portfolio, the capital allocation line, and the utility-maximizing risky share for your level of risk aversion.
How to use
- Enter each asset's expected annual return and volatility — Asset A defaults to 10.2% return with 14.5% volatility, Asset B to 16.8% with 23.5%.
- Set the correlation between the two assets from −0.95 to 0.95; lower correlation bends the frontier toward lower-risk blends.
- Set the risk-free rate available on the safe asset.
- Set your risk-aversion coefficient A (higher means more conservative) and, if you want to explore leverage, the maximum risky allocation shown on the capital allocation line.
- Read the tangency weights and Sharpe ratio, the optimal risky share y*, and your utility at that share.
- Use the utility heatmap and 3D surface to see how the best allocation shifts as risk aversion changes.
The formula
Reference: Markowitz (1952) mean-variance portfolio selection; Tobin (1958) separation theorem; two-asset tangency weights from the inverse covariance matrix; quadratic (mean-variance) utility.
Worked example
A balanced two-asset mix at moderate risk aversion
- Asset A: 10.2% expected return, 14.5% volatility; Asset B: 16.8% return, 23.5% volatility; correlation 0.32; risk-free rate 4.5%; risk aversion A = 4.5.
- 1
The covariance is 0.32 × 0.145 × 0.235 = 0.010904. Applying the inverse of the 2×2 covariance matrix to the excess returns and normalizing the result gives tangency weights of 47.9% in A and 52.1% in B. That portfolio's expected return is 0.479 × 10.2% + 0.521 × 16.8% = 13.64%, its variance works out to 0.02525, so volatility is 15.89% and the Sharpe ratio is (13.64% − 4.5%) ÷ 15.89% = 0.575. The optimal risky share is y* = (13.64% − 4.5%) ÷ (4.5 × 0.1589²) = 0.804, so about 80% of capital goes into the tangency mix and 20% stays at the risk-free rate, producing utility of 0.0817.
Tangency portfolio 47.9% Asset A / 52.1% Asset B; E[R_T] = 13.64% with σ_T = 15.89% and Sharpe 0.575; optimal risky share y* = 0.80 (utility 0.0817).
Interpreting the result
The tangency portfolio is the risk-efficient way to hold the two assets — it maximizes return per unit of risk given your inputs. The capital allocation line then scales that mix: y below 1 lends part of the portfolio at the risk-free rate, y above 1 borrows to lever up. Your risk aversion picks the point on the line, and the heatmap's bright ridge traces exactly how that best point slides toward cash as A rises.
Assumptions & limitations
- The model covers two risky assets plus one risk-free asset; expected returns, volatilities, and correlation are annualized point estimates you supply, not forecasts, and results move with them.
- Utility is the standard quadratic (mean-variance) approximation, so it is a ranking device rather than a dollar outcome.
- The frontier sweep allows short positions and leverage (each asset's weight ranges from −50% to +150%), and the allocation line allows borrowing up to the maximum risky share you set.
- No taxes, transaction costs, minimum lot sizes, or rebalancing rules are modeled.
- Volatility is treated as symmetric — upside and downside deviation count identically.
Frequently asked questions
What is the tangency portfolio?
It is the mix of the two risky assets with the highest Sharpe ratio — the point where a line drawn from the risk-free rate just touches the efficient frontier. The engine computes it by applying the inverse covariance matrix to the assets' excess returns; with the default inputs that is 47.9% Asset A and 52.1% Asset B, earning 13.64% with 15.89% volatility and a Sharpe ratio of 0.575.
What does the heatmap show?
Each cell is your quadratic utility for one combination of risk aversion (A) and risky allocation (y). The ridge of highest-utility cells follows y* = (E[R_T] − r_f)/(A·σ_T²), so you can watch the optimal allocation slide toward less risk as A increases.
Why does correlation matter so much?
Correlation controls how much the two assets diversify each other. At the default 0.32, the tangency portfolio's volatility is 15.89%; set the correlation to 0 and the optimal mix blends to a 13.26% volatility at a similar return. Push correlation to 0.9 and the tangency solution swings to a levered long-short combination with 57% volatility — a warning that the optimizer amplifies extreme inputs.
How much should I put in risky assets?
The model's answer is y* = (E[R_T] − r_f) ÷ (A·σ_T²). With the default inputs that is 0.804 at a risk aversion of 4.5 — about 80% in the tangency mix and 20% at the risk-free rate. Raise the risk aversion to 10 and the same formula drops the share to 0.36: the return expectations did not change, only your tolerance did.
Can the model recommend borrowing to invest more?
It maps the option but does not judge it. Allocating more than 100% to the tangency portfolio simulates borrowing at the risk-free rate: at y = 2 with the default inputs, expected return rises to 22.78% but volatility doubles to 31.78%, and a risk-averse investor's utility falls below its peak at y*. The maximum-allocation slider caps how far along that path the chart goes.
Are the expected returns guaranteed?
No — they are your inputs, and the matrix optimizes them mechanically. Mean-variance optimizers are known to be sensitive to small input changes, so treat the output as a structured way to test scenarios — change one number and watch the frontier and y* move — rather than as a single correct portfolio.
Methodology last reviewed 2026-10-06. Results are informational and not financial or engineering advice — see our disclaimer.