[SciPy-User] help interpreting univariate spline

Elliot Hallmark permafacture@gmail....
Fri Apr 30 15:14:36 CDT 2010

>  (I'll point out that you lose accuracy - possibly a lot of it -
> by converting polynomials from one representation to another.)

error between evaluation of the interpolation and eval of polynomial
is consistently 10^-16.  I don't know if this is huge in computer
world, but it is
quite reasonable to me.  10^-16 is about zero in my view.

 >If all
> you want to do is solve the polynomials, though, scipy already
> provides root-finding functionality in its splines

But I will be using c code through cython to solve for roots, which is
why I want a transparent way to solve the interpolation.

> If you really want the polynomials, though, the tck representation
> scipy uses is semi-standard for representing splines; you may find the
> non-object-oriented interface (splrep, splev, etc.) somewhat less
> opaque in this respect. If you do decide to decipher the results, keep
> in mind that with the knots held fixed, it's a linear representation
> of the space of piecewise-cubic functions, so if you can find
> representations for your basis functions (e.g. 1, x, x**2, x**3) you
> can easily work out the conversion. And since the interpolating spline
> for each of those functions is itself, all you need to do is four
> interpolations on a fixed set of knots.

um, I think this is what I already have done?  But the "semi standard"
spline representation in tck is completely undocumented as far as I
can tell.  The only way to get the polynomial coefficents I can tell
is through evaluating the derivatives.

Do you know what is the meaning of the coefficents splrep generates?
How could such a small set of coefficents represent all the
information of a cubic function?

More information about the SciPy-User mailing list