HomeInvesting & 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

ParameterTypeUnitRequiredDescription
weight_a_percentnumber%yesShare of the portfolio in asset A in percent; asset B gets the remainder. Range: ≥ 0, ≤ 100
return_a_percentnumber%yesExpected return of asset A in percent. Range: ≥ -100, ≤ 1000
return_b_percentnumber%yesExpected return of asset B in percent. Range: ≥ -100, ≤ 1000
std_dev_a_percentnumber%yesVolatility of asset A in percent. Range: ≥ 0, ≤ 1000
std_dev_b_percentnumber%yesVolatility of asset B in percent. Range: ≥ 0, ≤ 1000
correlationnumberyesCorrelation coefficient between the two assets' returns (−1 to 1). Range: ≥ -1, ≤ 1

Outputs

OutputTypeUnitDescription
expected_return_percentnumber%wA·rA + wB·rB.
portfolio_variancenumberwA²·σA² + wB²·σB² + 2·wA·wB·ρ·σA·σB (in percent squared).
portfolio_std_dev_percentnumber%Square root of the variance.
covariancenumberρ·σA·σB.
min_variance_weight_a_percentnumber%(σB² − ρ·σA·σB) / (σA² + σB² − 2·ρ·σA·σB), clamped to 0–100 %.
min_variance_std_dev_percentnumber%Portfolio volatility at the minimum-variance weight.
diversification_benefit_percentnumber%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

Sources

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