[SciPy-Dev] Splines in Scipy [was: SciPy Goal]

Pauli Virtanen pav@iki...
Wed Jan 11 04:05:01 CST 2012


09.01.2012 20:06, Zachary Pincus kirjoitti:
[clip]
> good_tck, good_u = interp.splprep(good, s=4)
> bad_tck, bad_u = interp.splprep(bad, s=4)
> print good.ptp(axis=1)
> print numpy.array(interp.splev(numpy.linspace(good_u[0], good_u[-1], 300), good_tck)).ptp(axis=1)
> print numpy.array(interp.splev(numpy.linspace(bad_u[0], bad_u[-1], 300), bad_tck)).ptp(axis=1)
> 
> And the output on my machine is:
> [ 65.97671235  20.74943287]
> [ 67.69845281  20.52518913]
> [ 2868.98673621  450984.86622631]

After a closer look at this, it seems to me that there could also be a
numerical problem (or perhaps a bug) in the fitpack algorithm, i.e., the
bad results are not necessarily due to a "wrong" smoothness metric. In
the "bad" case it seems that the 3rd derivative discontinuities also
explode.

-- 
Pauli Virtanen



More information about the SciPy-Dev mailing list