|
The method of
least squares provides, among other things, an alternative to
ordinary interpolation that
avoids the problem of overfitting.
Another alternative is spline
interpolation, which encompasses a range of interpolation
techniques that reduce the effects of overfitting. The method of
cubic spline interpolation
presented here is widely used in finance. It applies only in one dimension
but is useful for modeling
yield curves,
forward curves, and other
term structures.
A cubic spline is a
function
constructed by piecing together cubic polynomials
on different intervals
.
It has the form
 |
[1] |
Consider points
,
with
.
We construct a cubic spline by interpolating a cubic polynomial
between each pair of consecutive points
and
according to the following constraints:
1. Each polynomial passes through its respective end
points:
 |
[2] |
2. First derivatives match at interior points:
 |
[3] |
3. Second derivatives match at interior points:
 |
[4] |
4. Second derivatives vanish at the end
points:
 |
[5] |
The above conditions specify a system of linear equations
that can be solved for the cubic spline. In practice, it makes little
sense to fit a cubic spline to fewer than five points. However, for the
purpose of illustration, let's interpolate a cubic spline between just
three points.
Consider the points
= (1,1), (2,5), (3,4). We seek to fit a cubic polynomial on the interval
[1, 2] and another cubic polynomial on the interval [2, 3]. These take the
forms
 |
[6] |
| [7] |
Our first condition requires
 |
[8] |
| [9] |
| [10] |
| [11] |
The second condition requires
 |
[12] |
The third condition requires
 |
[13] |
Finally, the last condition requires
 |
[14] |
| [15] |
We have eight equations in eight unknowns. These can be
expressed as
 |
[16] |
|
which we solve to obtain
|
 |
[17] |
Our two polynomials are
|
 |
[18] |
| [19] |
The cubic spline, along with the three points upon which
it is based, is shown in Exhibit 1.
|
|
 |
 |
|
A
cubic spline interpolated between the points (x[k],
y[k]) = (1,1), (2,5), (3,4) is constructed
from two cubic polynomials p1 and p2. |
|
|