Least Squares Regression

Weighted mean of all the slopes

We must weight the different samples with an expression that is always positive and increases with the distance from origo. One way of doing this is to use the square of the x-values as weights, which gives the expression below.

weighted mean equation

This expression turns out to be identical to the common definition of least squares regression. The result of applying this formula to the dataset is shown in the figure:

plot of dataset

One should note that the datapoints far away from origo is given a very high weight. If one of these datapoints by accident had a very large error, this error would thus have a big influence on the model.



previous next