Closed
Description
The second derivative is very noisy near the spline endpoints:
using DataInterpolations, Plots
t = 0.0:0.01:1.0
y = @. t^2 # -> y′ = 2*t, y″ = 2
yspl = CubicSpline(y, t)
plot(t, yspl(t); label = "y")
plot!(t, t -> DataInterpolations.derivative(yspl, t, 1); label = "y′")
plot!(t, t -> DataInterpolations.derivative(yspl, t, 2); label = "y″")
The first derivative looks much better, but also looks more kinky than it should near the ends (?) 🙂