The essence of linear interpolation can be described by the following assumption: in the interval between the known neighbouring tabular values of the argument xi and xj consider the function y=f(x) can be approximately regarded as linear. In other words, in this range the value function is proportional to the change in the argument.
More clearly this assumption can be shown in graphic form in the Cartesian coordinate system. Consider the cut functions u and u appears to be a continuous straight line with known coordinates. When searching for intermediate values of the function Y, unknown argument X is between adjacent values XI and xj. Thus, we can write the following inequalities XI < X < xj, yi < Y < yj.
Express written terms of proportions of the following: (yj – yi)/(xj – XI) = (Y – yi)/(X – XI). Here yj and xj is the target value, yi, XI – initial value of the segment, X and Y – the desired intermediate values.
As can be seen from the proportions for a given increment of the argument X - XI it is easy to find the corresponding change of the function Y – yi. Express the increment: Y – yi = ((yj – yi)/(xj – XI))*(X – XI).
Thus, the intermediate function values can be determined, knowing only the increment on which there is a change of argument. Calculate the difference yj – yi xj – XI at a given step of the argument X – XI. Substituting these values in the formula increment, find the rate of change of a function.
Find the intermediate value Y. For this to the increment value add to the initial figure o functions on the considered segment. Likewise, is any intermediate value with a specified step increment.
If there is a problem in defining X for given values of the function y=f(x) is the inverse linear interpolation. Its essence is finding values of X using the same proportion, but now as a known parameter is the increment of the function Y – u. Using a similar transformation is unknown intermediate value of the argument X = ((yj – yi)/(xj – XI))/(Y – u) + XI.
Advice 2 : What is interpolation and extrapolation
Extrapolation and interpolation is used to estimate hypothetical values of a variable based on third-party observations. There are many ways to use them, which are based on the General trend of the monitoring data. Despite the similarity in names, between them there is a big difference.
To determine the difference between extrapolation and interpolation, we need to look at the prefix "extra" and "inter". The prefix "extra" literally means "beyond" or in "addition to". The prefix "inter" means "between" or "among." Knowing this you can easily distinguish the methods between themselves.
The use of methods
For both methods assume some initial conditions. You first need to define what is independent and what the dependent variable for our case. With the collection of data is double the number of their values. It is also necessary to formulate a model for the original data. All this can be recorded in a table for better clarity. Then the graph of dependencies. They are often an arbitrary curve, which approximately describes the data. In any case, there is a function that associates an independent variable with the dependent.
The aim of these transformations is not only the model itself. Usually it is used for prediction. In particular, consider the independent variable which is the predicted value for the associated dependent variable. The output value of our independent variable will show whether has been used extrapolation or interpolation.
You can use the function to predict the value of dependent variable for the independent, which is implicitly expressed. In this case, the method of interpolation is used.
Suppose that the value of x between 0 and 10 is used to create functions:
y = 2x + 5;
We can use this function for better evaluation value, corresponding to the value x=6. To do this, simply substitute this value into the original equation. It is easy to see the result:
have = 2 (6) + 5 = 17;
You can use the original function to predict the value of dependent variable for the independent variable, which is outside the range of values. In this case the extrapolation.
Let, as before, the value of x is between 0 and 10 and there is a function:
y = 2x + 5;
To estimate the value of y using x=20, it is necessary to substitute this value into our equation:
have = 2 (20) + 5 = 45;
If the value x is outside the range of valid values, then the validation method is called extrapolation.
Of the two methods is preferable to interpolation. This is so because when using it there is a high probability of obtaining reliable estimates. When we use extrapolation, then, the assumption that our trend continues for values of x outside the range that was specified originally. This may not always be so, and therefore need to be very careful when using the method of extrapolation.