Skip to content

Statistics · Ch 4 — Time Series

Measurement of Trend: The Method of Least Squares

4

Measurement of Trend: The Method of Least Squares

Meaning and Principle

The method of least squares fits a straight-line trend

Yc=a+bXY_c = a + bX

where YcY_c is the estimated (trend) value, aa is the value of YcY_c at X=0X=0, and bb is the trend's slope — the average change in YY per unit of XX. The line is chosen so that the sum of the squares of the deviations of the actual values from the trend values, Σ(Y−Yc)2\Sigma (Y - Y_c)^2, is the minimum possible — hence "least squares".

Coding the time variable (XX)

To keep the arithmetic simple, years are coded as deviations from a convenient origin so that ΣX=0\Sigma X = 0:

  • Odd number of years: take the middle year as the origin (X=0X=0) and code the years on either side as −2,−1,0,1,2,…-2,-1,0,1,2,\ldots — each unit of XX equals one year.
  • Even number of years: there is no single middle year, so the two central years are coded −1-1 and +1+1, and the rest as −3,−1,1,3,…-3,-1,1,3,\ldots (the "2X2X" method) — here each unit of XX equals half a year.

Normal equations

With ΣX=0\Sigma X = 0, the two normal equations of least squares reduce to:

a=ΣYnb=ΣXYΣX2a = \frac{\Sigma Y}{n} \qquad b = \frac{\Sigma XY}{\Sigma X^2}

where nn is the number of years in the series.

A built-in check

A genuinely useful property of the least squares line is that the trend values it produces always satisfy

ΣYc=ΣY\Sigma Y_c = \Sigma Y

Recomputing ΣYc\Sigma Y_c after fitting the line and confirming it equals the original ΣY\Sigma Y is therefore a free, mechanical cross-check on the whole calculation — exactly the kind of independent second check a Gujarat board Std-12 statistics answer should show, not just the final equation.

Why it is preferred over moving averages …

Definition 1Method of Least Squares

A method of fitting a trend line Yc=a+bXY_c = a+bX such that the sum of squared deviations of the actual values from the trend values i …

Definition 2Origin (in trend fitting)

The year (or point in time) coded as X=0X=0; chosen as the middle year for an odd number of years, or the mid-point between the two central …