[Math] Maximizing the Sharpe ratio by finding the optimal weights

finance

In calculating the Sharpe Ratio:

$S = (\frac{\bar r_p – r_f}{\sigma_p})$

Where:

$\bar r_p$ = Portfolio return (See below)

$r_f$ = Risk free rate = 0.03 (for simplicity)

$\sigma_p$ = Portfolio risk (see below)

Risk formula

$\sigma_p = \sqrt{w_a^2\sigma_a^2 + w_b^2\sigma_b^2 + w_c^2\sigma_c^2 + 2w_aw_cr_{ac}\sigma_a\sigma_c + 2w_aw_cr_{ac}\sigma_a\sigma_c + 2w_bw_cr_{bc}\sigma_b\sigma_c }$

Expected return formula

Expected portfolio return = $\bar r_p$ = $[(a_1*w_a) + (a_2 * w_2) + (a_3*w_3)]$

Actual Question

Is there a way that I could find the optimal $w_a, w_b, w_c$ in order to maximize the Sharpe ratio $S$, given that all other variables are found.

For example, lets say:

$\sigma = \sqrt{w_a^20.442459^2 +w_b^20,14863^2 + w_c^20.440728^2 + 2w_aw_b(0.42471827)(0.442459)(0.1863) + 2w_aw_c(-0.041137487)(0.442459)(0.440728) + 2w_bw_c(0.363033596)(0.14863)(0.440728) } $

&

$\bar r_p = 0.42704379w_a + 0.173767797w_b + 0.217631751w_c$

where $w_a + w_b + w_c = 1 $

What is $S_{max}$ = $w_a w_b w_c$

Best Answer

The most simple procedure is to calculate the Lagrange equations and use a numerical solution procedure to find the weights.

Since the independent variables are the weights the Lagrangian of the system is

$$L(w_1,w_2,w_3,\lambda)=S\big(r_p(w_1,w_2,w_3),\sigma_p(w_1,w_2,w_3)\big)+\lambda(w_1+w_2+w_3-1)$$

Taking the partial derivates wrt independent variables

$$\frac{\partial L}{\partial w_1}=\frac{\partial L}{\partial r_p}\frac{\partial r_p}{\partial w_1}+\frac{\partial L}{\partial \sigma_p}\frac{\partial \sigma_p}{\partial w_1}+\lambda =0$$ $$\frac{\partial L}{\partial w_2}=\frac{\partial L}{\partial r_p}\frac{\partial r_p}{\partial w_2}+\frac{\partial L}{\partial \sigma_p}\frac{\partial \sigma_p}{\partial w_2}+\lambda =0$$ $$\frac{\partial L}{\partial w_3}=\frac{\partial L}{\partial r_p}\frac{\partial r_p}{\partial w_3}+\frac{\partial L}{\partial \sigma_p}\frac{\partial \sigma_p}{\partial w_3}+\lambda =0$$ $$\frac{\partial L}{\partial \lambda}=w_1+w_2+w_3-1 =0$$ From here you may use Newton's method in multi-dimesion to have the numerical solutions for weights.

Related Question