# naginterfaces.library.fit.dim1_​minimax_​polynomial¶

naginterfaces.library.fit.dim1_minimax_polynomial(x, y, m)[source]

dim1_minimax_polynomial calculates a minimax polynomial fit to a set of data points.

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

https://www.nag.com/numeric/nl/nagdoc_29/flhtml/e02/e02alf.html

Parameters
xfloat, array-like, shape

The values of the coordinates, , for .

yfloat, array-like, shape

The values of the coordinates, , for .

mint

, where is the degree of the polynomial to be found.

Returns
afloat, ndarray, shape

The coefficients of the minimax polynomial, for .

reffloat

The final reference deviation, i.e., the maximum deviation of the computed polynomial evaluated at from the reference values , for . may return a negative value which indicates that the algorithm started to cycle due to round-off errors.

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, , and .

Constraint: .

Notes

Given a set of data points , for , dim1_minimax_polynomial uses the exchange algorithm to compute an th-degree polynomial

such that is a minimum.

The function also returns a number whose absolute value is the final reference deviation (see Parameters). The function is an adaptation of Boothroyd (1967).

References

Boothroyd, J B, 1967, Algorithm 318, Comm. ACM (10), 801

Stieffel, E, 1959, Numerical methods of Tchebycheff approximation, On Numerical Approximation, (ed R E Langer), 217–232, University of Wisconsin Press