custom_interpolate

custom_interpolate#

class MonotonicInterpolate(x, y, coefficients=None)[source]#

Piecewise cubic, monotonic interpolation via Steffens method [1].

The interpolation curve is monotonic within each interval such that extrema can only occur at grid points. Guarantees continuous first derivatives of the spline. Is applicable to arbitrary data; not restricted to monotonic data.

References

Variables:
  • d (a, b, c,) – Piecewise coefficients for the cubic sections

  • x – grid points

Parameters:
  • x – x-value of grid points – must be strictly increasing

  • y – y-value of grid points

  • coefficients – Necessary for tree_unflatten

Returns:

A function that takes x values and returns spline values at these points