Home › Investing & Real Estate › Two-Asset Portfolio Calculator
Two-Asset Portfolio Calculator
Computes the expected return, variance and standard deviation of a two-asset portfolio from the weights, expected returns, standard deviations and correlation, and finds the minimum-variance weight and the diversification benefit.
When to use
You want to see how combining two assets (e.g. stocks and bonds) changes risk and return, or find the weight that minimises portfolio variance.
Do not use when: The portfolio has more than two assets (a covariance matrix is needed) or you want the tangency (maximum Sharpe) portfolio. Informational only; not financial advice.
Formula
wA = weight_a_percent/100, wB = 1 − wA; E[r] = wA·rA + wB·rB; σp² = wA²·σA² + wB²·σB² + 2·wA·wB·ρ·σA·σB; w_min = (σB² − ρ·σA·σB) / (σA² + σB² − 2·ρ·σA·σB); benefit = wA·σA + wB·σB − σp
Markowitz mean-variance arithmetic for two risky assets with no short sales (the minimum-variance weight is clamped to 0–100 %). Inputs are per-period figures in percent; use the same period for returns and deviations. Informational mathematics only; not financial advice.
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
weight_a_percent | number | % | yes | Share of the portfolio in asset A in percent; asset B gets the remainder. Range: ≥ 0, ≤ 100 |
return_a_percent | number | % | yes | Expected return of asset A in percent. Range: ≥ -100, ≤ 1000 |
return_b_percent | number | % | yes | Expected return of asset B in percent. Range: ≥ -100, ≤ 1000 |
std_dev_a_percent | number | % | yes | Volatility of asset A in percent. Range: ≥ 0, ≤ 1000 |
std_dev_b_percent | number | % | yes | Volatility of asset B in percent. Range: ≥ 0, ≤ 1000 |
correlation | number | yes | Correlation coefficient between the two assets' returns (−1 to 1). Range: ≥ -1, ≤ 1 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
expected_return_percent | number | % | wA·rA + wB·rB. |
portfolio_variance | number | %² | wA²·σA² + wB²·σB² + 2·wA·wB·ρ·σA·σB (in percent squared). |
portfolio_std_dev_percent | number | % | Square root of the variance. |
covariance | number | %² | ρ·σA·σB. |
min_variance_weight_a_percent | number | % | (σB² − ρ·σA·σB) / (σA² + σB² − 2·ρ·σA·σB), clamped to 0–100 %. |
min_variance_std_dev_percent | number | % | Portfolio volatility at the minimum-variance weight. |
diversification_benefit_percent | number | % | Weighted average of the two volatilities minus the portfolio volatility (0 when ρ = 1). |
Example
60/40, returns 10/5 %, volatility 20/8 %, ρ 0.2: {"weight_a_percent":60,"return_a_percent":10,"return_b_percent":5,"std_dev_a_percent":20,"std_dev_b_percent":8,"correlation":0.2} → {"expected_return_percent":8,"portfolio_variance":169.6,"portfolio_std_dev_percent":13.02,"min_variance_weight_a_percent":8,"min_variance_std_dev_percent":7.84,"diversification_benefit_percent":2.18}
50/50, returns 8/4 %, volatility 15/5 %, ρ −0.3: {"weight_a_percent":50,"return_a_percent":8,"return_b_percent":4,"std_dev_a_percent":15,"std_dev_b_percent":5,"correlation":-0.3} → {"expected_return_percent":6,"portfolio_variance":51.25,"portfolio_std_dev_percent":7.16,"min_variance_weight_a_percent":16.1,"min_variance_std_dev_percent":4.17,"diversification_benefit_percent":2.84}
GET https://tttkmbb.com/api/v1/calculate/two-asset-portfolio?weight_a_percent=60&return_a_percent=10&return_b_percent=5&std_dev_a_percent=20&std_dev_b_percent=8&correlation=0.2
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/two-asset-portfolio(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/two-asset-portfolio · Markdown: https://tttkmbb.com/investing/two-asset-portfolio.md · JSON definition: https://tttkmbb.com/investing/two-asset-portfolio.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="two-asset-portfolio" - OpenAPI operationId:
calculate_two_asset_portfolio - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Modern portfolio theory (reference)
FAQ
Why is portfolio risk below the weighted average of the two risks?
Unless the correlation is exactly 1, the assets do not fall together, so part of each one's variance cancels; the lower the correlation, the larger the diversification benefit.
What if the minimum-variance formula gives a weight outside 0–100 %?
That would require shorting one asset. The output is clamped to the nearest bound, which is the lowest-variance long-only portfolio.
Related calculators
- Correlation Coefficient Calculator — Estimate the correlation coefficient from two return series.
- Sharpe Ratio Calculator — Risk-adjusted return of the resulting portfolio.
- Descriptive Statistics Calculator — Standard deviation of each asset's returns.