In general, de Boor algorithm to create the basis function is expressed as:
When k=1,
B(i,1)= 1 if t[i]<=t0<=t[i+1] for i=1,2,..,n-1
= 0 otherwise.
When k=2,3,…,n-1,
B(i,k)=(t0-t[i])/(t[i+k-1]-t[i])*B(i,k-1)+(t[i+k]-t0)/(t[i+k]-t[i+1])*B(i+1,k-1)
given vector t and scalar t0.
We define B(i,k) given t and t0 as dB(i,k,t,t0) in the program.
Once we construct the basis function B(i,k,t,t0), we can use the following formula:
![]()
and
![]()
where both x and y are parameterized by t and t0. Parameter k above is the number of order of the system and dB is basis function by De Boor. 
As the number of order gets larger, the curve is going to be locally flatter.
However, it is still too noisy when the number of order is 9. We cannot
increase it more as in polynomial OLS.