my understanding is that for if I have five points, I can interpolate a natural cubic spline out of any five points with increasing x, because degree of freedom is five.
But when I try the python package, it seems not to be the case,
here are my five points
x = [-0.10093605653422201, -0.06729070435614802, 0.0, 0.06729070435614802, 0.10093605653422201]
y = [0.7701744 0.52964054 0.44325221 0.61695343 0.72468718]
And I used scipy.interpolate.CubicSpline
from scipy.interpolate import CubicSpline
cs = CubicSpline(x, y, bc_type='natural')
x_plot = np.linspace(-0.16, 0.16, 100)
plt.plot(x_plot, [cs(xi) for xi in x_plot])
plt.show()
As the graph shows, the left boundary end point doesnt have a constant slope, why is that?
