Closed tkinsella333 closed 4 years ago
For 1) and 2) are you asking why are we fitting cubic splines instead of quadratic?
3) yes, that’s correct 👍
4) you lose 2 df on the left and 2 df on the right since before the first and after the final knots we make a linear assumption instead of a cubic
@LucyMcGowan for 1.) and 2.), I'm not sure why the function in between the knots must be f(x) = (x-E_i)^3. Why couldnt it be f(x) = (x-E_i)^3 + (x - E_i)^2 for example? This function is still a cubic function, it just has a term of degree 2 in addition, but it would still satisfy continuous derivatives up to order 2 right?
Hi professor, regarding cubic splines:
1.) When we define b_{k+1}(x_i) = (x_i - E_k)^3 for k = 1, 2, ... , K, do we have this expression raised to the 3rd power in order to satisfy the condition that we have continuous derivatives up to order 2 at each knot? i.e so that applying the power rule twice yields two consecutive continuous functions? But it seems that we would still have continuous derivatives if we differentiated x^2 twice, but instead we would have the 2nd derivative equal to a constant. So are we really looking for non-constant derivatives here to give our function some extra smoothness?
2.) But in between knots we could also have the expression f(x) = x^3 + x^2 which has continuous derivatives up to order 2 and we would gain a degree of freedom in this case when including a quadratic term, so why is this not allowed?
3.) To count the total degrees of freedom of a cubic spline do we have up to the first knot 4 degrees of freedom (counting the intercept), then since we are only allowed 1 cubic term "to the right of" each of the K knots that yields K + 4 as our degrees of freedom?
4.) Now for estimating the total degrees of freedom of a natural spline, I found on google that it is K. However I would only count K+4 -2 = K +2, as we lose 2 degrees of freedom to the left of the first knot due to the linear constraint but then after the last knot we can replace the cubic term with a linear term, which would keep the degrees of freedom unchanged regarding the interval after the last knot. What is wrong with this reasoning? Why do we lose 2 extra degrees at that last interval?
Thanks! Tim