nag_1d_cheb_interp_fit (e02afc) computes the coefficients
, for
, in the Chebyshev series
which interpolates the data
at the points
Here
denotes the Chebyshev polynomial of the first kind of degree
with argument
. The use of these points minimizes the risk of unwanted fluctuations in the polynomial and is recommended when the data abscissae can be chosen by the user, e.g. when the data is given as a graph. For further advantages of this choice of points, see Clenshaw (1962).
In terms of the user's original variables,
say, the values of
at which the data
are to be provided are
where
and
are respectively the upper and lower ends of the range of
over which the user wishes to interpolate.
Truncation of the resulting series after the term involving
, say, yields a least-squares approximation to the data. This approximation,
, say, is the polynomial of degree
which minimizes
where the residual
, for
.
The method employed is based on the application of the three-term recurrence relation due to Clenshaw (1955) for the evaluation of the defining expression for the Chebyshev coefficients (see, for example, Clenshaw (1962)). The modifications to this recurrence relation suggested by Reinsch and Gentleman (see Gentleman (1969)) are used to give greater numerical stability.
For further details of the algorithm and its use see Cox (1974), Cox and Hayes (1973).
Subsequent evaluation of the computed polynomial, perhaps truncated after an appropriate number of terms, should be carried out using e02aec (nag_1d_cheb_eval).