naginterfaces.library.interp.dim1_​spline¶

naginterfaces.library.interp.dim1_spline(x, y)[source]

dim1_spline determines a cubic spline interpolant to a given set of data.

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

https://www.nag.com/numeric/nl/nagdoc_29/flhtml/e01/e01baf.html

Parameters
xfloat, array-like, shape

must be set to , the th data value of the independent variable , for .

yfloat, array-like, shape

must be set to , the th data value of the dependent variable , for .

Returns
lamdafloat, ndarray, shape

The value of , the th knot, for .

cfloat, ndarray, shape

The coefficient of the B-spline , for . The remaining elements of the array are not used.

Raises
NagValueError
(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, , and .

Constraint: .

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_spline determines a cubic spline , defined in the range , which interpolates (passes exactly through) the set of data points , for , where and . Unlike some other spline interpolation algorithms, derivative end conditions are not imposed. The spline interpolant chosen has interior knots , which are set to the values of respectively. This spline is represented in its B-spline form (see Cox (1975)):

where denotes the normalized B-spline of degree , defined upon the knots , and denotes its coefficient, whose value is to be determined by the function.

The use of B-splines requires eight additional knots , , , , , , and to be specified; dim1_spline sets the first four of these to and the last four to .

The algorithm for determining the coefficients is as described in Cox (1975) except that factorization is used instead of decomposition. The implementation of the algorithm involves setting up appropriate information for the related function fit.dim1_spline_knots followed by a call of that function. (See fit.dim1_spline_knots for further details.)

Values of the spline interpolant, or of its derivatives or definite integral, can subsequently be computed as detailed in Further Comments.

References

Cox, M G, 1975, An algorithm for spline interpolation, J. Inst. Math. Appl. (15), 95–108

Cox, M G, 1977, A survey of numerical methods for data and function approximation, The State of the Art in Numerical Analysis, (ed D A H Jacobs), 627–668, Academic Press