[AstroPy] Bounds in parametric non linear fitting (astropy.modelling)

André Luiz de Amorim streetomon at gmail.com
Mon Jul 1 08:45:52 EDT 2013

Hi, I am using NonLinearLSQFitter and SLSQPFitter to fit some data to a
parametric model I implemented. I am trying to set some boundaries in the
parameters, as some values can not be negative. It seems that the bouns are
set correctly, I ran the code in debug mode and
the NonLinearLSQFitter._set_bounds() method is reached, for example. The
code says this fitter accepts boundary constraints, but it does no work in
my tests, the parameters step outside the bounds. In the case
of SLSQPFitter it does not even fit, it returns the initial guess.

Attached is a minimal example showing my approach. I would like to know if
I am using the API correctly before filing a bug report (and/or trying to
fix it :-).


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20130701/75816793/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_bounds.py
Type: application/octet-stream
Size: 3446 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/astropy/attachments/20130701/75816793/attachment.obj>

More information about the AstroPy mailing list