Eureka icon indicating copy to clipboard operation
Eureka copied to clipboard

[Enhancement]: Supplement scipy.optimize.minimize (lsq) fitter with another fast optimizer

Open jbrande opened this issue 2 years ago • 1 comments

Instrument

Light curve fitting (Stages 4-6)

What is your suggestion?

Currently, we use scipy.optimize.minimize to do least-squares fitting in Stage 5. Performance-wise, this works okay, but since we don't (can't?) pre-calculate the Jacobian/Hessian matrices for our transit models, we can't get the uncertainties on the parameters. For certain fitting methods in scipy.optimise.least_squares and scipy.optimize.curve_fit (trf and dogbox), scipy will do this for us, but their performance isn't great.

I think some of the other JWST analysis people are using lmfit, which should let us estimate uncertainties for any arbitrary fitting method.

Error traceback output

No response

What operating system are you using?

No response

What version of Python are you running?

No response

What Python packages do you have installed?

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

jbrande avatar Aug 04 '22 17:08 jbrande

I definitely wouldn't replace scipy.optimize.minimize since it's definitely still a useful tool although certainly imperfect. Adding more methods and more fast methods for estimating uncertainties would be worthwhile though! The issue with least_squares is that you can't easily handle priors and inflate the uncertainties on your photometric precision

taylorbell57 avatar Aug 04 '22 17:08 taylorbell57