fslaborg / FSharp.Stats

statistical testing, linear algebra, machine learning, fitting and signal processing in F#
https://fslab.org/FSharp.Stats/
Other
205 stars 54 forks source link

Separate Akima interpolation from cubic spline interpolation #282

Closed bvenn closed 11 months ago

bvenn commented 11 months ago

Current structure of the Interpolation module

namespace Interpolation

module CubicSpline
    module Differentiable
        //  contains Akima spline
    module Simple
        // contains standard cubic spline interpolation

Several things are off with the current structure:

  1. A standard cubic spline interpolation in most cases refer to cubic splines where the curvature (second derivative) is continuous at the knots.
  2. Akima spline is a special case, which prevents oscillations by dropping the curvature-continuity condition. The module should be named "Akima" not "Differentiable".
  3. There is no reason to call the cubic spline "Simple" because in fact it is even more differentiable than the Akima version (Akima curvature is not defined at knots).

Proposed structure:

namespace Interpolation

module CubicSpline
    // contains standard cubic spline interpolation

// Separate source file
module Akima
   // contains Akima spline

Both interpolating splines in action

image

bvenn commented 11 months ago

closed by https://github.com/fslaborg/FSharp.Stats/commit/eabb74de05589a2f062edbaf2b7a0ced620ea27b