[SciPy-Dev] Algorithms for "best fitting geometries"

Andrew Nelson andyfaff at gmail.com
Tue Mar 11 17:24:46 EDT 2014


On 12 March 2014 05:09, Saullo Castro <saullogiovani at gmail.com> wrote:

> I did not find a "fitting" module. The best I can see is inside the
> "optimize" module. By the way, I find the best fit using the
> "scipy.optimize.leastsq".

It would be nice to have a general purpose fitting class, which would
then rely on 'minimize', or 'leastsq'. When I first started using
scipy (not so long ago) I was surprised at the absence of one.  For
the time being you will have create a chi2 function (which you give to
a minimizer) and marshal the parameters/data yourself.

Perhaps you should try using the lmfit package, which you may find useful.

For myself, I'd find a scipy fitting class really useful, which could
use whatever minimizer you wanted, which could minimize whatever cost
metric you wanted (e.g. MLE), which could hold and release parameters
as required and which could co-refine datasets.  In my field we tend
to co-refine several different datasets at the same time, each of
which have different model functions, but which have linked
parameters.   I have code like this, but it needs improvement before
inclusion in any other package.

A.

_____________________________________
Dr. Andrew Nelson


_____________________________________



More information about the SciPy-Dev mailing list