I have the following optimization problem
\begin{align*} \text{given } c_{i, j} & \text{ for } i=1...n, \; j=1...k && \text{adjusted close of stock } j \text{ on day } i \\ \text{find } a_{1:k} & && \text{allocations for each stock} \\ \text{that maximize } s & = \frac{\mu}{\sigma} && \text{the Sharpe ratio} \\ \text{where } \mu & = \frac{1}{n} \sum_{i=1}^n r_i && \text{the sample mean of the daily returns} \\ \sigma &= \sqrt{\frac{1}{n}\sum_{i=1}^n (r_i - \mu)^2} && \text{the sample standard deviation of the daily returns} \\ r_1 & = 0 && \text{the return on day one is zero} \\ r_i & = \frac{p_i}{p_{i-1}} - 1 \;\; \text{for } i=2...n && \text{the percent change in portfolio value on day } i \\ p_i & = a^{\top} c_i && \text{the portfolio value on day } i \\ \text{subject to } a_j & \geq 0 \text{ for } j = 1...k && \text{only non-negative allocations for each stock} \\ \sum_{j=1}^k a_j & = 1 && \text{expressed as a percentage of a total budget} \end{align*}
One way I tried solving this was simply setting $a_{1:k} = \texttt{softmax}(w_{1:k})$ or $a_{1:k} = \frac{\texttt{relu}(w_{1:k})}{\texttt{sum}(\texttt{relu}(w_{1:k}))}$, for some latent variables $w_{1:k}$, and then running gradient ascent using TensorFlow. Both work well in practice, but I'm wondering if there is a better way (i.e., something with guaranteed convergence to the global maximum).