# Least Square Method

## What is Least Square Method?

The Least Square Method is a mathematical regression analysis used to determine the best fit for processing data while providing a visual demonstration of the relation between the data points. Each point in the set of data represents the relation between any known independent value and any unknown dependent value. Also known as the Least Squares approximation, it is a method to estimate the true value of a quantity-based on considering errors either in measurements or observations.

In other words, the Least Square Method is also the process of finding the curve that is best fit for data points through reduction of the sum of squares of the offset points from the curve. During finding the relation between variables, the outcome can be quantitatively estimated, and this process is known as regression analysis.

The method of curve fitting is an approach to this method, where fitting equations approximate the curves to raw data, with the least square. From the above definition, it is pretty obvious that fitting of curves is not unique. Therefore, we need to find a curve with minimal deviation for all the data points in the set and the best fitting curve is then formed by the least-squares method.

### When is the Least Square Method Used?

The Least Squares formula is an equation that is described with parameters. It is generously used in both regression and evaluation. In the process of regression analysis, this method is defined as a standard approach for the least square approximation example of the set of equations with more unknowns than the equations.

It is also used as a solution for the minimization of the sum of squares of all the deviations or the errors that result in each equation. Practically, it is used in data fitting where the best fit is to reduce the sum of squared residuals of the differences between the approximated value and the corresponding fitted value.

### Least Square Method Formula:

The Least Square Method says that the curve that fits a set of data points is the curve that has a minimum sum of squared residuals of the data points.

Let us assume that the data points are:

(x1,y1), (x2,y2), (x3,y3), …, (xn,yn)

Here, all the x's are the independent values and all the y's are the dependent variables. Suppose the equation f(x) is a fitting curve and d is the deviation from each point then,

d1 = y1 − f(x1)

d2 = y2 − f(x2)

…..

dn = yn – f(xn)

S = $\sum _{i\to1}^{n}d_{i}^{2}$
S = $\sum _{i\to1}^{n}[y_{i}-fx_{i}]^{2}$

S = d12+d22+d32+....dn2

### Types of Least Squares problems

The two categories of the problems are:

1. Linear or ordinary least squares

2. Non-linear least squares.

The type of problem depends on the linearity of the residuals. The linear problems are mostly seen in the regression analysis of the statistics while on the other hand, the non-linear problems are mostly used in the iterative method where the model is approximated to be linear with each iteration.

### Least Square Method Graph

The data points are minimized through the method of reducing offsets of each data point from the line. The vertical offsets are used in polynomial, hyperplane and surface problems while horizontal offsets are used in common problems.

### Least Square Method Example

A practical example of the Least Square Method is an analyst who wants to test the relation between stock returns and returns of the index in which the stock is a component of a company. The analyst decides to test the dependency of the stock returns and the index returns. In order to get this, he plots all the stock returns on the chart. With respect to this chart, the index returns are designated as independent variables with stock returns being the dependent variables. The line that best fits all these data points gives the analyst, coefficients that determine the level of dependence of the returns.

### Uses of Least Square Method

The Least Square Method is used in order to find the independent variables in different fields coming from Anthropology to Zoology:

• Medicine: Study of Smoking and Life Expectancy based on it.

• Economy: Study of the relation between Capital investment and Sales.

• Biology: Study of Measured Data - Age and Length of Fish.

• Agriculture: Study related to age and yield of the site.

### Limitations of Least-Square Method

Even though known as the best method for curve fitting and for finding the independent variables, Least Square Methods have some limitations. These shortcomings prevent it from being applied universally. When we talk about the regression analysis that utilizes the least square method, it is assumed that the errors in the respective independent variables are zero. But in reality, these errors in the independent variables should not be neglected as they would lead to subjective measurement errors.

That being said, the least square method leads to a hypothetical testing process where confidence intervals and parameter estimates are to be added due to the occurrence of errors in independent variables.