Exercise 2.1

If we have constant components, that is \(p=0\), then each component is defined by a single parameter \(f(t) = \alpha_{k0}\) for \(t_k \le t < t_{k+1}\) and the only way to have continuity of function (and hence derivatives also) is to have all \(\alpha_{k0}\) identical. That is the spline is a constant for all values of \(t\). This is unlikely to be a good fit in any examples.

Another way to think about this is that there is \(1\) parameter for each of the \(m+1\) intervals with \(1\) constraint for each of the \(m\) knots giving only \(1\times(m+1)-1\times m =1\) degrees of freedom, that is only the overall constant value.

For linear splines, with \(p=1\), then we can require continuity by constraining one of the two parameters in each component, but requiring continuity of the first derivative would also constrain the second parameter. In particular, all component slopes, \(\alpha_{k1}\), would have to be identical. That is the spline would be a single line across all intervals.

Again, here, there are \(2\) parameters for each of the \(m+1\) intervals with \(2\) constraints for each of the \(m\) knots. This gives \(2\times (m+1)-2\times m - 2\) degrees of freedom, that is only a single straight line.


Exercise 2.2

Here there are \(m+1=3\) intervals each containing a cubic, \(p=3\), polynomial. These can be written out as \[ \begin{align*} a_{00}+a_{01}t + a_{02}t^2 +a_{03}t^3, & &t_0 \le t < t_1 \\ a_{10}+a_{11}t + a_{12}t^2 +a_{13}t^3, & &t_1 \le t < t_2 \\ a_{20}+a_{21}t + a_{22}t^2 +a_{23}t^3, & &t_2 \le t < t_3 \end{align*} \] which define the \(12\) parameters.

The smoothness constraints require:


Exercise 2.3

In this example there are \(m=2\) knots and we are using cubic splines, that is \(p=3\). In general, that means \(m+p+1=6\) degrees of freedom, but if we impose two additional constraints then there are 4 degrees of freedom remaining.

If the spline goes through the specified points and the smoothness constraints are satisfied, then the problem is solved. However, because the remaining degrees of freedom is not zero, then there is no unique solution – in fact there are infinitely many. This means everyone who solves the problem could have a different answer and all could be correct. This is considered t be a negative property.

To make the solution unique then we need to introduce an additional 4 constraints. In general, all observational locations will be within the interval \([t_1, t_m]\) and hence what happens to the fitted spline outside this interval may be considered unimportant. The usual approach is to constrain the second and third derivatives outside the interval to be zero. That is, for this problem, to set

\[ \begin{align*} 2 a_{02} + 6 a_{03}t_1 & = 2 a_{12} + 6 a_{13}t_1 =0 \\ 2 a_{02} + 6 a_{03}t_2 & = 2 a_{12} + 6 a_{13}t_2 =0 \end{align*} \] and \[ 6 a_{03} = 6 a_{13} =0. \] Resulting in condition \[ a_{03} = a_{13} = 0 \ \ \mbox{and } \ \ a_{02} = a_{12} = 0. \] Such splines are called, natural splines.


Exercise 2.4

If we require continuity of the \(p\)-th order derivative at the knots then we would require \(a_{kp} = a_{(k+1)p}\) for all knots \(k=1,\dots,m\). For a cubic spline, with \(p=3\), all spline components would then be constrained to have the same curvature and hence would be either globally convex or concave – given the motivation for the use of splines, in general, this is an unacceptable property.


End of Solutions to Exercises 2