Efficient Frontier of Risky Assets
Let W represent the vector of the portfolio weights, R the vector of the returns, and \( \Sigma \) the Variance-Covariance matrix. Then the mean and variance of the portfolio can be expressed in matrix notation as follows:
$$ r_{p}= W^{'}R = R^{'}W $$ $$ {\sigma_{p}}^2=W^{'}\Sigma W $$
The portfolio optimisation problem is then to minimise the variance of the portfolio for a given level of return and subject to budget constraint (sum of weights=1):
$$ L \left( W, \lambda, \gamma \right)=\frac{1}{2} W^{'}\Sigma W + \lambda \left( r_{p}-R^{'}W\right)+\gamma \left(1- \mathbf{1}^{'} W \right)$$
Differentiating and setting the derivatives equal to zero, we get
$$ \frac{\partial L \left( W, \lambda, \gamma \right)}{\partial W}=\Sigma W - \lambda R -\gamma \mathbf{1}=0 $$ $$ \frac{\partial L \left( W, \lambda, \gamma \right)}{\partial \lambda}=r_{p}-R^{'}W=0 $$ $$ \frac{\partial L \left( W, \lambda, \gamma \right)}{\partial \gamma}=1- \mathbf{1} ^{'} W =0 $$
We need to solve the three equations for the three unknowns, with W being the ultimate prize. Solving the first equation for W, we get
$$ \Sigma W - \lambda R -\gamma \mathbf{1}=0 $$ $$ W=\lambda \Sigma^{-1}R + \gamma \Sigma^{-1} \mathbf{1} $$
And substituting into the second and the third equations,
$$ r_{p}-R^{'}W=0 $$ $$ r_{p}-R^{'} \left( \lambda \Sigma^{-1}R + \gamma \Sigma^{-1} \mathbf{1} \right)=0 $$ $$ r_{p}=\lambda R^{'} \Sigma^{-1}R + \gamma R^{'} \Sigma^{-1} \mathbf{1} $$
$$ 1- \mathbf{1}^{'}W =0 $$ $$ 1- \mathbf{1}^{'} \left( \lambda \Sigma^{-1}R + \gamma \Sigma^{-1} \mathbf{1} \right) =0 $$ $$ 1= \lambda \mathbf{1}^{'}\Sigma^{-1}R + \gamma \mathbf{1}^{'} \Sigma^{-1} \mathbf{1} $$
The above equations look complicated, but fear not because the intimidating vector/matrix multiplications in the above equations -e.g., \( R^{'} \Sigma^{-1}R \) - produce scalars, and treating them that way by substituting: \( a=\mathbf{1}^{'}\Sigma^{-1}R \), \( b= R^{'} \Sigma^{-1}R \), and \( c=\mathbf{1}^{'} \Sigma^{-1} \mathbf{1}\), we get 2 simple equations for 2 unknowns:
$$ r_{p}= b \lambda + a \gamma $$ $$ 1=a \lambda + c \gamma $$
Subtracting b times the second equation from a times the first equation, and solving for \( \gamma \) , we get
$$ a r_{p}-b = a b \lambda -a b \lambda + a^{2} \gamma - b c \gamma $$ $$ \gamma =\frac{a r_{p}-b}{a^{2} - b c } $$
And subtracting a times the second equation from c times the first equation, and solving for \( \gamma \) , we get
$$ c r_{p}-a = b c \lambda -a^{2} \lambda + a c \gamma - a c \gamma $$ $$ \lambda=\frac{c r_{p}-a}{b c - a^{2} } $$
Thus:
$$ W=\lambda \Sigma^{-1}R + \gamma \Sigma^{-1} \mathbf{1} $$ $$ W=\frac{c r_{p}-a}{b c - a^{2} } \Sigma^{-1}R + \frac{a r_{p}-b}{a^{2} - b c } \Sigma^{-1} \mathbf{1} $$
Where \( a=\mathbf{1}^{'}\Sigma^{-1}R \), \( b= R^{'} \Sigma^{-1}R \), and \( c=\mathbf{1}^{'} \Sigma^{-1} \mathbf{1}\)