[SciPy-User] interp1d results vs. MatLab interp1

Charles R Harris charlesr.harris@gmail....
Mon Nov 21 12:13:58 CST 2011


On Mon, Nov 21, 2011 at 9:53 AM, Pauli Virtanen <pav@iki.fi> wrote:

> 21.11.2011 17:29, Lynn Oliver kirjoitti:
> > I'm converting a MatLab program to Python, and I'm having problems
> > understanding why scipy.interpolate.interp1d is giving different results
> > than MatLab interp1.
>
> With cubic splines, there is freedom in choosing the interpolants, so
> there are many different "cubic" spline interpolation schemes.
>
> Matlab's interp1's 'cubic' mode apparently produces a C1 continuous
> spline that is monotonicity-preserving. I don't think such a mode is
> currently implemented in Scipy.
>
>
The boundary conditions can make a difference. I expect, given De Boor's
participation, that the Matlab spline uses not-a-knot boundary conditions
when no other boundary conditions are specified. I'm not sure what interp1d
does.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20111121/70c4b0b4/attachment.html 


More information about the SciPy-User mailing list