deriv3

deriv3(h, y, /, axis=0, accuracy=2, keepleft=False, keepright=False, keepedges=False)[source]

Return an estimate of the third derivative along an arbitrary axis using third order centered finite differencing.

Parameters
  • h (float or array-like) – The step size. If non-singleton, the step size is h[1] - h[0].

  • y (array-like) – The data.

axisint, optional

Axis along which derivative is taken.

dimstr, optional

For `xarray.DataArray` input only. Named dimension along which the derivative is taken.

accuracy{{0, 2, 4, 6}}, optional

Accuracy of finite difference approximation. 0 corresponds to differentiation onto half-levels. 2, 4, and 6 correspond to centered accuracies of \(h^2\), \(h^4\), and \(h^6\), respectively. See this wikipedia page for the table of coefficients for each accuracy.

keepleft, keepright, keepedgesbool, optional

Whether to fill left, right, or both edge positions with progressively lower-accuracy finite difference estimates to prevent reducing the dimension size along axis axis.

Returns

diff (array-like) – The “derivative”. The length of axis axis may differ from y depending on the keepleft, keepright, and keepedges settings.