Microsoft Store
 

Interpolation


 

:This article is about interpolation in mathematics. See also interpolation (music) and interpolation (manuscripts).

Linear interpolation

Main article: Linear interpolation

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

One of the simplest methods is linear interpolation (sometimes known as lerp). Consider the above example of determining f(2.5). Since 2.5 is midway between 2 and 3, it is reasonable to take f(2.5) midway between f(2) = 0.9093 and f(3) = 0.1411, which yields 0.5252.

Related Topics:
Linear - Lerp

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Generally, linear interpolation takes two data points, say (xa,ya) and (xb,yb), and the interpolant is given by

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

: f(x) = rac{x-x_b}{x_a-x_b} y_a - rac{x-x_a}{x_a-x_b} y_b

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

This formula can be interpreted as a weighted mean.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Linear interpolation is quick and easy, but it is not very precise. Another disadvantage is that the interpolant is not differentiable at the point xk.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

The following error estimate shows that linear interpolation is not very precise. Denote the function which we want to interpolate by g, and suppose that x lies between xa and xb and that g is twice continuously differentiable. Then the linear interpolation error is

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

: |f(x)-g(x)| le C(x_b-x_a)^2 quadmbox{where}quad C = rac18 max_{yin} g(y).

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

In words, the error is proportional to the square of the distance between the data points. The error of some other methods, including polynomial interpolation and spline interpolation (described below), is proportional to higher powers of the distance between the data points. These methods also produce smoother interpolants.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~