The math behind the linear regression

In the example of straight-line motion, the slope was known, which was a hypothesis we made to observe how the speed of our object would have changed over time. When applying this linear relationship model to a set of data, like for instance our data, we do not know this parameter and estimating it is actually the main point when dealing with a linear regression model.

The following equation formally represents a linear regression model:

As you can see, it is similar to the speed formula, except for the β0 term, which is called the intercept. It defines the value of y in the case of x being equal to zero. The β1 term is the slope we were talking about before.

As we were also saying, the main task when estimating a linear regression model is to define that slope parameter. Which criterion would you follow to estimate this coefficient? You should definitely try to draw your line in a way that goes as close as possible to the points of your population. Let me show you this with a sketch:

As you can see, we have here two lines that both start from the same point, but the first one, the green one, goes through the points representing the records, while the red one starts very soon going into the sky. What is the difference? I know you are guessing it: the difference is the slope since they all start from the same point, that is, they have the same intercept.

And by the way, saying they start from the same point means they both have the same intercept: you can verify this looking at the point where x is equal to 0. You see? Both start from x equal to 0 and y equal to 1.5. 

So, we know that the desired line has to go through the observed records. But, how do we measure how much through it is going? An intuitive is the residual, the difference between the estimated value and the observed one. If you take the previous example, you can see that, for instance, when x is equal to 2, our observed y is equal to 2.5, while the estimated y is equal to 2. Within this case, we have a residual of 2.5 - 2.

We therefore want to minimize these residuals. The most common way to minimize these residuals is by employing the ordinary least squares technique.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset