I was testing the notebook published under the forum topic: "MAD Portfolio an alternative to Markowitz?" I ran into an issue with the optimizer for various portfolio combinations. The portfolio would be divided evenly among all the securities. I have provided a basic example with just 2 securities. The NNLS optimizer believes that the result is successful. It allocates 50% of the portfolio to each of the 2 securities, SPY and BND.
I ran a brute force optimization to prove that this wasn't correct. I used the MAD results from the brute force optimizer to plot MAD vs. percentage of SPY. With only 2 securities, there are no local minima issues to trap the optimizer. Note the weights generated by the brute force optimization are far from the 50% allocation. Note also that the MAD at the 50% point reported by the NNLS optimizer matches the value on the MAD curve that I plotted.
I reallize that utilizing the brute force optimizer is NOT the solution to this issue. I merely used it as a tool to demonstrate the problem that I encountered with the default NNLS optimizer used by scipy.optimize in the notebook provided by James Christopher.
I haven't looked at any parameterization which might be avlailable for the NNLS optimizer or alternative optimizers yet. Perhaps the gradient isn't steep enough. I'll look to see what optimizer parameters might be adjustable.
Does anyone know what went wrong?