How to interpolate table values. Determination of an intermediate value by linear interpolation

Instruction

Often, when conducting empirical research, one has to deal with a set of values ​​​​obtained by random sampling. From this series of values, it is required to construct a graph of the function, into which other obtained values ​​​​will fit with maximum accuracy. This method, or rather the solution of this problem, is a curve approximation, i.e. replacement of some objects or phenomena by others, close in the original parameter. Interpolation, in turn, is a kind of approximation. Curve interpolation is the process by which a fitted function curve passes through the available data points.

There is a problem very close to interpolation, the essence of which will be the approximation of the original complex function by another, much simpler function. If a separate function is very suitable for calculations, then you can try to calculate its value at several points, and build (interpolate) a simpler function based on the obtained ones. However, the simplified function will not allow you to get as accurate and reliable data as the original function would give.

Interpolation via algebraic binomial, or linear interpolation
AT general view: interpolation of some given function f(x) taking value at the points x0 and x1 of the segment by the algebraic binomial P1(x) = ax + b. If more than two function values ​​are given, then the desired linear function is replaced by a piecewise linear function, each part of the function lies between two given function values ​​at these points on the interpolated segment.

Finite Difference Interpolation
This method is one of the simplest and most widely used interpolation methods. Its essence is to replace differential coefficients equations for difference coefficients. This action will take you to the solution differential equation by its difference analog, in other words, construct its finite difference scheme

Building a spline function
A spline in mathematical modeling is a piecewise given function, which, with functions that have a simpler one on each partition element of its domain of definition. A spline from one variable is constructed by dividing the domain of definition into a finite number of segments, moreover, on each of which the spline will coincide with some algebraic polynomial. The maximum degree used is the spline.
Spline functions for specifying and describing surfaces in various systems computer simulation.

Interpolation is a type of approximation in which the curve of the constructed function passes exactly through the available data points.

There is also a problem close to interpolation, which consists in approximating some complex function by another, simpler function. If a certain function is too complex for productive calculations, you can try to calculate its value at several points, and build, that is, interpolate, a simpler function from them. Of course, using a simplified function does not allow you to get the same exact results as the original function would give. But in some classes of problems, the gain in simplicity and speed of computations can outweigh the resulting error in the results.

We should also mention a completely different kind of mathematical interpolation, known as "operator interpolation". Classical works on operator interpolation include the Riesz-Thorin theorem and the Marcinkiewicz theorem, which are the basis for many other works.

Definitions

Consider a system of non-coinciding points () from some area. Let the values ​​of the function be known only at these points:

The problem of interpolation is to find such a function from a given class of functions that

Example

1. Suppose we have a table function, like the one described below, which, for several values, determines the corresponding values:

0 0
1 0,8415
2 0,9093
3 0,1411
4 −0,7568
5 −0,9589
6 −0,2794

Interpolation helps us find out what value such a function can have at a point other than those specified (for example, when x = 2,5).

To date, there are many various ways interpolation. The choice of the most suitable algorithm depends on the answers to the questions: how accurate is the chosen method, what is the cost of using it, how smooth is the interpolation function, how many data points does it require, etc.

2. Find an intermediate value (by linear interpolation).

6000 15.5
6378 ?
8000 19.2

Interpolation methods

Nearest neighbor interpolation

The simplest interpolation method is nearest neighbor interpolation.

Interpolation by polynomials

In practice, interpolation by polynomials is most often used. This is primarily due to the fact that polynomials are easy to calculate, it is easy to analytically find their derivatives, and the set of polynomials is dense in space continuous functions(Weierstrass theorem).

  • IMN-1 and IMN-2
  • Lagrange polynomial (interpolation polynomial)
  • Aitken's scheme

Reverse interpolation (computing x given y)

  • Inverse interpolation by Newton's formula

Multi-Variable Function Interpolation

Other interpolation methods

  • Trigonometric interpolation

Related concepts

  • Extrapolation - methods for finding points outside a given interval (curve extension)
  • Approximation - methods for constructing approximate curves

see also

  • Experiment data smoothing

Wikimedia Foundation. 2010 .

Synonyms:

See what "Interpolation" is in other dictionaries:

    1) a way to determine from a series of given values ​​of any mathematical expression its intermediate values; so, for example, according to the range of the cannonball at an elevation angle of the axis of the cannon channel of 1 °, 2 °, 3 °, 4 °, etc., it can be determined using ... ... Vocabulary foreign words Russian language

    Insertion, interpolation, inclusion, search Dictionary of Russian synonyms. interpolation see insert Dictionary of synonyms of the Russian language. Practical guide. M.: Russian language. Z. E. Alexandrova. 2… Synonym dictionary

    interpolation- Calculation of intermediate values ​​between two known points. For example: linear linear interpolation exponential exponential interpolation The process of outputting a color image when the pixels belonging to the area between two color ... ... Technical Translator's Handbook

    - (interpolation) Estimation of the value of an unknown value between two points of a series of known values. For example, knowing the indicators of the population of the country, obtained during the census, conducted at intervals of 10 years, you can ... ... Glossary of business terms

    From Latin actually "fake". This is the name given to erroneous corrections or later insertions in manuscripts made by scribes or readers. Especially often this term is used in criticism of the manuscripts of ancient writers. In these manuscripts... Literary Encyclopedia

    Finding intermediate values ​​of some regularity (function) by a number of its known values. In English: Interpolation See also: Data transformations Finam Financial Dictionary ... Financial vocabulary

    interpolation- and, well. interpolation f. lat. interpolatio change; alteration, distortion. 1. An insert of later origin in which l. text that does not belong to the original. ALS 1. There are many interpolations made by scribes in ancient manuscripts. Ush. 1934. 2 ... Historical Dictionary of Gallicisms of the Russian Language

    INTERPOLATION- (interpolatio), completion of empyrich. a series of values ​​of any quantity by its missing intermediate values. Interpolation can be done in three ways: mathematical, graphic. and logical. They are based on the general hypothesis that ... Big Medical Encyclopedia

    - (from the Latin interpolatio change, alteration), the search for intermediate values ​​of a quantity according to some of its known values. For example, finding the values ​​of the function y = f(x) at points x lying between the points x0 and xn, x0 ... Modern Encyclopedia

    - (from lat. interpolatio change alteration), in mathematics and statistics, the search for intermediate values ​​​​of a quantity according to some of its known values. For example, finding the values ​​of the function f (x) at points x lying between the points xo x1 ... xn, according to ... ... Big Encyclopedic Dictionary

Many of us have experienced incomprehensible terms in different sciences. But there are very few people who are not afraid incomprehensible words On the contrary, they cheer up and make you delve deeper into the subject being studied. Today we will talk about such a thing as interpolation. This is a method of plotting graphs using known points, which allows predicting its behavior on specific sections of the curve with a minimum amount of information about the function.

Before moving on to the essence of the definition itself and tell about it in more detail, let's delve a little into the history.

Story

Interpolation has been known since ancient times. However, this phenomenon owes its development to several of the most prominent mathematicians of the past: Newton, Leibniz and Gregory. It was they who developed this concept using the more advanced mathematical methods available at the time. Before that, interpolation, of course, was used and used in calculations, but they did it in completely inaccurate ways, requiring a large amount of data to build a model that is more or less close to reality.

Today, we can even choose which of the interpolation methods is more suitable. Everything is translated into a computer language that can predict with great accuracy the behavior of a function in a certain area, limited by known points.

Interpolation is a rather narrow concept, so its history is not so rich in facts. In the next section, we will understand what interpolation actually is and how it differs from its opposite - extrapolation.

What is interpolation?

As we have already said, this is the general name for methods that allow you to plot a graph by points. At school, this is mainly done by compiling a table, identifying points on a graph and roughly constructing lines connecting them. The last action is done based on considerations of the similarity of the function under study to others, the type of graphs of which we know.

However, there are other, more complex and exact ways perform the task of plotting a graph by points. So, interpolation is actually a "prediction" of the behavior of a function in a specific area, limited by known points.

There is a similar concept associated with the same area - extrapolation. It is also a prediction of the graph of a function, but beyond the known points of the graph. With this method, a prediction is made based on the behavior of a function over a known interval, and then this function is applied to an unknown interval as well. This method is very convenient for practical application and is actively used, for example, in economics to predict ups and downs in the market and to predict demographic situation in the country.

But we have deviated from the main topic. In the next section, we will understand what interpolation is and what formulas can be used to perform this operation.

Types of interpolation

by the most simple view is the nearest neighbor interpolation. With this method, we get a very approximate plot consisting of rectangles. If you have seen at least once an explanation of the geometric meaning of the integral on a graph, then you will understand what kind of graphical form we are talking about.

In addition, there are other methods of interpolation. The most famous and popular are associated with polynomials. They are more accurate and allow predicting the behavior of a function with a rather meager set of values. The first interpolation method we will look at is linear polynomial interpolation. This is the easiest method from this category, and for sure each of you used it at school. Its essence lies in the construction of straight lines between known points. As you know, a single straight line passes through two points of the plane, the equation of which can be found based on the coordinates of these points. Having built these straight lines, we get a broken graph, which, at the very least, but reflects the approximate values ​​of the functions and in in general terms matches reality. This is how linear interpolation works.

Complicated types of interpolation

There is a more interesting, but more hard way interpolation. It was invented by the French mathematician Joseph Louis Lagrange. That is why the calculation of interpolation by this method is named after him: interpolation by the Lagrange method. The trick here is this: if the method described in the previous paragraph uses only a linear function for calculation, then the Lagrange expansion also involves the use of polynomials more high degrees. But it is not so easy to find the interpolation formulas themselves for different functions. And the more points are known, the more accurate the interpolation formula is. But there are many other methods as well.

There is also a more perfect and closer to reality method of calculation. The interpolation formula used in it is a collection of polynomials, the application of each of which depends on the section of the function. This method is called a spline function. In addition, there are also ways to do such a thing as interpolation of functions of two variables. There are only two methods here. Among them are bilinear or double interpolation. This method allows you to easily build a graph by points in three-dimensional space. Other methods will not be affected. In general, interpolation is a universal name for all these methods of plotting graphs, but the variety of ways in which this action can be performed forces us to divide them into groups depending on the type of function that is subject to this action. That is, interpolation, an example of which we considered above, refers to direct methods. There is also inverse interpolation, which differs in that it allows you to calculate not a direct, but an inverse function (that is, x from y). We will not consider the latter options, since it is quite difficult and requires a good mathematical knowledge base.

Let's move on to perhaps one of the most important sections. From it we learn how and where the set of methods we are discussing is applied in life.

Application

Mathematics, as you know, is the queen of sciences. Therefore, even if at first you do not see the point in certain operations, this does not mean that they are useless. For example, it seems that interpolation is a useless thing, with the help of which only graphs can be built, which few people need now. However, in any calculations in engineering, physics and many other sciences (for example, biology), it is extremely important to present a fairly complete picture of the phenomenon, while having a certain set of values. The values ​​themselves, scattered over the graph, do not always give a clear idea of ​​the behavior of the function in a particular area, the values ​​of its derivatives and the points of intersection with the axes. And this is very important for many areas of our lives.

And how will it be useful in life?

It can be very difficult to answer such a question. But the answer is simple: no way. This knowledge is of no use to you. But if you understand this material and the methods by which these actions are carried out, you will train your logic, which will be very useful in life. The main thing is not the knowledge itself, but the skills that a person acquires in the process of studying. After all, it is not for nothing that there is a saying: "Live for a century - learn for a century."

Related concepts

You can understand for yourself how important this area of ​​mathematics was (and still is) by looking at the variety of other concepts associated with this. We have already talked about extrapolation, but there is also an approximation. Maybe you've heard this word before. In any case, we also analyzed what it means in this article. Approximation, like interpolation, are concepts related to plotting function graphs. But the difference between the first and the second is that it is an approximate construction of a graph based on similar known graphs. These two concepts are very similar to each other, and the more interesting it is to study each of them.

Conclusion

Mathematics is not as difficult a science as it seems at first glance. She's rather interesting. And in this article we tried to prove it to you. We looked at the concepts associated with plotting graphs, learned what double interpolation is, and analyzed with examples where it is used.

There is a situation when you need to find intermediate results in an array of known values. In mathematics, this is called interpolation. In Excel this method can be used both for tabular data and for plotting graphs. Let's take a look at each of these methods.

The main condition under which interpolation can be applied is that the desired value must be inside the data array, and not go beyond its limit. For example, if we have a set of arguments 15, 21 and 29, then when finding a function for argument 25, we can use interpolation. And to find the corresponding value for the argument 30 - no longer. This is the main difference between this procedure and extrapolation.

Method 1: Interpolation for tabular data

First of all, consider the use of interpolation for data that is located in a table. For example, let's take an array of arguments and their corresponding function values, the ratio of which can be described linear equation. These data are placed in the table below. We need to find the corresponding function for the argument 28 . The easiest way to do this is with the operator FORECAST.


Method 2: interpolating a graph using its settings

The interpolation procedure can also be used when plotting a function. It is relevant if the table on which the graph is based does not specify the corresponding function value for one of the arguments, as in the image below.


As you can see, the graph has been corrected, and the gap has been removed using interpolation.

Method 3: Graph interpolation with a function

You can also interpolate the graph using the special ND function. It returns null values ​​in the specified cell.


You can make it even easier without running Function Wizard, but just use the keyboard to drive a value into an empty cell "#N/A" without quotes. But it already depends on how it is more convenient for which user.

As you can see, in the Excel program, you can interpolate like tabular data using the function FORECAST, as well as graphics. In the latter case, this can be done using the graph settings or using the function ND, causing an error "#N/A". The choice of which method to use depends on the problem statement, as well as on the personal preferences of the user.

Interpolation. Introduction. General statement of the problem

When solving various practical problems, the results of research are drawn up in the form of tables showing the dependence of one or more measured quantities on one defining parameter (argument). Such tables are usually presented in the form of two or more rows (columns) and are used to form mathematical models.

Functions given in tables in mathematical models are usually written in tables of the form:

Y1(X)

Y(X0)

Y(X1)

Y(Xn)

Ym(X)

Y(X0)

Y(X1)

Y(Xn)

The limited information provided by such tables, in some cases, requires obtaining the values ​​of the functions Y j (X) (j=1,2,…,m) at points X that do not coincide with the nodal points of table X i (i=0,1,2,… ,n). In such cases, it is necessary to determine some analytical expression φ j (X) to calculate the approximate values ​​of the investigated function Y j (X) at arbitrarily specified points X . The function φ j (X) used to determine the approximate values ​​of the function Y j (X) is called an approximating function (from the Latin approximo - approaching). The proximity of the approximating function φ j (X) to the approximated function Y j (X) is ensured by the choice of the appropriate approximation algorithm.

We will do all further considerations and conclusions for tables containing the initial data of one investigated function (ie, for tables with m=1 ).

1. Methods of interpolation

1.1 Statement of the interpolation problem

Most often, to determine the function φ(X), a statement is used, called the statement of the interpolation problem.

In this classical formulation of the interpolation problem, it is required to determine an approximate analytical function φ(X) whose values ​​at the nodal points X i match the values Y(X i ) of the original table, i.e. conditions

ϕ (X i )= Y i (i = 0,1,2,...,n )

The approximating function φ(X) constructed in this way makes it possible to obtain a sufficiently close approximation to the interpolated function Y(X) within the range of values ​​of the argument [X 0 ; X n ], defined by the table. When setting the values ​​of the X argument, not owned this interval, the interpolation task is converted to the extrapolation task . In these cases, the accuracy

values ​​obtained when calculating the values ​​of the function φ(X) depends on the distance of the value of the argument X from X 0 if X<Х 0 , или отХ n , еслиХ >Xn.

In mathematical modeling, the interpolating function can be used to calculate the approximate values ​​of the function under study at intermediate points of the subintervals [Х i ; Xi+1]. Such a procedure is called table seal.

The interpolation algorithm is determined by the method of calculating the values ​​of the function φ(X). The simplest and most obvious implementation of the interpolating function is to replace the investigated function Y(X) on the interval [X i ; Х i+1 ] by a line segment connecting the points Y i , Y i+1 . This method is called the linear interpolation method.

1.2 Linear interpolation

With linear interpolation, the value of the function at the point X, located between the nodes X i and X i+1, is determined by the formula of a straight line connecting two adjacent points of the table

Y(X) = Y(Xi )+

Y(Xi + 1 ) − Y(Xi )

(X − Xi ) (i= 0,1,2, ...,n),

Xi+ 1− Xi

On fig. 1 shows an example of a table obtained as a result of measurements of a certain value Y(X) . Rows of the source table are highlighted. To the right of the table there is a scatter plot corresponding to this table. The compaction of the table is made due to the calculation by the formula

(3) values ​​of the function being approximated at points Х corresponding to the midpoints of subintervals (i=0, 1, 2, … , n ).

Fig.1. Compacted table of the function Y(X) and its corresponding diagram

When considering the graph in Fig. 1 it can be seen that the points obtained as a result of the compaction of the table using the linear interpolation method lie on the line segments connecting the points of the original table. Linear accuracy

interpolation, essentially depends on the nature of the interpolated function and on the distance between the nodes of the table X i, , X i+1 .

Obviously, if the function is smooth, then, even for relatively long distance between the nodes, a graph constructed by connecting the points with straight line segments makes it possible to accurately estimate the nature of the function Y(X). If the function changes quickly enough, and the distances between the nodes are large, then the linear interpolating function does not allow obtaining a sufficiently accurate approximation to the real function.

The linear interpolating function can be used for a general preliminary analysis and evaluation of the correctness of the interpolation results, which are then obtained by other more precise methods. Such an assessment becomes especially relevant in cases where calculations are performed manually.

1.3 Interpolation by canonical polynomial

The method of interpolating a function by a canonical polynomial is based on constructing an interpolating function as a polynomial in the form [ 1 ]

ϕ (x) = Pn (x) = c0 + c1 x + c2 x2 + ... + cn xn

The coefficients with i of the polynomial (4) are free interpolation parameters, which are determined from the Lagrange conditions:

Pn (xi )= Yi , (i= 0 , 1 , ... , n)

Using (4) and (5), we write the system of equations

Cx+ cx2

C xn = Y

Cx+ cx2

Cxn

Cx2

C xn = Y

Solution vector with i (i = 0, 1, 2, …, n ) of a system of linear algebraic equations(6) exists and can be found if there are no matching nodes among i nodes. The determinant of system (6) is called the Vandermonde determinant1 and has an analytical expression [2].

1 Vandermonde's determinant called the determinant

He zero if and only if xi = xj for some. (Material from Wikipedia - the free encyclopedia)

To determine the values ​​of coefficients with i (i = 0, 1, 2, … , n)

equations (5) can be written in the vector-matrix form

A* C=Y,

where A is the matrix of coefficients determined by the table of powers of the argument vector X= (x i 0 , x i , x i 2 , … , x i n ) T (i = 0, 1, 2, … , n)

x0 2

x0 n

xn 2

xn n

C is a column vector of coefficients i (i = 0, 1, 2, …, n), and Y is a column vector of values ​​Y i (i = 0, 1, 2, …, n) of the interpolated function at the interpolation nodes.

The solution to this system of linear algebraic equations can be obtained by one of the methods described in [3]. For example, according to the formula

С = A− 1 Y,

where A -1 is the matrix inverse of matrix A. To receive inverse matrix And -1, you can use the MOBR() function included in the set standard features programs Microsoft Excel.

After the values ​​of the coefficients with i are determined, using the function (4), the values ​​of the interpolated function can be calculated for any value of the arguments .

Let's write the matrix A for the table shown in Fig. 1, without taking into account the rows that condense the table.

Fig.2 Matrix of the system of equations for calculating the coefficients of the canonical polynomial

Using the MOBR() function, we obtain the matrix A -1 inverse to matrix A (Fig. 3). Then, according to formula (9), we obtain the vector of coefficients С=(c 0 , c 1 , c 2 , …, c n ) T shown in fig. 4.

To calculate the values ​​of the canonical polynomial in the cell of the column Y canonical corresponding to the values ​​0 , we introduce the formula transformed to the following form, corresponding to the zero row of the system (6)

=((((c 5

* x 0 + c 4 ) * x 0 + c 3 ) * x 0 + c 2 ) * x 0 + c 1 ) * x 0 + c 0

C0 +x *(c1 + x *(c2 + x*(c3 + x*(c4 + x* c5 ))))

Instead of writing " c i " in a formula entered into a cell Excel tables, there must be an absolute reference to the corresponding cell containing this coefficient (see Fig. 4). Instead of "x 0" - a relative reference to the column column X (see Fig. 5).

Y canonical (0) of the value that matches the value in cell Y lin (0) . When dragging a formula written in a cell Y canonical (0), the values ​​of Y canonical (i) must also match, corresponding to the node points of the original

tables (see Fig. 5).

Rice. 5. Diagrams built according to the tables of linear and canonical interpolation

Comparison of graphs of functions built according to tables calculated using the formulas of linear and canonical interpolation, we see in a number of intermediate nodes a significant deviation of the values ​​obtained by the formulas of linear and canonical interpolation. It is more reasonable to judge the accuracy of interpolation based on obtaining additional information about the nature of the process being modeled.