test_approx, a Python code which provides sets of test data for approximation algorithms.
This code contains a number of vectors of data (X(1:N),Y(1:N)) for which no underlying functional relationship is given.
The task of interpolation software is to find, from some given class of functions, the function G(X) which exactly matches the known data values. That is, G(X(1:N)) = Y(1:N).
The task of approximation software is to find, from some given class of functions, the function H(X) for which some approximation error is minimized. There are many forms of error measurement. For instance, the error might simply be the sum of the differences of the function and the data at the data abscissas:
l1(X) = sum ( 1 <= I <= N ) abs ( H(X(I)) - Y(I) )or the square root of the sum of squares
l2(X) = sqrt ( sum ( 1 <= I <= N ) ( H(X(I)) - Y(I) )^2 )or the maximum pointwise error:
l_inf(X) = max ( abs ( H(X(I)) - Y(I) ) )In cases where a functional form is given, the error might be measured in terms of the integral of the absolute value of the difference over some interval:
L1(X,A,B) = integral ( A <= X <= B ) abs ( H(X) - F(X) ) dxand so on.
The problems available include:
The information on this web page is distributed under the MIT license.
test_approx is available in a C version and a C++ version and a Fortran77 version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.
bernstein_polynomial, a Python code which evaluates the Bernstein polynomials, useful for uniform approximation of functions;
chebyshev, a Python code which computes the Chebyshev interpolant/approximant to a given function over an interval.
lagrange_approx_1d, a Python code which defines and evaluates the Lagrange polynomial p(x) of degree m which approximates a set of nd data points (x(i),y(i)).
test_approx, a dataset directory which contains sets of data (x,y) for which an approximating formula is desired.
test_interp, a Python code which defines a number of test problems for interpolation, provided as a set of (x,y) data.
test_interp_1d, a Python code which defines test problems for interpolation of data y(x), depending on a 1D argument.
vandermonde_approx_1d, a Python code which finds a polynomial approximant to a function of 1D data by setting up and solving an overdetermined linear system for the polynomial coefficients, involving the Vandermonde matrix.