# математика – Linear extrapolation in two-dimensional space. – Linear approximation of a table function of two variables

## Question:

There is a two-dimensional space and there is an array consisting of `x` , `y` and `v` : two coordinates and a value. How to calculate new values ​​for arbitrary coordinates based on existing values?

They say this is solved using linear extrapolation methods. Tell me where to get the formula or the source code of the program for such a primitive case as mine?

Consider the problem of linear approximation of a tabularly given function of two variables.

FORMULATION OF THE PROBLEM

The function u(x, y) is given by its values ​​u i at the points with coordinates (x i , y i ), i = 0, 1, … n-1.

It is required to determine the coefficients A, B, C of the linear approximating function
U(x, y) = Ax + By + C,
minimizing residual
δ(A, B, C) = ∑ i (Ax i + By i + C – v i ) 2 .

SOLUTION

The residual function depends on three variables A, B, C. The necessary conditions for the minimum of this function are zero partial derivatives with respect to each of these variables:
δ' A = 0; δ' B = 0; δ' C = 0.
These conditions lead to the 3rd order SLAE:

2∑ i (Ax i + By i + C – v i )x i = 0;
2∑ i (Ax i + By i + C – v i )y i = 0;
2∑ i (Ax i + By i + C – v i ) = 0,

i x i 2 A + ∑ i x i y i B + ∑ i x i z i C = ∑ i x i v i ,

i x i y i A + ∑ y i 2 B + ∑ i y i z i C = ∑ i y i v i ,

i x i z i A + ∑ y i z i B + ∑z i 2 C = ∑ i z i v i ,

the solution of which (for example, according to Cramer's rule) is not a problem.

Scroll to Top