Exercise 10.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 10.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 10.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 to be zero on the two outer intervals – that is, interval \(0\) (before \(t_1\)) and interval \(2\) (after \(t_2\)) – since these lie outside the range \([t_1,t_2]\) where the data are observed. Interval \(1\), the genuine interior piece between the two knots, is left unconstrained. That is, for this problem, to set

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


Exercise 10.4

If we require continuity of the \(p\)-th order derivative at the knots (in addition to the derivatives of order \(0,\dots,(p-1)\) already required by @eq-smoothcons) then we would require \(a_{kp} = a_{(k+1)p}\) for all knots \(k=1,\dots,m\). Two degree-\(p\) polynomials that agree in value and in every derivative from order \(0\) up to \(p\) at a single point must, by Taylor’s theorem, be identical everywhere – not just tangent at that point. So requiring continuity of all derivatives up to and including the \(p\)-th forces each pair of adjacent pieces to be exactly the same polynomial, and hence, propagating this across all \(m\) knots, forces the entire spline to collapse into a single degree-\(p\) polynomial over the whole domain, with just \(p+1\) free parameters regardless of how many knots are used. This defeats the purpose of using a spline at all: the fitted curve is no more flexible than an ordinary global polynomial regression and cannot adapt to local features of the data – given the motivation for the use of splines, this is an unacceptable property.


End of Solutions to Exercises 10