Skip to content

Extrapolation

Compare
Choose a tag to compare
@HugoGranstrom HugoGranstrom released this 07 Jul 09:39
· 4 commits to master since this release
ba8e3b4

The 1D interpolation methods now support extrapolation using these methods:

  • Constant: Set all points outside the range of the interpolator to extrapValue.
  • Edge: Use the value of the left/right edge.
  • Linear: Uses linear extrapolation using the two points closest to the edge.
  • Native (default): Uses the native method of the interpolator to extrapolate. For Linear1D it will be a linear extrapolation, and for Cubic and Hermite splines it will be cubic extrapolation.
  • Error: Raises an ValueError if x is outside the range.

These are passed in as an argument to eval and derivEval:

let valEdge = interp.eval(x, Edge)
let valConstant = interp.eval(x, Constant, NaN)