[SciPy-User] Alternatives to scipy.optimize

Gregor Thalhammer gregor.thalhammer at gmail.com
Sun Feb 26 06:15:52 EST 2012


Am 26.2.2012 um 03:21 schrieb Erik Petigura:

> Thanks for getting back to me!
> 
> I'd like to minimize p1 and p2 together.  Let me try to describe my problem a little better:
> 
> I'm trying to fit an exoplanet transit light curve.  My model is a box + a polynomial trend.
> 
> https://gist.github.com/1912265
> 
> The polynomial coefficients and the depth of the box are linear parameters, so I want to fit them using linear least squares.  The center and width of the transit are non-linear so I need to fit them with an iterative approach like optimize.fmin.  Here's how I implemented it.
> 
> https://gist.github.com/1912281
> 

I didn't look in detail at your code, but it seems to me the approach described e.g. in 
Separable NonLinear Least Squares would be a good choice for you, especially since you are able to analytically calculate the derivatives. The method is similar to the approach you chose, it first solves a linear least squares problem to determine estimates for the linear parameters. This information is then used to calculate the derivatives (Jacobian) with respect to the nonlinear parameters for an iterative minimization (Levenberq-Marquardt). I have a python implementation, if you are interested, I can share the code - but it's poorly documented.

Gregor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20120226/e9f285de/attachment.html>


More information about the SciPy-User mailing list