Lagrange polynomial
Lagrange polynomial
(All the below are from Wiki.)
Wiki: Lagrange polynomials are used for polynomial interpolation of a given set of points \((x_j,y_j)\).
Given a set of k+1 data points:
The interpolation polynomial of the above data points:
is expressed as a linear combination of Lagrange basis polynomials \(\ell_i(x)\) and \(y_i\),and \(\ell_i(x)\) is:
And we have the following relation:
For example, when \(j=i\), we have:
when \(j\neq i\), we have:
Therefore, we have the following:
- Example:
Say we want to interpolate \(f(x)=x^2\) with given points \((1,1),(2,4),(3,9)\)
The interpolating polynomial is therefore:
-
Drawback:
When an additional point is incorporated, we should recalculate all the Lagrange basis polynomial. An improved form is the Newton polynomials.
Wiki: Lagrange and other interpolation at equally spaced points yield a polynomial oscillating above and below the true function. This behaviour tends to grow with the number of points, leading to a divergence known as Runge's phenomenon; the problem may be eliminated by choosing interpolation points at Chebyshev nodes.