# naginterfaces.library.interp.dim1_​monotonic¶

naginterfaces.library.interp.dim1_monotonic(x, f)[source]

dim1_monotonic computes a monotonicity-preserving piecewise cubic Hermite interpolant to a set of data points.

For full information please refer to the NAG Library document for e01be

https://www.nag.com/numeric/nl/nagdoc_28.6/flhtml/e01/e01bef.html

Parameters
xfloat, array-like, shape

must be set to , the th value of the independent variable (abscissa), for .

ffloat, array-like, shape

must be set to , the th value of the dependent variable (ordinate), for .

Returns
dfloat, ndarray, shape

Estimates of derivatives at the data points. contains the derivative at .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, , and .

Constraint: for all .

Notes

dim1_monotonic estimates first derivatives at the set of data points , for , which determine a piecewise cubic Hermite interpolant to the data, that preserves monotonicity over ranges where the data points are monotonic. If the data points are only piecewise monotonic, the interpolant will have an extremum at each point where monotonicity switches direction. The estimates of the derivatives are computed by a formula due to Brodlie, which is described in Fritsch and Butland (1984), with suitable changes at the boundary points.
Values of the computed interpolant, and of its first derivative and definite integral, can subsequently be computed by calling dim1_monotonic_eval(), dim1_monotonic_deriv() and dim1_monotonic_intg(), as described in Further Comments.