tBuLi / symfit

Symbolic Fitting; fitting as it should be.
http://symfit.readthedocs.org
MIT License
233 stars 17 forks source link

Implement trust-constr wrapper #189

Closed pckroon closed 5 years ago

pckroon commented 5 years ago

This implements the trust-constr method from scipy. They advertise it as the most robust/flexible/powerfull minimizer in their arsenal. It's kind of tricky to make it play ball, but I think this should work in most cases.

pckroon commented 5 years ago

Also, if this works as intended/promised, we can consider simplifying Fit by making it always use trust-constr. Lastly, it may be worthwhile to also generate the Hessian analytically.

tBuLi commented 5 years ago

In light of #195, I think it is best that I first complete and merge that one, and then I can experiment with doing a rebase of this PR on that new master.

As a general question, a lot of the methods now inherit from BoundedMinimizer, even though they do not support bounds according to the scipy docs. Why is that?

pckroon commented 5 years ago

Waiting for #195 to be merged and rebasing on that works for me.

I was under the impression that all scipy minimizers could deal with bounds. But apparently not. Note that this does not lead to failing tests...

tBuLi commented 5 years ago

Merged. One thing this PR made very obvious though, is that we need to take another look at the minimizer structure. I'll open a new issue where we can discuss this.

pckroon commented 5 years ago

Completely agree. Please copy some of the discussion/ideas we've had on that here to that issue. Should save us some work.

pckroon commented 5 years ago

Oh, and thanks for the help in polishing this :)

tBuLi commented 5 years ago

You're welcome, implementing this was a good move.