rStats.js v1.3.0
    Preparing search index...

    Function spline

    • Cubic spline interpolation at given or equally spaced points. Equivalent to R's spline().

      Parameters

      Returns { x: number[]; y: number[] }

      • x: number[]

        The points interpolated at (xout, or the equally spaced points).

      • y: number[]

        The interpolated values, one per point of x.

      spline([1, 2, 3, 4], [1, 4, 9, 16], { xout: [2.5] }).y; // [6.25]