I am studying the basic recursion formula for generating B-Spline basis functions N(i,j) of a given degree from the basis for the lower degree, and puzzling at the magic.
In particular what I am having a hard time getting through my head is why the new functions obtained have one more degree of continuity (at knots) than the next lower degree. It's obvious that the degree is elevated, but it's not obvious where this continuity is coming from at the knot.
Consider the degree one basis functions. They are piecewise linear functions with slope discontinuities at the knots. How is it that taking a linear combination of these functions gives a piecewise quadratic which has a continuous slope at the knots?
Where is this magic coming from?!!
Thanks!
This is the magic of b-splines.
It's not too difficult to see if you examine the progression from degree zero (step functions) to degree one (hat functions).
Take a linear combination of two step functions, with arbitrary coefficients, and write down the conditions that will need to be satisfied in order for the linear combination to be continuous. See what this implies about the coefficients used in the linear combination. You will find that the coefficients have to be the ones used in the b-spline definition -- these coefficients are the only ones that give the magic increase in continuity.
Here are the details.
Suppose $u < v < w$ are three knot values. Let $H(t) = 0$ for $ t \in [u,v)$ and zero elsewhere, and let $K(t) = 0$ for $ t \in [v,w)$ and zero elsewhere. The functions $H$ and $K$ are the b-spline basis functions of degree zero defined by the knots $u,v,w$. We want to construct a b-spline basis function $F$ of degree one. This will be a piecewise linear function that is a linear combination of $H$ and $K$ and is continuous.
So, suppose $$ F(t) = (at+b)H(t) + (ct + d)K(t) $$ where $a,b,c,d$ are constants that we will calculate. Clearly $F(t)=0$ for $t \notin [u,w)$, regardless of our choices for $a,b,c,d$. Then $$ F(u+) = 0 \quad \Rightarrow \quad au + b = 0 \\ F(w-) = 0 \quad \Rightarrow \quad cw + d = 0 \\ $$ Rather than just requiring $F(v-) = F(v+)$, we're going to require that $F(v-) = F(v+) = 1$. This makes $F$ continuous at $t=v$ and also correctly normalizes the height of $F$. Then $$ F(v-) = 1 \quad \Rightarrow \quad av + b = 1 \\ F(v+) = 1 \quad \Rightarrow \quad cv + d = 1 \\ $$ We now have four linear equations that we can solve for $a,b,c,d$. The solutions are: $$ a = \frac{1}{v-u} \quad ; \quad b = \frac{-u}{v-u} \\ c = \frac{-1}{w-v} \quad ; \quad d = \frac{w}{w-v} \\ $$ Substituting these into the formula for $F$, we get $$ F(t) = \frac{t-u}{v-u}H(t) + \frac{w-t}{w-v}K(t) $$ which is a simplified special case of the the deBoor-Cox recurrence formula.
To get a bit more insight, draw the graphs of $H, K, F$. To get $F(u) = 0$ and $F(v-) = 1$, I think it's clear that the "multiplier" $at+b$ has to be a linear "ramp" function that is zero at $t=u$ and 1 at $t=v$. In other words, it must be $\tfrac{t-u}{v-u}$.
I suspect you could do similar constructions with higher-degree basis functions, but the details would be messier.
The typical description of b-splines pulls the deBoor-Cox formula out of thin air, and then proceeds to prove that it gives functions with the desired continuity properties. Unfortunately, this sort of "magic" is common in mathematics. It's natural to ask (as you did) why such a definition would ever occur to anyone. The reasoning above shows (I hope) that the deBoor-Cox formula is the only one that works, given the continuity and normalization requirements. It's not magic, it's just an inevitable consequence of the constraints.