Interpolation is a concept that is used in numerical analysis. It means finding an intermediate value from the given data. That is, for a set of function values, sometimes a situation arises to know what the value of the function is, for some intermediate value of the variable.
Let us explain the concept with a simple example. Let the ordered pairs of the data of a function be (0, -1), (1, 7), (2, 22), (3, 40), (4, 69), (5, 98) and we need to find the function value of 3.8 of the variable. The attempt to find that value is called interpolation and there are several methods. Let us describe those one by one.
The first method is to round the given value of the variable to the nearest value in the data and take the corresponding value of the function. So for the given data, the value 3.8 of the variable can be rounded to 4 and assume the value of the function approximately as 40. But as one can easily see it is a crude method and far from accurate. This method can only be used just for guidance.
The next method is called as linear interpolation. That is, the function is assumed to be linear in the interval that contains the required value of the variable and accordingly the value of the function is determined. In the given example 3.8 falls in the interval [3, 4]. Considering the function to be linear in this interval, the slope of the function in this interval is (69 – 40)/(1) = 29. So the value of the function at x = 3.8 is, 29(0.8) + 40 = 63.2. Though this method also is not very accurate still the accuracy is much better than that in method 1. This method, even at the cost of sacrificing some accuracy, is preferred because it is easy to work with. In general the linear interpolation y at a point x is given by the formula y = [(yb – ya)/(xb – xa)](x – xa) + ya, where [a, b] is the interval in which the required point occurs. This is the algorithm used in any linear interpolation calculator.
It is always possible a curve rather than a straight line could better cover the points plotted from a data. In other words a polynomial function can give a better interpolation. Finding a suitable polynomial function for a given data is called as polynomial regression. Suppose we consider the same data, the three degree polynomial function f(x) = 3x2 + 5x – 1 will be very close to the desired results. In such a case evaluating the function for x = 3.8, the value of the function is will be a very accurate interpolation. The accuracy can further be improved when a polynomial function of degree same as the number of data points is determined.
A high level interpolation polynomial can be derived by extensive methods and such an interpolation is called as Lagrange interpolation introduces by the famous Italian mathematician.
Let us explain the concept with a simple example. Let the ordered pairs of the data of a function be (0, -1), (1, 7), (2, 22), (3, 40), (4, 69), (5, 98) and we need to find the function value of 3.8 of the variable. The attempt to find that value is called interpolation and there are several methods. Let us describe those one by one.
The first method is to round the given value of the variable to the nearest value in the data and take the corresponding value of the function. So for the given data, the value 3.8 of the variable can be rounded to 4 and assume the value of the function approximately as 40. But as one can easily see it is a crude method and far from accurate. This method can only be used just for guidance.
The next method is called as linear interpolation. That is, the function is assumed to be linear in the interval that contains the required value of the variable and accordingly the value of the function is determined. In the given example 3.8 falls in the interval [3, 4]. Considering the function to be linear in this interval, the slope of the function in this interval is (69 – 40)/(1) = 29. So the value of the function at x = 3.8 is, 29(0.8) + 40 = 63.2. Though this method also is not very accurate still the accuracy is much better than that in method 1. This method, even at the cost of sacrificing some accuracy, is preferred because it is easy to work with. In general the linear interpolation y at a point x is given by the formula y = [(yb – ya)/(xb – xa)](x – xa) + ya, where [a, b] is the interval in which the required point occurs. This is the algorithm used in any linear interpolation calculator.
It is always possible a curve rather than a straight line could better cover the points plotted from a data. In other words a polynomial function can give a better interpolation. Finding a suitable polynomial function for a given data is called as polynomial regression. Suppose we consider the same data, the three degree polynomial function f(x) = 3x2 + 5x – 1 will be very close to the desired results. In such a case evaluating the function for x = 3.8, the value of the function is will be a very accurate interpolation. The accuracy can further be improved when a polynomial function of degree same as the number of data points is determined.
A high level interpolation polynomial can be derived by extensive methods and such an interpolation is called as Lagrange interpolation introduces by the famous Italian mathematician.