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

    Function splinefun

    • The cubic spline through the points, as a function of x and the order of derivative (0 to 3; a fraction is truncated, as R does). Equivalent to R's splinefun(). Except that the third derivative of "monoH.FC" is the exact one (see splinefunH). The order of derivative is the second argument of the function or its option deriv (SplineFunction).

      Parameters

      Returns SplineFunction

      const s = splinefun([1, 2, 3, 4], [1, 4, 9, 16]);
      s([2.5]); // [6.25]
      s([2.5], 1); // [5]
      s([2.5], { deriv: 1 }); // [5]