[SciPy-User] Gradient of spline interpolation at a point wrt changing the knot points

Pauli Virtanen pav at iki.fi
Fri Jun 14 17:45:15 EDT 2013


John Salvatier <jsalvatier <at> gmail.com> writes:
> 
> I'm using scipy.interpolate.InterpolatedUnivariateSpline in a statistical 
application. 
> y = InterpolatedUnivariateSpline(x0,y0)(x)
> 
> I need the derivatives of the spline evaluated at 
> a given point with respect to changing the knot values (y0).
>  That is, I need the derivative of y wrt to y0. Is there
> a way I could compute this?

You can work it out from the B-spline representation:

https://github.com/pv/scipy-work/blob/spline-
unify/scipy/interpolate/_bspline.py#L29

Not that there is ready-made code for it, but it should be
possible to write it.

-- 
Pauli Virtanen




More information about the SciPy-User mailing list