Ex. 5.4

Ex. 5.4

Consider the truncated power series representation for cubic splines with \(K\) interior knots. Let

\[\begin{equation} f(X) = \sum_{j=0}^3\beta_jX^j + \sum_{k=1}^K\theta_k(X-\xi_k)_{+}^3.\non \end{equation}\]

Prove that the natural boundary conditions for natural cubic splines (Section 5.2.1) imply the following linear constraints on the coefficients:

\[\begin{eqnarray} \beta_2 = 0, \ \ \sum_{k=1}^K\theta_k = 0\non\\ \beta_3 = 0, \ \ \sum_{k=1}^K\xi_k\theta_k=0.\non \end{eqnarray}\]

Hence derive the basis (5.4) and (5.5).

Soln. 5.4

When \(X<\xi_1\), \(f(X) = \beta_0 + \beta_1X + \beta_2X^2 + \beta_3X^3\), since \(f(X)\) is linear when \(X < \xi_1\), we have \(\beta_2=0\) and \(\beta_3=0\).

When \(X > \xi_K\), we have

\[\begin{eqnarray} f(X) &=& \sum_{j=0}^3\beta_jX^j + \sum_{k=1}^K\theta_k(X-\xi_k)^3\non\\ &=&\beta_0 + \beta_1X + 3\left(\sum_{k=1}^K\theta_k\xi_k^2\right) X - 3\left(\sum_{k=1}^K\theta_k\xi_k\right)X^2 + \left(\sum_{k=1}^K\theta_k\right)X^3.\non \end{eqnarray}\]

Since \(f(X)\) is linear when \(X > \xi_K\), we have

\[\begin{equation} \label{eq:5-4a} \sum_{k=1}^K\theta_k = 0 \text{ and } \sum_{k=1}^K\theta_k\xi_k = 0. \end{equation}\]

To derive (5.4) and (5.5) in the text, we need to rewrite \(f(X)\) as a series summation, in the form of \(\sum_k\alpha_k N_k(X)\), defined in (5.4) and (5.5). It's easy to see that for \(N_1(X)\) and \(N_2(X)\), we have \(\alpha_1 = \beta_1\) and \(\alpha_2 = \beta_2\). By comparing the coefficient of \((X-\xi_k)_+^3\) for each \(k \le K-2\), we see that \(\alpha_k = (\xi_K-\xi_k)\theta_k\). It remains to verify that

\[\begin{equation} \sum_{k=1}^{K-2}\alpha_kN_{k+2}(X) = \sum_{k=1}^K\theta_k(X-\xi_k)_{+}^3.\non \end{equation}\]

We have

\[\begin{eqnarray} &&\sum_{k=1}^{K-2}\alpha_kN_{k+2}(X)\non\\ &=& \sum_{k=1}^{K-2}(\xi_K-\xi_k)\theta_k\left[\frac{(X-\xi_k)_+^3-(X-\xi_K)_+^3}{\xi_K-\xi_k} - \frac{(X-\xi_{K-1})_+^3-(X-\xi_K)_+^3}{\xi_K-\xi_{K-1}}\right]\non\\ &=&\sum_{k=1}^{K-2}\theta_k(x-\xi_k)_+^3 -\left(\sum_{k=1}^{K-2}\theta_k\right)(x-\xi_K)_+^3 \non\\ && - \frac{1}{\xi_K-\xi_{K-1}}\left[\xi_K\left(\sum_{k=1}^{K-2}\theta_k\right) - \sum_{k=1}^{K-2}\xi_k\theta_k\right][(X-\xi_{K-1})_+^3-(X-\xi_K)_+^3].\non \end{eqnarray}\]

Note that by \(\eqref{eq:5-4a}\), we have \(\sum_{k=1}^{K-2}\theta_k=-\theta_{K-1}-\theta_K\) and \(\sum_{k=1}^{K-2}\xi_k\theta_k=-\theta_{K-1}\xi_{K-1} - \theta_K\xi_K\), the summation above becomes

\[\begin{eqnarray} && \sum_{k=1}^{K-2}\theta_k(x-\xi_k)_+^3 + (\theta_{K-1}+\theta_K)(x-\xi_K)_+^3 \non\\ && - \frac{(-\xi_K\theta_{K-1}-\xi_K\theta_K + \xi_{K-1}\theta_{K-1} + \xi_K\theta_K)}{\xi_K-\xi_{K-1}}[(X-\xi_{K-1})_+^3-(X-\xi_K)_+^3]\non\\ &=& \sum_{k=1}^{K-2}\theta_k(x-\xi_k)_+^3 + (\theta_{K-1}+\theta_K)(x-\xi_K)_+^3\non\\ && + \theta_{K-1}[(X-\xi_{K-1})_+^3-(X-\xi_K)_+^3]\non\\ &=& \sum_{k=1}^K\theta_k(x-\xi_k)_+^3.\non \end{eqnarray}\]

Now the proof is complete.