[SciPy-user] Re: SciPy-user Digest, Vol 22, Issue 3

aurelien.gourrier at free.fr aurelien.gourrier at free.fr
Tue Jun 28 11:36:21 EDT 2005


OK, I'll try the different suggested ways,

Many thanks to all :-)

Cheers,

Aure



Quoting John Hunter <jdhunter at ace.bsd.uchicago.edu>:

> >>>>> "aurelien" == aurelien gourrier <aurelien.gourrier at free.fr> writes:
>
>     aurelien> Hi all, Can anyone tell me if there is a possibility to
>     aurelien> use constraints on the leastsq method ? I need to do
>     aurelien> some bounded minimization of gaussians or lorentzians on
>     aurelien> 1-D data and couldn't find any way out so far...
>
>
> scipy.optimize.fmin_l_bfgs_b takes an optional bounds argument, which
> is a list of min/max values for each parameter, and you can use None
> to specify unbounded, eg
>
>   guess = 1.0, -.4, 0.01
>   bounds = [ (0., 4.), (None, 0.), (0., .2) ]
>   best, val, d = fmin_l_bfgs_b(func, guess, bounds=bounds)
>
> JDH
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
>





More information about the SciPy-User mailing list