statsmodels/statsmodels — comment on commit 17540867ef660d39bc19e15526adcf342ff2c44b
File:  line 0
By jseabold:

I'm not sure squaring the sigma or using abs is the best way to go for keeping things positive. The numerical derivatives in this case will be the same for sigma and -sigma and possibly make more work for the solver as the best case scenario. If you take the exp(sigma) in the likelihood so that you are optimizing in terms of ln(sigma) then it will push the solution away from the zero lower bound. You just have to adjust everything at the end with a _transparams flag set before and after fit. This is what I've seen suggested and done most elsewhere.