I'm trying to teach myself Basis splines, from what I have read a basis spline of order K is non-zero in K segments only. Is this correct? I ask because when I use the following code to plot basis splines in R, some of the basis functions only span 2 or 3 segments (first dotted line from left etc.). May be it is just a convention in R, I mainly just want to make sure I understand the concept correctly.
Edit: Based on this link, it seems not all the basis splines produced in this plot are of degree 3. I should add 3 dummy knots on either end to get cubic bsplines between my input data range. Is this correct.
library(splines)
x = seq(1,10,0.01)
b = bs(x, knots = c(2.5, 5, 7.5), degree = 3, intercept = TRUE)
matplot(x, b, type = 'l')
abline(v = c(2.5, 5, 7.5), lty = 2)
EDIT: Below I produce 2 examples of fitting cubic bsplines (line in both the charts) to hypothetical data(dots in both the charts) for x between [0,4]. With 2 imaginary knots (knots at -2,-1,0,1,2,3,4,5,6), the fit is not very good but with 3 imaginary knots (knots at -3,-2,-1,0,1,2,3,4,5,6,7) it is perfect.