Menu
Is free
Registration
home  /  Relations/ RMS approximation. Root-mean-square approximation of tabularly given functions

RMS approximation. Root-mean-square approximation of tabularly given functions

Let the table contain the values ​​of the function obtained, for example, from experiment, i.e., measured with an error. Then the approximation using interpolation apparatus , which is based on equating the values ​​of the polynomial in the interpolation nodes to the table values, impractical.

With such a formulation of the problem, one should perform an average approximation, i.e., describe a tabularly given function by some fairly simple analytical dependence that has a small number of parameters. The optimal choice of these parameters will allow us to perform the root-mean-square approximation of the function given by the table.

Selecting the type of analytical dependence should start by putting tabular data on coordinate plane- so the field of experimental points will be formed. A smooth curve is drawn through the field of these points so that some of the points lie on this curve, some of the points are higher, and some of the points are lower than the drawn curve. By the form of this curve, one should determine the type of analytical dependence - whether it is linear, exponential, hyperbolic or any other.

However, according to the graph, it is very difficult to choose the type of analytical dependence by eye. Therefore it was proposed a method of rough estimation and choice of the type of analytical dependence. This method is really approximate and inaccurate, since the curve can be drawn in different ways through the field of experimental points, and different reference points can be taken in the table for calculation, and the accuracy of the proposed technique is unknown. At the same time, it can be considered as an approximate way of choosing the type of dependence.

The following algorithm of actions is proposed.

1. In the source table, select two points far apart from each other with coordinates (x 1, y 1) and (x n, y n) - reference points, and for each pair of coordinates calculate the arithmetic mean, geometric mean and harmonic mean.

2. On the curve drawn through the field of experimental points, find three ordinates corresponding to the found abscissas x ar, x geom, x harmm:

3. Perform a comparison found on the curve with the calculated by calculating the following modules of differences:

4. From the found values, the minimum is selected:

5. Conclusions: if it turned out to be minimal

Linear dependence

Dependence is indicative

Dependence fractional-linear

The dependence is logarithmic

Power dependence

Dependence hyperbolic

Fractional-rational dependence



Any of these dependencies can be reduced to a linear one by performing a coordinate transformation or the so-called data alignment.
Thus, the first stage ends with the choice of the type of analytical dependence, the parameters of which are not defined.

Second phase consists in determining the best values ​​of the coefficients of the selected analytical dependence. For this, mathematical least square method.

The method is based on minimizing the sum of squared deviations of the given tabular values ​​() from those calculated according to the theoretical dependence (): .

Let the chosen dependence be straight line: . Substitute in the functional: . Then the functional is minimized:

To find the best values ​​of the coefficients and it is necessary to find the partial derivatives of with respect to and and equate them to zero:

After transformations, the system of equations takes the form:

Solution of this system linear equations allows you to find best values coefficients and linear dependence.

If the selected dependency is quadratic parabola:

then the functional is minimized: .

The parabola has three variable coefficients - , the best values ​​of which should be found by equating to zero the partial derivatives of the minimized functional with respect to the desired coefficients . This allows us to obtain the following system of three linear equations for finding the coefficients :

Example 1 Determine the type of dependency given by the following table.

X
Y 0,55 0,64 0,78 0,85 0,95 0,98 1,06 1,11

Solution.

The points specified in the table should be applied to the coordinate plane - a field of experimental data. Through this field smooth curve.

According to the table are selected two anchor points with coordinates (3; 0.55) and (10; 1.11) and for each pair of abscissas and ordinates, the arithmetic, geometric and harmonic mean are calculated:



For the three calculated abscissas along the curve drawn through the field of experimental points, three corresponding ordinates are determined:

Note on the orientation of the calculations. Next, seven difference modules are defined:

Three minimal, close to each other values ​​are obtained

At the second stage, it is necessary to determine the best values ​​of the coefficients for each of these dependencies using the least squares method, and then calculate the standard deviation from the given tabular values.

The final choice of the analytical dependence is performed by the minimum value of the standard deviation.

Example 2 The table shows the results experimental studies, which can be approximated by a straight line. Find the best values ​​of the coefficients of the line by applying the least squares method.

Solution.

k X k Y k X k Y k X k 2 Y k theor Y k -Y k theory (Y k -Y k theory) 2
66,7 67,50 0,20 0,0400
71,0 284,0 70,98 0,02 0,0004
76,3 763,0 76,20 0,10 0,0100
80,6 1209,0 80,55 0,05 0,0025
85,7 1799,7 85,77 - 0,07 0,0049
92,9 2694,1 92,73 0,17 0,0289
99,4 3578,4 98,82 0,58 0,3364
113,6 5793,6 111,87 1,73 2,9929
125,1 8506,8 126,66 - 1,56 2,4336
amounts 811,3 24628,6 5,8496

General equation of a straight line: .

The system of linear equations, from which the best values ​​of the coefficients and should be determined, guided by the least squares method, has the form:

Let us substitute the calculated sums from the 2nd, 3rd, 4th and 5th columns of the last row of the table into the system of equations:

Where are the coefficients of linear dependence determined from? So the equation of the theoretical line has the form:

. (*)

The sixth column of the table shows the function values ​​calculated by the theoretical equation for the given values ​​of the argument. The seventh column of the table shows the values ​​of the differences between the given values ​​of the function (3rd column) and the theoretical values ​​(6th column) calculated by the equation (*).

The eighth column shows the squared deviations of the theoretical values ​​from the experimental values ​​and the sum of the squared deviations is determined. Now you can find

Example 3 Let the experimental data given in the table be approximated by a quadratic parabola: Find the best values ​​for the coefficients of the parabola by applying the least squares method.

Solution.

k X k Y k X k 2 X k 3 X k 4 X k Y k X k 2 Y k Y k theor Y k -Y k theory
29,8 29,28 0,52 0,2704
22,9 45,8 91,6 22,22 0,68 0,4624
17,1 68,4 273,6 17,60 -0,50 0,2500
15,1 75,5 377,5 15,56 -0,46 0,2116
10,7 85,6 684,8 11,53 -0,83 0,6889
10,1 101,0 1010,0 10,60 -0,50 0,2500
10,6 127,2 1526,4 11,06 -0,46 0,2116
15,2 228,0 3420,0 14,38 0,82 0,6724
Sumy 122,5 731,5 7383,9 3,0173

The system of linear equations for determining the coefficients of a parabola has the form:

From the last row of the table, the corresponding sums are substituted into the system of equations:

The solution of the system of equations allows you to determine the values ​​of the coefficients:

So, the dependence given by the table on the segment is approximated by a quadratic parabola:

Calculation according to the given formula for the given values ​​of the argument makes it possible to form the ninth column of the table containing the theoretical values ​​of the function.

The sum of the squared deviations of the theoretical values ​​from the experimental ones is given in the last line of the 11th column of the table. This allows you to determine standard deviation:

PRACTICE #3

Topic: Methods for solving systems of equations

Gauss method - method of successive exclusion of unknowns - belongs to the group precise methods and if there were no calculation error, an exact solution could be obtained.

For manual calculations, it is advisable to conduct calculations in a table containing a control column. Below is a general version of such a table for solving a system of linear equations of the 4th order.

Free members Control column

Free members Control column

Example 1 Using the Gauss method, solve the system of equations of the 4th order:

These approximate values ​​of the roots can be substituted into the original system of equations and calculated residuals - , which are the differences between the right and left parts of each equation of the system when substituting the found roots into the left part. Then they are substituted as free members of the residual system and get amendments

roots - :

In order to smooth the discrete functions of Altman, and thereby introduce the idea of ​​continuity into the theory, the root-mean-square integral approximation by a polynomial of different degrees was used.

It is known that a sequence of interpolation polynomials over equidistant nodes does not necessarily converge to a function, even if the function is infinitely differentiable. For the approximated function, with the help of a suitable arrangement of nodes, it is possible to reduce the degree of the polynomial. . The structure of the Altman functions is such that it is more convenient to use the approximation of the function not by means of interpolation, but by constructing the best root-mean-square approximation in a normalized linear space. Consider the basic concepts and information in constructing the best approximation. Approximation and optimization problems are posed in linear normed spaces.

Metric and linear normed spaces

The broadest concepts of mathematics include "set" and "mapping". The concept of "set", "set", "collection", "family", "system", "class" in non-strict set theory are considered synonyms.

The term "operator" is identical to the term "mapping". The terms "operation", "function", "functional", "measure" are special cases of the concept "mapping".

The terms "structure", "space" in the axiomatic construction of mathematical theories have also now acquired fundamental significance. Mathematical structures include set-theoretic structures (ordered and partially ordered sets); abstract algebraic structures (semigroups, groups, rings, division rings, fields, algebras, lattices); differential structures (outer differential forms, fiber spaces) , , , , , , .

A structure is understood as a finite set consisting of sets of a carrier (main set), a numerical field (auxiliary set), and a mapping defined on the elements of the carrier and numbers of the field. If the set of complex numbers is taken as the carrier, then it plays the role of both the main and auxiliary sets. The term "structure" is identical to the concept of "space".

To define a space, it is first of all necessary to define a carrier set with its elements (points), denoted by Latin and Greek letters

Sets of real (or complex) elements can act as a carrier: numbers; vectors, ; Matrices, ; Sequences, ; Functions

Sets can also act as carrier elements: real axis, plane, three-dimensional (and multidimensional) space, permutations, movements; abstract sets.

Definition. A metric space is a structure that forms a triple, where the mapping is a non-negative real function of two arguments for any x and y from M and satisfies three axioms.

  • 1 - non-negativity; , at.
  • 2- - symmetry;
  • 3- - axiom of reflexivity.

where are the distances between the elements.

In a metric space, a metric is specified and the concept of the proximity of two elements from the support set is formed.

Definition. A real linear (vector) space is a structure where mapping is the additive operation of adding elements belonging to it, and mapping is the operation of multiplying a number by an element from.

The operation means that for any two elements, the third element is uniquely defined, called their sum and denoted by, and the following axioms hold.

commutative property.

Associative property.

There is a special element in B, denoted by such that it holds for any.

for any exists, such that.

The element is called opposite to and is denoted by.

The operation means that for any element and any number, an element is defined, denoted by and the axioms are satisfied:

An element (points) of a linear space is also called a vector. Axioms 1 - 4 define a group (additive), called a module and representing a structure.

If an operation in a structure does not obey any axioms, then such a structure is called a groupoid. This structure is extremely poor; it does not contain any axiom of associativity, then the structure is called a monoid (semigroup).

In the structure, with the help of mapping and axioms 1-8, the property of linearity is set.

So, the linear space is a group module, in the structure of which one more operation is added - multiplication of the support elements by a number with 4 axioms. If instead of the operation, along with one more group operation of multiplication of elements with 4 axioms, and postulate the axiom of distributivity, then a structure called a field arises.

Definition. A linear normed space is a structure in which the mapping satisfies the following axioms:

  • 1. And then and only then, when.
  • 2. , .
  • 3. , .

And so in just 11 axioms.

For example, if we add a module that has all three properties of the norm to the structure of the field of real numbers, where are real numbers, then the field of real numbers becomes a normed space

There are two common ways to introduce the norm: either by explicitly specifying the interval form of the homogeneously convex functional , , or by specifying the scalar product , .

Let, then the form of the functional can be specified in an infinite number of ways by changing the value:

  • 1. , .
  • 2. , .

………………..

…………….

The second common way of accepting the assignment is that another mapping is introduced into the space structure (a function of two arguments, usually denoted by and called the scalar product).

Definition. Euclidean space is a structure in which the scalar product contains the norm and satisfies the axioms:

  • 4. , and if and only if

In Euclidean space, the norm is generated by the formula

It follows from properties 1 - 4 of the scalar product that all axioms of the norm are satisfied. If the scalar product is in the form, then the norm will be calculated by the formula

The space norm cannot be specified using the scalar product , .

In spaces with a scalar product, such qualities appear that are absent in linear normed spaces (orthogonality of elements, parallelogram equality, the Pythagorean theorem, Apollonius's identity, Ptolemy's inequality. The introduction of a scalar product provides ways to more efficiently solve approximation problems.

Definition. An infinite sequence of elements in a linear normed space is said to be norm-converging (simply convergent or having a limit in) if there exists such an element that for any there is a number depending on such that for

Definition. A sequence of elements in is called fundamental if for any there is a number depending on that any and are satisfied (Trenogin Kolmogorov, Kantorovich, p. 48)

Definition. A Banach space is a structure in which any fundamental sequence converges in norm.

Definition. A Hilbert space is a structure in which any fundamental sequence converges in the norm generated by the scalar product.

Let's take a semi-quadratic coordinate system. This is such a coordinate system, in which the scale is quadratic along the abscissa, i.e. the division values ​​are plotted according to the expression, here m- scale in some unit of length, for example, in cm.

A linear scale is plotted along the y-axis in accordance with the expression

We put experimental points on this coordinate system. If the points of this graph are located approximately in a straight line, then this confirms our assumption that the dependence y from x is well expressed by a function of the form (4.4). To find the coefficients a and b you can now apply one of the methods discussed above: the stretched thread method, the selected points method, or the average method.

Tight thread method applies in the same way as for a linear function.

Selected points method we can apply like this. On a rectilinear graph, take two points (far from each other). We denote the coordinates of these points and ( x, y). Then we can write

From the reduced system of two equations, we find a and b and substitute them into formula (4.4) and obtain the final form of the empirical formula.

You can not build a straight line graph, but take the numbers , ( x,y) directly from the table. However, the formula obtained with this choice of points will be less accurate.

The process of converting a curved graph to a straight line is called flattening.

Medium method. It is applied in the same way as in the case of linear dependence. We divide the experimental points into two groups with the same (or almost the same) number of points in each group. Equality (4.4) can be rewritten as

We find the sum of residuals for the points of the first group and equate to zero. We do the same for the points of the second group. We get two equations with unknowns a and b. Solving the system of equations, we find a and b.

Note that when applying this method, it is not required to build an approximating straight line. A scatter plot in a semi-quadratic coordinate system is needed only to check that a function of the form (4.4) is suitable for an empirical formula.

Example. When studying the effect of temperature on the course of the chronometer, the following results were obtained:

z -20 -15,4 -9,0 -5,4 -0,6 +4,8 +9,4
2,6 2,01 1,34 1,08 0,94 1,06 1,25

In this case, we are not interested in the temperature itself, but in its deviation from . Therefore, we take as an argument , where t- temperature in degrees Celsius of the usual scale.

Having plotted the corresponding points on the Cartesian coordinate system, we notice that a parabola with an axis parallel to the y-axis can be taken as an approximating curve (Fig. 4). Let's take a semi-quadratic coordinate system and plot experimental points on it. We see that these points fit well enough on a straight line. So the empirical formula

can be searched in the form (4.4).

Let's define the coefficients a and b by the average method. To do this, we divide the experimental points into two groups: in the first group - the first three points, in the second - the remaining four points. Using equality (4.5) we find the sum of residuals for each group and equate each sum to zero.

Often the values ​​of the interpolated function u, u2 , ..., yn are determined from the experiment with some errors, so it is unreasonable to use the exact approximation at the interpolation nodes. In this case, it is more natural to approximate the function not by points, but by average, i.e., in one of the L p norms.

Space 1 p - set of functions d(x), defined on the segment [a, b] and modulo integrable with p-th degree, if the norm is defined

Convergence in such a norm is called convergence in average. The space 1,2 is called the Hilbert space, and the convergence in it is rms.

Let the function Ax) and the set of functions φ(x) from some linear normed space be given. In the context of the problem of interpolation, approximation, and approximation, the following two problems can be formulated.

First task is an approximation with a given accuracy, i.e., according to a given e find a φ(x) such that the inequality |[Ax) - φ(x)|| G..

Second task is a search the best approximation i.e., the search for a function φ*(x) that satisfies the relation:

Let us define without proof a sufficient condition for the existence of the best approximation. To do this, in the linear space of functions, we choose a set parametrized by the expression

where the set of functions φ[(x), ..., φn(x) will be assumed to be linearly independent.

It can be shown that in any normed space with linear approximation (2.16) the best approximation exists, although it is unique in any linear space.

Let us consider the Hilbert space LzCp) of real square-integrable functions with weight p(x) > 0 on [ , where the scalar product ( g,h) determined by

formula:

Substituting the linear combination (2.16) into the best approximation condition, we find

Equating to zero the derivatives with respect to the coefficients (D, k= 1, ..., П, we obtain a system of linear equations

The determinant of the system of equations (2.17) is called the Gram determinant. Gram's determinant is nonzero, since it is assumed that the system of functions φ[(x), ..., φn(x) is linearly independent.

Thus, the best approximation exists and is unique. To obtain it, it is necessary to solve the system of equations (2.17). If the system of functions φ1(x), ..., φn(x) is orthogonalized, i.e., (φ/, φ,) = sy, where SCH,ij = 1, ..., P, then the system of equations can be solved in the form:

The coefficients found according to (2.18) Q, ..., th p are called the coefficients of the generalized Fourier series.

If a set of functions φ t (X), ..., φ "(x), ... forms a complete system, then by virtue of Parseval's equality for Π -» with the norm of error decreases indefinitely. This means that the best approximation converges rms to Dx) with any given accuracy.

We note that the search for the coefficients of the best approximation by solving the system of equations (2.17) is practically unrealizable, since as the order of the Gram matrix increases, its determinant rapidly tends to zero, and the matrix becomes ill-conditioned. Solving a system of linear equations with such a matrix will lead to a significant loss of accuracy. Let's check it out.

Let as a system of functions φ„ i =1, ..., П, degrees are chosen, i.e. φ* = X 1 ", 1 = 1, ..., P, then, assuming the segment as an approximation segment, we find the Gram matrix

The Gram matrix of the form (2.19) is also called the Hilbert matrix. This is a classic example of a so-called ill-conditioned matrix.

Using MATLAB, we calculate the determinant of the Hilbert matrix in the form (2.19) for some first values P. Listing 2.5 shows the code for the corresponding program.

Listing 23

% Calculate the determinant of Hilbert matrices % clear the workspace clear all;

%choose the maximum value of the order % of the Hilbert matrix ptah =6;

%build a loop to generate %Hilbert matrices and calculate their determinants

for n = 1: nmax d(n)=det(hi I b(n)); end

%display the values ​​of the determinants %of the Hilbert matrices

f o g ta t short end

After working out the code in Listing 2.5, the Hilbert matrix determinant values ​​for the first six matrices should appear in the MATLAB command window. The table below shows the corresponding numerical values ​​of the matrix orders (n) and their determinants (d). The table clearly shows how quickly the determinant of the Hilbert matrix tends to zero as the order increases and, starting from orders 5 and 6, becomes unacceptably small.

Table of values ​​of the determinant of Hilbert matrices

Numerical orthogonalization of the system of functions φ, i = 1, ..., П also leads to a noticeable loss of accuracy, therefore, in order to take into account big number terms in expansion (2.16), it is necessary either to carry out orthogonalization analytically, i.e., exactly, or to use a ready-made system of orthogonal functions.

If during interpolation, degrees are usually used as a system of basis functions, then during approximation, on average, polynomials that are orthogonal with a given weight are chosen as basis functions. The most common of these are the Jacobi polynomials, a special case of which are the Legendre and Chebyshev polynomials. Lagsrr and Hermite polynomials are also used. More details about these polynomials can be found, for example, in the appendix Orthogonal polynomials books.

In the previous chapter, one of the most common methods for approximating functions, interpolation, was considered in detail. But this way is not the only one. When solving various applied problems and constructing computational circuits, other methods are often used. In this chapter, we will look at ways to obtain root-mean-square approximations. The name of approximations is associated with metric spaces in which the problem of approximation of a function is considered. In Chapter 1, we introduced the concepts of "metric linear normed space" and "metric Euclidean space" and saw that the approximation error is determined by the metric of the space in which the approximation problem is considered. In different spaces, the concept of error has a different meaning. Considering the interpolation error, we did not focus on this. And in this chapter we will have to deal with this issue in more detail.

5.1. Approximations by trigonometric polynomials and Legendre polynomials Space l2

Consider the set of functions that are Lebesgue square-integrable on the segment
, that is, such that the integral must exist
.

Since the obvious inequality holds, from the square integrability of the functions
and
must also follow the square integrability of any of their linear combinations
, (where
and
 any real numbers), as well as the integrability of the product
.

Let us introduce on the set of functions that are Lebesgue square integrable on the interval
, the dot product operation

. (5.1.1)

It follows from the properties of the integral that the introduced scalar product operation has almost all the properties of the scalar product in Euclidean space (see paragraph 1.10, p. 57):


Only the first property is not fully executed, that is, the condition will not be met.

Indeed, if
, then it does not follow that
on the segment
. In order for the introduced operation to have this property, in what follows we agree not to distinguish (consider equivalent) the functions
and
,
for which

.

In view of the last remark, we have seen that the set of Lebesgue square integrable functions (more precisely, the set of classes of equivalent functions) forms a Euclidean space in which the scalar product operation is defined by formula (5.1.1). This space is called the Lebesgue space and is denoted
or shorter .

Since every Euclidean space is automatically both normed and metric, the space
is also a normed and metric space. The norm (element size) and metric (distance between elements) are usually entered in it in a standard way:


(5.1.2)


(5.1.3)

Properties (axioms) of the norm and metric are given in Section 1.10. Space elements
are not functions, but classes of equivalent functions. Functions belonging to the same class can have different values ​​on any finite or even countable subset
. Therefore, approximations in space
are defined ambiguously. This unpleasant feature of space
paid off by the convenience of using the scalar product.