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:
∑(Y - Yc) = 0(The sum of deviations is zero)∑(Y - Yc)²is Minimum (The sum of squared deviations is least)
The Equation 📝
Yc = a + bX
Where:
Yc= Trend valueX= Time variable (Deviations from a mid-year)a= Y-interceptb= Slope of trend line
Normal Equations
To find a and b, we solve:
∑ Y = Na + b ∑ X∑ 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
| Year | Sales (Y) | X (Year-2012) | X² | XY |
|---|---|---|---|---|
| 2010 | 10 | -2 | 4 | -20 |
| 2011 | 12 | -1 | 1 | -12 |
| 2012 | 15 | 0 | 0 | 0 |
| 2013 | 20 | 1 | 1 | 20 |
| 2014 | 23 | 2 | 4 | 46 |
| Sum | 80 | 0 | 10 | 34 |
Step 3: Calculate Constants
a = ∑ Y / N = 80 / 5 = 16b = ∑ 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…