Spline interpolation degrees of freedom

569 Views Asked by At

When using cubic spline interpolation, we have to solve $n-1$ equations with $n+2$ unknowns. What we can do is set $z_0 = z_n = 0$, which gives the natural cubic spline. But could we also set some other $z_i$ to be zero (or some other value), or does it only work for the endpoints?

1

There are 1 best solutions below

0
On

In general (with the caveat outlined in the last-but-one paragraph below), you can invent any two additional linear equations to lock down the remaining two degrees of freedom. There are several techniques in common use. For example:

  1. Setting second derivatives to zero at the end-points
  2. Setting first derivatives equal to some known or estimated values
  3. Constraining the spline to be $C_3$ continuous at the knots adjacent to the ends

What these three techniques have in common is that they impose constraints near the ends of the spline. This means that the "banded" nature of the set of linear equations is not greatly disturbed. If you impose conditions on interior points, then your system of equations will lose the nice tidy banded structure and may become more difficult to solve.

If you're just calling a general-purpose linear system solver, the loss of banded structure doesn't matter, because you're not taking advantage of it anyway.

You don't have complete freedom to make up any two additional equations. If you're careless or unlucky, the enlarged system of $n+1$ equations might become singular, and will not have a unique solution.

Specifically, I think that setting any two second derivatives equal to zero will work -- it will give you a non-singular system of linear equations that has a unique solution. Outside of a homework exercise, I can't imagine why you would ever use these kinds of constraints, though.