by Kardi Teknomo


< Previous | Next | Content >

OLS: Ordinary Least Square Method

For those of you who love mathematics and would like to know from how the linear regression formula was derived, in this section of tutorial you will learn a powerful method called Ordinary Least Square (OLS). I assume that you know calculus to perform the OLS method. Knowing this method is important that you may learn to derive many regression formulas by yourselves.

Let us start with notation.

OLS: Ordinary Least Square Method is data of independent variable from observation

OLS: Ordinary Least Square Method is the mean of OLS: Ordinary Least Square Method

OLS: Ordinary Least Square Method is data of dependent variable from observation

OLS: Ordinary Least Square Method is the mean of OLS: Ordinary Least Square Method

OLS: Ordinary Least Square Method is the estimated of OLS: Ordinary Least Square Method , that is represented by the regression model.

OLS: Ordinary Least Square Method is the number of observation data

To perform ordinary least square method, you do the following steps:

  1. Set a difference between dependent variable and its estimation: OLS: Ordinary Least Square Method
  2. Square the difference: OLS: Ordinary Least Square Method
  3. Take summation for all data OLS: Ordinary Least Square Method
  4. To get the parameters that make the sum of square difference become minimum, take partial derivative for each parameter and equate it with zero, OLS: Ordinary Least Square Method

For example:

Find for model parameter for model estimation OLS: Ordinary Least Square Method using Ordinary Least square!

Answer:

OLS: Ordinary Least Square Method

The model only has two parameters, that is OLS: Ordinary Least Square Method and OLS: Ordinary Least Square Method .

We take partial derivative of the sum of square difference to the first parameter and equate it to zero OLS: Ordinary Least Square Method . In taking the partial derivative, we assume OLS: Ordinary Least Square Method , OLS: Ordinary Least Square Method and OLS: Ordinary Least Square Method are constant while OLS: Ordinary Least Square Method is the only variable.

OLS: Ordinary Least Square Method

Equate it with zero we have

OLS: Ordinary Least Square Method

Actually, the two parameters, OLS: Ordinary Least Square Method and OLS: Ordinary Least Square Method , are the real constants and they can go out of the summation sign. Constant 2 is surely not equal to zero, thus we can cancel out to simplify.

OLS: Ordinary Least Square Method

We know that OLS: Ordinary Least Square Method , thus we can simplify the last equation into

regressionparameter (1)

Now, we take partial derivative of the sum of square difference to the second parameter and equate it to zero OLS: Ordinary Least Square Method . Similar to before, in taking partial derivative, we assume OLS: Ordinary Least Square Method , OLS: Ordinary Least Square Method and OLS: Ordinary Least Square Method are constant, while OLS: Ordinary Least Square Method is the only variable..

OLS: Ordinary Least Square Method

Equate it with zero we have

OLS: Ordinary Least Square Method

Actually, the two parameters, OLS: Ordinary Least Square Method and OLS: Ordinary Least Square Method , are the real constants and they can go out of the summation sign, Constant 2 is surely not equal to zero, thus we can cancel out to simplify.

OLS: Ordinary Least Square Method

We know that OLS: Ordinary Least Square Method and OLS: Ordinary Least Square Method , OLS: Ordinary Least Square Method , thus we can further simplify the last equation into OLS: Ordinary Least Square Method or,

linearregression (2)

Inputting equation (1) into equation (2), we have

OLS: Ordinary Least Square Method

OLS: Ordinary Least Square Method

OLS: Ordinary Least Square Method

OLS: Ordinary Least Square Method

Thus, the parameters of regression model OLS: Ordinary Least Square Method are OLS: Ordinary Least Square Method and OLS: Ordinary Least Square Method

Notice that the slope OLS: Ordinary Least Square Method is actually equivalent to the earlier formula of slope in this tutorial regression slope by simple algebra.

Example

Find for model parameter for model estimation OLS: Ordinary Least Square Method using Ordinary Least square!

Answer:

OLS: Ordinary Least Square Method

The model only has one parameter OLS: Ordinary Least Square Method .

We take derivative and equate it to zero OLS: Ordinary Least Square Method

OLS: Ordinary Least Square Method

OLS: Ordinary Least Square Method

OLS: Ordinary Least Square Method

Thus, the parameters of regression model OLS: Ordinary Least Square Method is OLS: Ordinary Least Square Method .

You may compare that the slope of the two models OLS: Ordinary Least Square Method and OLS: Ordinary Least Square Method are not the same.

< Previous | Next | Content >

Send your comments, questions and suggestions

Preferable reference for this tutorial is

Teknomo, Kardi (2015) Regression Model using Microsoft Excel. http://people.revoledu.com/kardi/tutorial/Regression/

This tutorial is copyrighted.