Business Mathematics and Statistics · Ch 9 — Applied Statistics (Time Series, Index Numbers, Statistical Quality Control)
Measuring Trend: Method of Least Squares
Measuring Trend: Method of Least Squares
The method of least squares fits a mathematical trend line to a time series so that trend can be measured (and, importantly, extended to forecast future years) without losing values at either end the way the moving average method does. For a straight-line trend,
where is the trend value, represents time (the year), and , are constants found by solving the two normal equations:
The arithmetic is made simple by a standard trick: code the years so that the middle year becomes and the years on either side become and . This makes , which collapses the normal equations to
Worked Example. A shop's sales (₹ lakh) for five years were:
| Year | 2017 | 2018 | 2019 | 2020 | 2021 |
|---|---|---|---|---|---|
| Sales () | 18 | 20 | 22 | 28 | 32 |
Coding the middle year (2019) as :
| Year | ||||
|---|---|---|---|---|
| 2017 | 18 | 4 | ||
| 2018 | 20 | 1 | ||
| 2019 | 22 | 0 | ||
| 2020 | 28 | 1 | ||
| 2021 | 32 | 4 | ||
| Total |
So the fitted trend line is . Substituting each back gives the trend values:
| Year | 2017 | 2018 | 2019 | 2020 | 2021 |
|---|---|---|---|---|---| …
A method of fitting a trend line to a time series such that the sum of the squares of the deviations of the actual values from the trend value …
The pair of simultaneous equations, derived from the least-squares condition, that are solved to find the constants and of a fitted str …