end conditions in univariate spline interpolation

Spline interpolation, at knots for even order $k$ and at `half'-knots (i.e., midpoints of knot intervals) for odd order, leaves an even number of degrees of freedom still to be chosen, and usually chosen by prescribing additional conditions at both ends. %

The most natural end conditions are those of complete spline interpolation, in which the first $\ceil{k/2}-1$ are prescribed at both ends. Other end conditions may be handled efficiently by treating complete spline interpolation first, and then handling all other end conditions by expressing them in terms of the complete endconditions, both theoretically and in calculations. For the latter, this means that one initially solves a linear system with many righthand sides, with zero side conditions in conjunction with the given values, and $\delta_{ij}$ side conditions with zero given values on the remaining. An appropriate linear combination of the latter, matching the actual side conditions to be used, is then added to the first, the particular linear combination having been determined by solving the appropriate small linear system. %

The not-a-knot condition in cubic spline interpolation is easily shown to be correct since, in effect, we are interpolating at $x_1, ..., x_n$ by a cubic spline with simple interior knots at $x_3, ..., x_{n-2}$, hence the Schoenberg-Whitney conditions are easily seen to hold. %

The not-a-knot condition is proposed and used in Boor66. It appears, though not identified this way, in Kershaw73 as a linear condition imposed on the first two slopes which is exact for any cubic polynomial. The other end condition given there is exact for quadratic polynomials; it turns out to be equivalent to $f'''(a+) = 0$. %

Forsythe, Malcolm and Moler (in their '77 book) match the third-derivative estimate obtained from the cubic polynomial which interpolates to the first four data points. Simpler conditions of this type, matching, e.g., the boundary slope estimate obtained this way, are already in SwartzVarga72. %

The socalled `natural' end conditions are so called since they are satisfied by the unique function that matches the given data and has its $m$-th derivative as small as possible, as measured by its $L_2$-norm. It amounts to setting the $m$, $m+1$st, ..., $2m-2$nd derivative equal to zero at the endpoints. %

In the cubic case (i.e., $m=2$), the `natural' end conditions amounts to using complete cubic spline interpolation, with the endslope set equal to the slope of the straight line that interpolants to the two data nearest that end. That makes explicit a major failing of these end conditions: near the ends, the resulting approximation is only second-order. This can be remedied by prescribing sufficiently accurate values of the end second derivatives instead of the value 0. %

Perhaps the most unexpected end condition is that of Curtis and Powell (see Hayes70c: chapter 4). They require that the interpolation error be the same at the midpoints of the first two knot intervals. %

Enforcing periodic end conditions directly destroys the bandedness of the linear system. Here is a way to retain the advantages of the bandedness for these end conditions. The explanation is for the simplest case, that of periodic cubic spline interpolation: The data $(x_,y_i)$, $i=1,...,N$ are to be matched by a cubic spline $f$ with period interval $I=[x_1 .. x_N]$ and with simple knots at the $x_i$. Then start by constructing a vector-valued complete cubic spline interpolant $F$ with simple knots that $x_2,\ldots,x_{N-1}$ for which (i) $F(x_i) = (y_i,0,0)$, $i=1,...,N$; (ii) $F'(x_1) = (0,1,0)$; (iii) $F'(x_N) = (0,0,1)$. This amounts to solving the standard tridiagonal linear system for the slopes of $F$ but with three right-hand sides, getting, correspondingly, a sequence of 3-vectors as solution. Next, $F(x) =: (f_1(x), f_2(x), f_3(x))$. Then the function $ f := f_1 + a f_2 + b f_3$ is a cubic spline with knots at the $x_i$ which interpolates to the given data, regardless of the choice of the weights $a$ and $b$. Assuming that the data are periodic, i.e., $y_1=y_N$, we get our periodic interpolant by choosing $a$ and $b$ as the unique solution of the linear system of two equations: $ f'(x_N) = f'(x_1)$, $f''(x_N) = f''(x_1)$.