Given a real-valued function on a hypercube, or hyper-rectangle,
it may be approximated by a (multivariate) Chebyshev polynomial.
In the one-dimensional case, the Chebyshev approximation is
constructed by evaluating the function in certain points, a
Chebyshev grid, and fitting a polynomial to these values.
Thus, one needs the function values on a set of
prespecified points.
The multivariate case is similar, the grid is the Cartesian product of
one-dimensional grids. I.e. all combinations of all grid-points. The Chebyshev coefficients for the interpolating polynomial in the
one-dimensional case is a simple linear transform of the function
values. The Chebyshev-transform, or Discrete Cosine Transform, being
a variant of the Fourier transform, factors over tensor products, thus
the multivariate transform is just a tensor product of several
one-dimensional transforms. If http://fftw.org{FFTW} was
available at compile time, chebpol uses it to generate
the Chebyshev coefficients, otherwise a slower and more
memory-demanding matrix method is used, and a warning message is issued when
the package is attached.
The Chebyshev-approximation is defined on the interval [-1,1], but it
is straightforward to map any interval into [-1,1], thus making
Chebyshev approximation on an interval of choice. Or, a hypercube of choice.
The primary method of the package is chebappx
which takes as
input the function values on the grid, possibly together with a
hypercube specification in the form of a list of intervals. It
produces a function which interpolates on the hypercube.
There is also a wrapper called chebappxf
which may be used if
one has the function to be approximated rather than only its values in
the grid-points.
There is even an interpolation for uniform grids in
ucappx
, with a wrapper in ucappxf
with interesting examples. And a more general for arbitrary
Cartesian-product grids in chebappxg
with a wrapper in
chebappxgf
. These are based on transforms of Chebyshev-polynomials.
A multilinear interpolation is available in mlappx
. And
a polyharmonic spline interpolation in polyh
.
There are also functions for producing Chebyshev
grids (chebknots
) as well as a support function for evaluating a
function on a grid (evalongrid
), and a function for
finding the Chebyshev coefficients (chebcoef
).