Home > Topics > Business Statistics – II > Method of Least Squares

Method of Least Squares 📐

The Method of Least Squares is the most popular and accurate method for fitting a mathematical trend line to data.


The Concept 💡

It identifies a line Y = a + bX such that the sum of the squared vertical deviations of the actual points from numbers on the line is a minimum.

Conditions:

  1. ∑(Y - Yc) = 0 (The sum of deviations is zero)
  2. ∑(Y - Yc)² is Minimum (The sum of squared deviations is least)

The Equation 📝

Yc = a + bX

Where:

  • Yc = Trend value
  • X = Time variable (Deviations from a mid-year)
  • a = Y-intercept
  • b = Slope of trend line

Normal Equations

To find a and b, we solve:

  1. ∑ Y = Na + b ∑ X
  2. ∑ XY = a ∑ X + b ∑ X²

Simplified Method (Using Deviations)

If we take the origin (X=0) at the middle year, then ∑ X = 0. The equations simplify to:

a = ∑ Y / N
b = ∑ XY / ∑ X²

Example (Odd Number of Years)

Data: Year: 2010, 2011, 2012, 2013, 2014 Sales: 10, 12, 15, 20, 23

Step 1: Find Mid-Year N = 5 (Odd). Mid-year is 2012. Take deviations from 2012.

Step 2: Table

YearSales (Y)X (Year-2012)XY
201010-24-20
201112-11-12
201215000
2013201120
2014232446
Sum8001034

Step 3: Calculate Constants

  • a = ∑ Y / N = 80 / 5 = 16
  • b = ∑ XY / ∑ X² = 34 / 10 = 3.4

Step 4: Trend Equation

Yc = 16 + 3.4X

Step 5: Forecast for 2015? For 2015, X = 2015 - 2012 = 3. Yc = 16 + 3.4(3) = 16 + 10.2 = 26.2


Example (Even Number of Years)

Data: 2010, 2011, 2012, 2013 Mid-Point: Between 2011 and 2012 (i.e., 2011.5).

Trick: Multiply deviations by 2 to avoid decimals.

  • 2010: -1.5 * 2 = -3
  • 2011: -0.5 * 2 = -1
  • 2012: 0.5 * 2 = 1
  • 2013: 1.5 * 2 = 3

Now calculate a and b as usual. However, remember that X unit is now "half-year". To convert b back to annual change, multiply by 2.


Summary

  • Most accurate method.
  • Suitable for forecasting.
  • We shift origin to the middle to make ∑ X = 0.
  • Resulting equation: Y = a + bX.

Loading quiz…