# B-Spline Interpolation/Approximation

I've got a couple of probably very simple questions, yet some googling didn't bring up what I was looking for. First what I want to do: I have a grid, and the gridpoints are function values. I want to compute a value in-between two gridpoints, and it should be approximated via B-Splines

What I know is the basis B-Spline definition:

$B_{m, j}(x) = \frac{x - x_j}{x_{j+m} - x_j} B_{m-1, j}(x) + \frac{x_{j+m+1} - x}{x_{j+m+1} - x_{j+1}} B_{m-1, j+1}(x)$

and the final spline is then $S(x) = \sum_i c_i B_{m, i}(x)$

Here are the questions:

1. Is it enough to set the $c_i = y_i$, where $y_i$ are my given function values, or do I need to consider anything else?
2. What is a smart way to set the number of intervals? I know it has a constraint by the spline degree I want to achieve, but other then that, do I have any other constraints?
3. According the intervals as well: I know that the basis function $B_{m, j}$ not only influences the interval $[x_j, x_{j+1}]$, but also the next $j$ ones to the right. Does that mean that if I want to compute only one point, it has to have j intervals to the left of it? Or would it be enough fi that one point was already in the first interval?

Thanks!

If you set $c_i = y_i$, then the resulting spline will not interpolate (pass through) your $y$ values. My guess is that this is not what you want.
Your second question (about number of intervals) is easier to answer in terms of number of knots. If you have $n$ data values, and you're creating a spline of order $k$ (degree $k-1$), then you need $n+k$ knots. There are many options for distributing the knots and their multiplicities, and this will determine how many intervals you end up with. It's generally not very useful to think in terms of intervals.
Question 3: Not really. The point has to have $k$ knots to the right. But those knots might have multiplicities larger than 1, in which case some intervals collapse to nothing. When creating a spline of order $k$, it's common to use end knots that have multiplicity $k$. This guarantees that any non-degenerate interior interval has $k$ knots to the right of it, so everything works.