Putting Cubic B-Splines into Standard Polynomial Form
Lately I have been working on an implementation of monotone smoothing splines, based on [1]. As the title suggests, this technique is based on a univariate cubic B-spline. The form of the spline function used in the paper is as follows:
The knot points
I’m interested in providing an interpolated splines using the Apache Commons Math API, in particular the PolynomialSplineFunction class. In principle the above is clearly such a polynomial, but there are a few hitches.
PolynomialSplineFunction
wants its knot intervals in closed standard polynomial formax3 + bx2 + cx + d - It wants each such polynomial expressed in the translated space
(x-Kj) , whereKj is the greatest knot point that is <= x. - The actual domain of S(x) is
K0 ... Km-1 . The first 3 “negative” knots are there to make the summation for S(x) cleaner.PolynomialSplineFunction
needs its functions to be defined purely on the actual domain.
Consider the arguments to
We can apply this same manipulation to show that the arguments to
By the definition of
This suggests a way to manipulate the equations into a standard form. In the transformed space t, the four nonzero terms are:
and by plugging in the appropriate
Now, PolynomialSplineFunction
is going to automatically identify the appropriate
I substitute the argument (αu) into the definitions of the four
Lastly, collecting like terms gives me the standard-form coefficients that I need for PolynomialSplineFunction
:
Now I am equipped to return a PolynomialSplineFunction
to my users, which implements the cubic B-spline that I fit to their data. Happy computing!
References
[1] H. Fujioka and H. Kano: Monotone smoothing spline curves using normalized uniform cubic B-splines, Trans. Institute of Systems, Control and Information Engineers, Vol. 26, No. 11, pp. 389–397, 2013