Consider a portfolio of two assets. Asset A has an expected return of µA and a variance in returns of σ2A, whereas asset B has an expected return of µB and a variance in returns of σ2B. The correlation in returns between the two assets, which measures how the assets move together, is ρAB. The expected returns and variance of a two-asset portfolio can be written as a function of these inputs and the proportion of the portfolio going to each asset.
µportfolio = wA µA + (1 − wA) µB
σ2portfolio = wA2 σ2A + (1 − wA)2 σ2B + 2 wA wB ρAB σA σB
wA = Proportion of the portfolio in asset A
The last term in the variance formulation is sometimes written in terms of the covariance in returns between ...