Skip to content

Index.Function.createInterpolatorWithFallback

Christian d'Heureuse edited this page Sep 25, 2026 · 1 revision

commons-math-interpolation / Index / createInterpolatorWithFallback

Function: createInterpolatorWithFallback()

function createInterpolatorWithFallback(
   interpolationMethod, 
   xVals, 
   yVals, 
   options?
): UniFunction;

Defined in: Index.ts:101

Returns an interpolating function for a dataset, using the interpolation method with the specified name or a simpler method if there are too few points (see createBasicInterpolatorWithFallback).

LOESS does not need a fallback here, because createLoessInterpolator already applies the fallback when connecting the smoothed points.

Parameters

interpolationMethod

InterpolationMethod

The requested interpolation method.

xVals

ArrayLike<number>

The arguments of the interpolation points, in strictly increasing order (for "loess": in monotonically increasing order). The values must be finite.

yVals

ArrayLike<number>

The values of the interpolation points.

options?

InterpolatorOptions

Optional options.

Returns

UniFunction

A function which interpolates the dataset.

Throws

Error If xVals and yVals have different lengths, if the interpolation method is unknown, or if xVals contains non-finite values or is not in the required order.

Clone this wiki locally