I am confused about how the degrees of freedom in a B-spline are calculated in the package splines. The documentation for the B-spline function can be found here:
https://www.rdocumentation.org/packages/splines/versions/3.6.2/topics/bs
With this function, the degrees of freedom for a spline fit are calculated as:
df = length(knots) + degree
where "knots" refers only to interior knots and "degree" refers to the degree of the polynomial you are fitting.
Take a case of a cubic spline with one interior knot. length(knots) = 1. Since the degree of a polynomial is 3, "degree" is 3. So df = 4.
However, isn't the knot in the spline conjoining two cubic polynomials, each with three adjustable parameters? In that case, shouldn't df in fact be 7?
The reason I'm interested is that I want to know how to calculate QICC (a cousin of AIC) for a model based on a spline. A model's QICC score reflects the number of estimated parameters in the model. In the case of one internal knot, is the penalty equal to the degrees of freedom (as reported in summary = 4 (= 1 knot + 3 coefficients)) or is the penalty equal to 7 (= 1 knot + 3 coefficients for the polynomial to the left of the knot + 3 coefficients for the polynomial to right of knot)?
What am I missing?