Runge's phenomenon
In the mathematical field of numerical analysis, Runge's phenomenon () is a problem of oscillation at the edges of an interval that occurs when using polynomial interpolation with polynomials of high degree over a set of equispaced interpolation points. It was discovered by Carl David Tolmé Runge (1901) when exploring the behavior of errors when using polynomial interpolation to approximate certain functions. The discovery was important because it shows that going to higher degrees does not always improve accuracy. The phenomenon is similar to the Gibbs phenomenon in Fourier series approximations. Introduction. The Weierstrass approximation theorem states  that for every continuous function "f"("x") defined on an interval ["a","b"], there exists a set of polynomial functions "P"("x") for "n"=0, 1, 2, …, each of degree at most "n", that approximates "f"("x") with uniform convergence over ["a","b"] as "n" tends to infinity, that is, Consider the case where one desires to interpolate through "n"+1 equispaced points of a function "f"("x") using the "n"-degree polynomial "P"("x") that passes through those points. Naturally, one might expect from Weierstrass' theorem that using more points would lead to a more accurate reconstruction of "f"("x"). However, this "particular" set of polynomial functions "P"("x") is not  guaranteed to have the property of uniform convergence; the theorem only states that a set of polynomial functions exists, without providing a general method of finding one. The "P"("x") produced in this manner may in fact diverge away from "f"("x") as "n" increases; this typically occurs in an oscillating pattern that magnifies near the ends of the interpolation points. This phenomenon is attributed to Runge. Problem. Consider the Runge function (a scaled version of the Witch of Agnesi). Runge found that if this function is interpolated at equidistant points "x" between −1 and 1 such that: with a polynomial "P"("x ) of degree ≤ n", the resulting interpolation oscillates toward the end of the interval, i.e. close to −1 and 1. It can even be proven that the interpolation error increases (without bound) when the degree of the polynomial is increased: This shows that high-degree polynomial interpolation at equidistant points can be troublesome. Reason. Runge's phenomenon is the consequence of two properties of this problem. The phenomenon is graphically obvious because both properties combine to increase the magnitude of the oscillations. The error between the generating function and the interpolating polynomial of order "n" is given by for some  formula_6 in (−1, 1). Thus, Denote by formula_8 the nodal function and let formula_10 be the maximum of the magnitude of the formula_11 function: It is elementary to prove that with equidistant nodes where formula_14 is the step size. Moreover, assume that the ("n"+1)-th derivative of formula_15 is bounded, i.e. Therefore, But the magnitude of the ("n"+1)-th derivative of Runge's function increases when "n" increases, since formula_18. The consequence is that the resulting upper bound, formula_19, tends to infinity when "n" tends to infinity. Although often used to explain the Runge phenomenon, the fact that the upper bound of  the error goes to infinity does not necessarily imply, of course, that the error itself also diverges with "n." Mitigations. Change of interpolation points. The oscillation can be minimized by using nodes that are distributed more densely towards the edges of the interval, specifically, with asymptotic density (on the interval [−1,1]) given by the formula formula_20. A standard example of such a set of nodes is Chebyshev nodes, for which the maximum error in approximating the Runge function is guaranteed to diminish with increasing polynomial order. S-Runge algorithm without resampling. When equidistant samples must be used because resampling on  well-behaved sets of nodes is not feasible, the S-Runge algorithm can be considered. In this approach, the original set of nodes is mapped on the set of Chebyshev nodes, providing a stable polynomial reconstruction. The peculiarity of this method is that there is no need of resampling at the mapped nodes, which are also called "fake nodes". A Python implementation of this procedure can be found here. Use of piecewise polynomials. The problem can be avoided by using spline curves which are piecewise polynomials. When trying to decrease the interpolation error one can increase the number of polynomial  pieces which are used to construct the spline instead of increasing the degree of the polynomials used. Constrained minimization. One can also fit a polynomial of higher degree (for instance, with formula_21 points use a polynomial of order formula_22 instead of formula_23), and fit an interpolating polynomial whose first (or second) derivative has minimal formula_24 norm. A similar approach is to minimize a constrained version of the formula_25 distance between the polynomial's formula_26 derivative and the mean value of its formula_26 derivative. Explicitly, to minimize where formula_29 and formula_30, with respect to the polynomial coefficients and the Lagrange multipliers , formula_31. When formula_32, the constraint equations generated by the Lagrange multipliers reduce formula_33 to the minimum polynomial that passes through all formula_21 points. At the opposite end, formula_35 will approach a form very similar to a piecewise polynomials approximation. When formula_36, in particular, formula_35 approaches the linear piecewise polynomials, i.e. connecting the interpolation points with straight lines. The role played by formula_38 in the process of minimizing formula_39 is to control the importance of the size of the fluctuations away from the mean value. The larger formula_38 is, the more large fluctuations are penalized compared to small ones. The greatest  advantage of the Euclidean norm, formula_41, is that it allows for analytic solutions and it guarantees that formula_39 will only have a single minimum. When formula_43 there can be multiple minima in formula_39, making it difficult to ensure that a particular minimum found will be the global minimum instead of a local one. Least squares fitting. Another method is fitting a polynomial of lower degree using the method of least squares. Generally, when using formula_45 equidistant points, if formula_46 then least squares approximation formula_33 is well-conditioned. Bernstein polynomial. Using Bernstein polynomials, one can uniformly approximate every continuous function in  a closed interval, although this method is rather computationally expensive. External Fake Constraints Interpolation. This method proposes to optimally stack a dense distribution of constraints of the type P"(x)=0 on nodes positioned externally near the endpoints of each side of the interpolation interval, where P"(x) is the second derivative of the interpolation polynomial. Those constraints are called External Fake Constraints as they do not belong to the interpolation interval and they do not match the behaviour of the Runge function. The method has demonstrated that it has a better interpolation performance than Piecewise polynomials (splines) to mitigate the Runge Phenomenon . Related statements from the approximation theory. For every predefined table of interpolation nodes there is a continuous function for which the sequence of interpolation polynomials on those nodes diverges. For every continuous function there is a table of nodes on which the interpolation process converges. Chebyshev interpolation (i.e., on Chebyshev nodes) converges uniformly for every absolutely continuous function.