The method of least squares

When several people measure the same amount, they generally don't get the same results. In fact, if the same person measures the same amount multiple times, the results will vary. What is the best estimate for the true measurement? The Definition: Least Squares Method provides a way to find the best estimate, assuming that the errors (that is, the differences from the true value) are random and unbiased.

What are least squares?

It is a numerical analysis procedure in which, given a data set (ordered pairs and family of functions), an attempt is made to determine the continuous function that best approximates the data (regression line or the line of best fit), providing a visual demonstration of the relationship between the points of the same. In its simplest form, it seeks to minimize the sum of squares of the ordered differences (called residuals) between the points generated by the function and the corresponding data.

This method is commonly used to analyze a series of data obtained from a study, in order to express their behavior in a linear way and thus minimize the errors of the data taken.

The creation of the Definition: Least Squares Method It is generally credited to the German mathematician Carl Friedrich Gauss, who raised it in 1794 but did not publish it until 1809. The French mathematician Andrien-Marie Legendre was the first to publish it in 1805, he developed it independently.

Definition:

Its general expression is based on equation of a line y = mx + b. Where m is the slope and b the cut-off point, and they are expressed as follows:

least squares7

Σ is the summation symbol of all the terms, while (x, y) are the data under study and n the amount of data that exists.

The least squares method calculates from the N pairs of experimental data (x, y), the values m and b that best fit the data to a line. The best fit is understood as the line that minimizes the distances d from the measured points to the line.

Having a series of data (x, y), shown in a graph or graph, if a line is not described when connecting point to point, we must apply the method of least squares, based on its general expression:

Definition: Least Squares Method

When using the least squares method, a line of best fit should be sought that explains the possible relationship between an independent variable and a dependent variable. In regression analysis, dependent variables are designated on the vertical y-axis and independent variables are designated on the horizontal x-axis. These designations will form the equation for the line of best fit, which is determined from the Definition: Least Squares Method.

Example of the method of least squares

To clearly understand the application of the method, let's see an example:

Find the line that best fits the following data:

least squares2

Let's look at the graph:

least squares3

We need to find a line y = mx + b. We must apply the least squares method. As we already know then, we will first center the value (x ∙ y):

least squares4

Second by the expressions of m and b we must find the value x²:

Now we can get the values of the sum of each column:

\ sum x = 55 \ hspace {0.8em}; \ hspace {0.8em} \ sum y = 57 \ hspace {0.8em}; \ hspace {0.8em} \ sum (x · y) = 233 \ hspace {0.8em }; \ hspace {0.8em} \ sum {x ^ {2}} = 473 \ hspace {0.8em}; \ hspace {0.8em} n = 9

We substitute in each of the expressions:

m = \ frac {\ left (9 \ cdot 233-55 \ cdot 57 \ right)} {9 \ cdot 473- \ left | 55 \ right | ^ {2}} = - \ frac {1038} {1232} = - 0.84

b = \ frac {\ left (57 \ cdot 473-55 \ cdot 233 \ right)} {9 \ cdot 473- \ left | 55 \ right | ^ {2}} = \ frac {14146} {1232} = 11.48

The line obtained with the least squares method is as follows:

y = \ left (-0.84 \ right) \ cdot x + 11.48

Let's look at the graph:

least squares6

We see that the line cuts the y axis at 11.48 and the x axis at 13.57. Therefore, if we want to know where it cuts on the x axis, we equate the equation y = 0:

0 = \ left (-0.84 \ right) \ cdot x + 11.48

We clear x:

x = - \ frac {11.48} {- 0.84} = 13.57

Other items that might interest you: Standard form of a linear function

Is the day of your exam and you have doubts about it? You have to solve problems math and you don't know how? In MiProfe we can help you! We have for you online classes that you can hire regardless of where you are, we have an online tutor who can help you 7 days a week! And the best thing is that we have lesson plans with which you can ensure great savings.

Choose the plan that works best for you and start learning with MiProfe: