mathnet-numerics icon indicating copy to clipboard operation
mathnet-numerics copied to clipboard

SplineBoundaryCondition.NotAKnot or CubicSpline.InterpolateNotAKnot

Open rummelsworth opened this issue 5 years ago • 3 comments

I'm porting some IMSL-based Fortran code to C#, including some calls to CSIEZ, which does cubic spline interpolation using the "not-a-knot" condition. I'm not terribly knowledgeable about splines, so I found this nice page that gives a concise visual and mathematical comparison of several boundary conditions, including "natural" and "not-a-knot".

For right now, CubicSpline's natural method seems like it might be close enough, closer anyway than Akima or parabolically terminated boundaries for my particular inputs.

rummelsworth avatar Jul 15 '20 17:07 rummelsworth

You need to add the calculation of the left and right boundary of NotAKnot condition to CubicSpline.cs

See scipy implementation as a reference.

markusr avatar Jul 30 '20 08:07 markusr

Now in the MathNet.Numerics.Interpolation.CubicSpline,only implements the boundary-condition-type of 'natural', don't implements the boundary-condition-type of 'not-a-knot'.But, in other software, such as Python scipy.interpolate.CubicSpline or MATLAB spline(), the default boundary-condition-type is 'not-a-knot'. Are there any plans to implement the 'not-a-knot' type?

ztmsimon avatar Aug 17 '21 07:08 ztmsimon

I have the same problem, how do you solve this at last?

xingtianxia avatar Nov 18 '21 03:11 xingtianxia