Skip to content

Index.Function.createInterpolator

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

commons-math-interpolation / Index / createInterpolator

Function: createInterpolator()

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

Defined in: Index.ts:74

Returns an interpolating function for a dataset, using the interpolation method with the specified name.

To specify LOESS parameters, use createLoessInterpolator directly.

Parameters

interpolationMethod

InterpolationMethod

The 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 the interpolation method is unknown, or for the invalid input conditions of the create*Interpolator() function of the method (e.g. too few points for the method).

Clone this wiki locally