Approximating scattered data

Discussion in 'Python' started by Grant Edwards, Jan 1, 2005.

  1. I've been looking for some way to approximate scattered 3D data
    points in Python. The data doesn't seem to be amenable to
    fitting functions like polymials, so I may have to use
    something more like a spline surface.

    However, I can't find anything usable from Python, and my
    Fortram skills are pretty rusty. I tried SciPy, but it's spline
    fitting module doesn't work at all for my data. I've found
    mentions of a Python port NURBS toolbox, but all the links I
    can find are broken.

    I've also found references to Fortran programs from
    netlib/toms, but I was hoping there might be something that was
    already usable from Python.

    Can anybody point me toward a Python module for approximating
    scattered data using something like a Renka algorithm?

    --
    Grant Edwards grante Yow! How do I get HOME?
    at
    visi.com
    Grant Edwards, Jan 1, 2005
    #1
    1. Advertising

  2. Grant Edwards

    Guest

    Grant Edwards wrote:
    >I've been looking for some way to approximate scattered 3D data
    >points in Python. The data doesn't seem to be amenable to
    >fitting functions like polymials, so I may have to use
    >something more like a spline surface.


    >However, I can't find anything usable from Python, and my
    >Fortram skills are pretty rusty. I tried SciPy, but it's spline
    >fitting module doesn't work at all for my data. I've found
    >mentions of a Python port NURBS toolbox, but all the links I
    >can find are broken.


    NURBS is available in Matlab and Scilab at
    http://www.aria.uklinux.net/nurbs.php3 , and translating to Python with
    Numeric/Numarray should not be too hard.

    If you are trying to fit z = f(x,y) without having a particular
    functional form in mind, you can apply a nonparametric regression
    technique. One of the easiest approaches to code is Nadaraya-Watson
    kernel regression -- see for example
    http://www.quantlet.com/mdstat/scripts/spm/html/spmhtmlnode24.html ,
    equation 4.68, where a Gaussian kernel can be used for K. PyML at
    http://pyml.sourceforge.net/doc/tutorial/tutorial.html may implement
    this (I have not tried it). LIBSVM at
    http://www.csie.ntu.edu.tw/~cjlin/libsvm/ has a Python interface for
    Support Vector Machines, a fairly popular and recent flexible
    regression method.
    , Jan 2, 2005
    #2
    1. Advertising

  3. On 2005-01-02, <> wrote:

    >>However, I can't find anything usable from Python, and my
    >>Fortram skills are pretty rusty. I tried SciPy, but it's spline
    >>fitting module doesn't work at all for my data. I've found
    >>mentions of a Python port NURBS toolbox, but all the links I
    >>can find are broken.

    >
    > NURBS is available in Matlab and Scilab at
    > http://www.aria.uklinux.net/nurbs.php3 , and translating to
    > Python with Numeric/Numarray should not be too hard.


    Right. It says there's a Python module for the NURBS toolkit,
    but there's nothing about NURBS on the page to which the link
    points. Googling for Python and NURBS toolkit doesn't find
    anything else.

    > If you are trying to fit z = f(x,y) without having a particular
    > functional form in mind, you can apply a nonparametric regression
    > technique. One of the easiest approaches to code is Nadaraya-Watson
    > kernel regression -- see for example
    > http://www.quantlet.com/mdstat/scripts/spm/html/spmhtmlnode24.html ,
    > equation 4.68,


    Well, I can see it, but that's about it... :)

    > where a Gaussian kernel can be used for K. PyML at
    > http://pyml.sourceforge.net/doc/tutorial/tutorial.html may
    > implement this (I have not tried it).


    Thanks, I'll take a look.

    > LIBSVM at http://www.csie.ntu.edu.tw/~cjlin/libsvm/ has a
    > Python interface for Support Vector Machines, a fairly popular
    > and recent flexible regression method.


    I'll give that a look also.

    One of the important considerations is the efficiency of
    evaluating the approximating function (calculating z given x
    and y). That code is going to be running on a rather slow
    processor w/o floating point HW, and if the evaluation takes
    more than about 40ms, I'm going to have problems. The
    evaluating the spline surface produced by scipy's FITPACK
    wrapper was fast enough, but I had to force the scattered data
    onto a grid (which introduced errors), and then the spline
    surfaces generated were wildly unstable between the grid
    points.

    --
    Grant Edwards grante Yow! The Korean War must
    at have been fun.
    visi.com
    Grant Edwards, Jan 2, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ram
    Replies:
    1
    Views:
    564
    Mike Treseler
    Feb 24, 2005
  2. AD
    Replies:
    1
    Views:
    1,035
    Francis Shanahan
    Aug 23, 2003
  3. bryo1001

    approximating pi

    bryo1001, Feb 24, 2005, in forum: C++
    Replies:
    7
    Views:
    616
    Karl Heinz Buchegger
    Feb 25, 2005
  4. jb
    Replies:
    1
    Views:
    302
    Andrew McDonagh
    Jun 3, 2006
  5. Daniel Berger

    Scattered I/O (on MS Windows)

    Daniel Berger, Oct 23, 2007, in forum: Ruby
    Replies:
    3
    Views:
    94
    Robert Klemme
    Oct 24, 2007
Loading...

Share This Page