
I'd like to have Akima interpolation in scipy.interpolate, as I couldn't find any. 1.) Did I miss something and there actually *is* an Akima interpolation in scipy? 2.) Is there interest in having Akima interpolation in Scipy? 3.) Does anyone have a good recommendation which implementation I should consider for pulling into Scipy? -- Andreas.

On 8/29/13, Andreas Hilboll <lists@hilboll.de> wrote:
I'd like to have Akima interpolation in scipy.interpolate, as I couldn't find any.
1.) Did I miss something and there actually *is* an Akima interpolation in scipy?
I don't see it anywhere in scipy.
2.) Is there interest in having Akima interpolation in Scipy?
Yes, it would be a good addition to scipy.
3.) Does anyone have a good recommendation which implementation I should consider for pulling into Scipy?
A search for "python akima" turns up Christoph Gohlke's implementation: http://www.lfd.uci.edu/~gohlke/code/akima.py.html The comments say it is based on a Matlab version by N. Shamsundar, which is here: http://www.mathworks.com/matlabcentral/fileexchange/1814-akima-interpolation Warren
-- Andreas. _______________________________________________ SciPy-Dev mailing list SciPy-Dev@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-dev

This could be a useful source: http://www.alglib.net/interpolation/spline3.php

On Tue, Sep 10, 2013 at 11:33 AM, Neal Becker <ndbecker2@gmail.com> wrote:
This could be a useful source:
It looks like GPL. http://www.alglib.net/faq.php """
Can I distribute ALGLIB Free Edition as a part of a commercial application?
Almost surely - no. """ I'm pretty sure scipy will only accept things that Enthought and Continuum Analytics can distribute as part of their commercial applications, so this probably won't work.

On Tue, Sep 10, 2013 at 4:40 PM, alex <argriffi@ncsu.edu> wrote:
On Tue, Sep 10, 2013 at 11:33 AM, Neal Becker <ndbecker2@gmail.com> wrote:
This could be a useful source:
It looks like GPL. http://www.alglib.net/faq.php
"""
Can I distribute ALGLIB Free Edition as a part of a commercial
application?
Almost surely - no.
"""
I'm pretty sure scipy will only accept things that Enthought and
Continuum Analytics can distribute as part of their commercial applications, so this probably won't work. Neither Enthought nor Continuum Analytics control this policy. But yes, scipy is a roughly-BSD-licensed project and does not accept code with significantly more restrictive licenses. -- Robert Kern

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 29.08.2013 19:01, Andreas Hilboll kirjoitti:
I'd like to have Akima interpolation in scipy.interpolate, as I couldn't find any.
1.) Did I miss something and there actually *is* an Akima interpolation in scipy? 2.) Is there interest in having Akima interpolation in Scipy? 3.) Does anyone have a good recommendation which implementation I should consider for pulling into Scipy?
1) I don't think so, unless pchip is related. 2) Perhaps. Is it useful? 3) No idea. One thing to look out: based on a quick look, Akima interpolation is a form of spline interpolation, so it is probably possible to represent the result as a B-spline. If so, FITPACK's spline representation should be used, i.e., the same (t, c, k) format as in splrep. This allows reusing `splev` for evaluating the spline values, which will make life easier later on when we clean up scipy.interpolate. Pauli -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlIgxQ0ACgkQ6BQxb7O0pWDtqACguWczQGk+t/77wvE563iCpoaQ bkQAn3mhFX+RWCdNXTpze8dVNAoE3Hl8 =T78D -----END PGP SIGNATURE-----

On 30.08.2013 18:15, Pauli Virtanen wrote:
29.08.2013 19:01, Andreas Hilboll kirjoitti:
I'd like to have Akima interpolation in scipy.interpolate, as I couldn't find any.
1.) Did I miss something and there actually *is* an Akima interpolation in scipy? 2.) Is there interest in having Akima interpolation in Scipy? 3.) Does anyone have a good recommendation which implementation I should consider for pulling into Scipy?
1) I don't think so, unless pchip is related.
2) Perhaps. Is it useful?
I would claim yes. Akima splines are more robust to outliers, and I think they would make a nice addition
3) No idea.
One thing to look out: based on a quick look, Akima interpolation is a form of spline interpolation, so it is probably possible to represent the result as a B-spline. If so, FITPACK's spline representation should be used, i.e., the same (t, c, k) format as in splrep.
This allows reusing `splev` for evaluating the spline values, which will make life easier later on when we clean up scipy.interpolate.
I agree it would be nice to store the spline in the same tck format as used by FITPACK. Unfortunately, all references I could find directly compute the polynomial coefficients of the interpolants, and I couldn't find a refernce about how to derive the B-spline coefficients, i.e., the c, from the polynomial coefficients. I checked the bspline work by Chuck, but there isn't any B-spline coeffient calculation from the pp representation (yet?). Any ideas where to look? Andreas.

Andreas Hilboll <lists <at> hilboll.de> writes: [clip]
I agree it would be nice to store the spline in the same tck format as used by FITPACK. Unfortunately, all references I could find directly compute the polynomial coefficients of the interpolants, and I couldn't find a refernce about how to derive the B-spline coefficients, i.e., the c, from the polynomial coefficients. I checked the bspline work by Chuck, but there isn't any B-spline coeffient calculation from the pp representation (yet?). Any ideas where to look?
In that case, you can format the data in piecewise polynomial form, in terms of coefficients and breakpoints. There's a class named `ppform` in `scipy.interpolate`, and you probably can return an instance of that. I think there is a generic algorithm for converting from that format to B-splines, but the pp representation will also work fine as-is. Unfortunately, the current ppform implementation is crappy (quadratic memory and time requirement in evaluation . . .), and should be rewritten e.g. in Cython. During the scipy sprint @ euroscipy there was discussion about fixing the situation (i.e. make the ppform implementation sane, and deprecate polyint.PiecewisePolynomial, which seems inefficient), but this was not yet done. I think Evgeni Burovski was interested in tackling this, so if you want to also attack the problem, you can coordinate. -- Pauli Virtanen

Christoph Gohlke has a python-friendly implementation: http://www.lfd.uci.edu/~gohlke/code/akima.c.html Quick googling also shows http://code.google.com/p/miyoshi/source/browse/trunk/common/common.f90?r=88 Which seems to be MIT-licensed. Haven't read the code though. On Tue, Sep 10, 2013 at 10:54 AM, Andreas Hilboll <lists@hilboll.de> wrote:
On 30.08.2013 18:15, Pauli Virtanen wrote:
29.08.2013 19:01, Andreas Hilboll kirjoitti:
I'd like to have Akima interpolation in scipy.interpolate, as I couldn't find any.
1.) Did I miss something and there actually *is* an Akima interpolation in scipy? 2.) Is there interest in having Akima interpolation in Scipy? 3.) Does anyone have a good recommendation which implementation I should consider for pulling into Scipy?
1) I don't think so, unless pchip is related.
2) Perhaps. Is it useful?
I would claim yes. Akima splines are more robust to outliers, and I think they would make a nice addition
3) No idea.
One thing to look out: based on a quick look, Akima interpolation is a form of spline interpolation, so it is probably possible to represent the result as a B-spline. If so, FITPACK's spline representation should be used, i.e., the same (t, c, k) format as in splrep.
This allows reusing `splev` for evaluating the spline values, which will make life easier later on when we clean up scipy.interpolate.
I agree it would be nice to store the spline in the same tck format as used by FITPACK. Unfortunately, all references I could find directly compute the polynomial coefficients of the interpolants, and I couldn't find a refernce about how to derive the B-spline coefficients, i.e., the c, from the polynomial coefficients. I checked the bspline work by Chuck, but there isn't any B-spline coeffient calculation from the pp representation (yet?). Any ideas where to look?
Andreas. _______________________________________________ SciPy-Dev mailing list SciPy-Dev@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-dev
participants (7)
-
alex
-
Andreas Hilboll
-
Evgeni Burovski
-
Neal Becker
-
Pauli Virtanen
-
Robert Kern
-
Warren Weckesser