[SciPy-dev] least square function fit for vector fields

Bud P.Bruegger bud at sistema.it
Fri Oct 18 10:20:18 CDT 2002


Hello everyone,

I'm new to this list.  I just wrote a module for non-linear least square fit on
top of numeric python and plan to release it under an open source license.
While I looked around for existing sw before coding, and actually looked at
Scipy, I didn't look close enough and missed out on optimize.leastsq...

If I understand leastsq correctly, my module seems to be more general as it
allows to use vector fields as data.  For example, x could be a scalar for time
and y a point in space (this is the case for my application); or x could be a
point in space (x,y,z) and y a vector (such as wind speed).  

My style is a little "heavier" that what you did in leastsq, for example, it
uses custom classes for control points (your data) and parameters.  I use
labels for both parameters, and control points (such as t, x, y, z), and
parameters encapsulate approximation values for the linearization and initial
epsilon used in the numeric derivation.  

The code is alpha and was used only once for fitting ephemeris parameters for
GPS satellite orbits.  I took some shortcuts and quite some cleaning up and
refactoring is needed.  

I'm wondering whether this code could be useful to somebody and whether it
would possibly fit into the scipy package.  You can look at the code at
http://www.sistema.it/fit/.  The two files are the actual code and an
incomplete test suite.  The quickest overview of usage can be found in the last
test of fitTest.py.  

Hoping this is of interest.

Kind regards

--bud

/-----------------------------------------------------------------
| Bud P. Bruegger, Ph.D. 
| Sistema (www.sistema.it)
| Via U. Bassi, 54
| 58100 Grosseto, Italy
| +39-0564-411682 (voice and fax)
\-----------------------------------------------------------------



More information about the Scipy-dev mailing list