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.
--
Pauli Virtanen
_______________________________________________
SciPy-User mailing list
SciPy...@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user
21.11.2011 17:29, Lynn Oliver kirjoitti:
> I'm converting a MatLab program to Python, and I'm having problemsWith cubic splines, there is freedom in choosing the interpolants, so
> understanding why scipy.interpolate.interp1d is giving different results
> than MatLab interp1.
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.
It's not only the boundary conditions: you can also make a choice
whether you want C2 contiguity, or if you stick with C1 which gives you
more freedom to play around with other things such as monotonicity.
21.11.2011 19:13, Charles R Harris kirjoitti:
[clip]
> The boundary conditions can make a difference. I expect, given De Boor'sIt's not only the boundary conditions: you can also make a choice
> 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.
whether you want C2 contiguity, or if you stick with C1 which gives you
more freedom to play around with other things such as monotonicity.