When should natural spline be used over not-a-knot

97 Views Asked by At

Given the functions $f_1(x)=\sin(2\pi x), f_2(x)=\cos(2\pi x)$ i have to interpolate them with the bounds $a=0,b=1$ over a bunch (not important) points and calculate the max error.

The exercise shows that for $f_1$ the natural spline is more efficient because the error is lower, while for $f_2$ the knot-a-knot spline is better (always error wise).

My question is: could we have known this a priori behavior? My idea is that when using the natural spline we impose that $s^{(2)} (a)=s^{(2)} (b)=0$ so this will approxiamate better some functions (maybe the ones which have a second derivative equal to zero (?)).