Maximizing the Sharpe ratio by finding the optimal weights 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$
 A: 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.
A: Hmmmm... this usually works but there is a subtlety here since the Sharpe ratio is invariant under a uniform scaling of all the weights.  This means that the first term, S, is automatically zero when acted on by the sum of all the partials, while the lagrange multiplier term will not be zero unless  $\lambda=0$. Thus, these equations have no non-trivial solution. In general, lagrange multiplier methods need to be used with caution when a symmetry is present.  A better method is to use the standard trick to undo the square root by writing $\frac{1}{2} S^{2}=-\frac{1}{2}\lambda^{2} \sigma^{2}-\lambda r$ and then minimizing w.r.t $\lambda$ and the weights.
