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

In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

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.

The function is derived from function PCHIM in Fritsch (1982).

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.

References

Fritsch, F N, 1982, PCHIP final specifications, Report UCID-30194, Lawrence Livermore National Laboratory

Fritsch, F N and Butland, J, 1984, A method for constructing local monotone piecewise cubic interpolants, SIAM J. Sci. Statist. Comput. (5), 300–304