I'm working through Introduction to Statistical Learning and came upon this:
One can show that adding a term of the form $ beta_4h(x,xi)$ to the model (7.8) $$y_i = beta_0 + beta_1x_i + beta_2x_i^2 + beta_3x_i^3 + epsilon_i$$ for a cubic polynomial will lead to a discontinuity in only the third derivative at ξ; the function will remain continuous, with continuous first and second derivatives, at each of the knots.
How can one show this? Why is this the case?
Best Answer
It's because that's the basis representation of a spline. A higher degree spline actually increases the smoothness of the curve at the risk of having less dramatic directional changes (with the extreme being piecewise linear). The basis representation for a third-order spline with, say, a breakpoint at 5 is equivalent to
$$ left[ begin{array}{cccc} 0 & 0 & 0 & 0 \ 1 & 1 & 1 & 0 \ 2 & 4 & 8 & 0 \ 3 & 9 & 27 & 0 \ 4 & 16 & 64 & 0 \ 5 & 25 & 126 & 0 \ 6 & 36 & 216 & 1 \ 7 & 49 & 343 & 8 \ 8 & 64 & 512 & 27 \ 9 & 81 & 729 & 64 \ 10 & 100 & 100 & 126 \ end{array}right] $$
The first column is the linear term, the second column is the quadratic term, the third column is the ordinal cubic term, the fourth column is the breakpoint which is 0 for all values less than the breakpoint and amounts to $(x – 5)^3$ for all positive values.
Similar Posts:
- Solved – Natural splines in R , ns()
- Solved – Difference between s() and ti() terms in mgcv package when applied to one variable
- Solved – Difference between s() and ti() terms in mgcv package when applied to one variable
- Solved – How to determine if predictor in piece-wise linear regression is significant
- Solved – Spline – basis functions