Closed alecloudenback closed 4 days ago
Hmm, I think this error occurs because the B-Spline implementation in DataInterpolations
assumes that a degree $n$ B-Spline curve has at least $n+1$ data points. DataInterpolations
is not a dedicated B-Spline package, so I think (unless someone wants to dive into this) it is sufficient to raise an informative error if this condition is not met.
But this has n+1=4 data points?
But this has n+1=4 data points?
The interpolation is with 3 points - BSplineInterpolation(u[1:3], t[1:3], 3, :ArcLen, :Average)
it is sufficient to raise an informative error if this condition is not met.
Yeah, that might be easier.
The interpolation is with 3 points - BSplineInterpolation(u[1:3], t[1:3], 3, :ArcLen, :Average)
Oh missed that. yeah error.
Describe the bug 🐞
Interpolation errors on small vectors
Expected behavior
Would expect a handling similar to BSplineKit.jl which does not error on smaller vectors.
Context
When bootstrapping a yield curve (e.g. FinanceModels.jl) we want to construct a curve which iteratively constructs a fit curve by using a longer and longer set of input/output vectors. The last element of the intermediate vectors $n_i$ is applied to the range between $xi$ and $x{i+t}$ when solving for the $x_{i+1}th$ parameter.
Minimal Reproducible Example 👇
Shows how BSplineKit handles the case while DataInterpolations does not: