Mathematics and Statistics · Ch 12 — Time Series
Measurement of Trend: Method of Least Squares
Measurement of Trend: Method of Least Squares
The method of least squares fits an objective mathematical trend line to the data — the one straight line for which the sum of the squares of the vertical gaps between the actual points and the line is the smallest possible. This is the same principle used to fit a regression line, and it gives a unique trend equation that can also be used to forecast.
Let time be measured by a variable and the observed values by . The straight-line trend is
where is the trend value at the origin () and is the amount by which the trend changes per unit of time. The values of and that minimise the squared error satisfy the two normal equations:
The coding short-cut. The arithmetic becomes very light if we measure time as a deviation from the middle year, so that . The normal equations then collapse to
- Odd number of years: take the middle year as origin and let (one unit one year). Then automatically.
- Even number of years: there is no middle year, so take the origin midway between the two central years and use a half-year unit, giving (consecutive odd numbers). Again ; here one -unit is half a year, so the yearly change in trend is .
Once and are found, substitute each year's to get its trend value, and substitute a future year's to forecast.
Merits and limitations …
A method that fits the trend line by making the sum of squared vertical deviations of the points from the line a minimum, giving …
The pair and , solved for and ; when they reduce to and …
The value predicted by the fitted line for a given time ; used both to smooth existing years and to …