Fundamentals of Business Mathematics and Statistics · Index Numbers and Time Series
Trend Measurement: Moving Averages and Least Squares Method
Updated 10 October 2026 · Fact-checked
Trend is the long-term direction of a time series. You measure it by freehand curve, semi-averages, moving averages or least squares. Least squares fits the line Y = a + bX by minimising squared deviations. Take X as years from the middle year, find a = ΣY ÷ n and b = ΣXY ÷ ΣX², then forecast.
Understand Trend Measurement: Moving Averages and Least Squares
A time series is a set of values recorded over time, such as yearly sales of a firm. Secular trend is the smooth, long-run movement of that series, upward or downward, after ignoring short-term ups and downs.
There are four ways to measure it. The freehand method means plotting the data and drawing a smooth curve by eye. It is quick but personal, so two people get two answers. The semi-average method splits the data into two equal parts, finds the average of each part, and joins those two points to get a straight line.
The moving average method smooths the data by replacing each value with the average of a fixed number of nearby values (the period). It removes short-term fluctuations. If the period matches the cycle length, the cycles are largely removed. You lose some values at the start and end of the series.
The method of least squares fits a straight line Y = a + bX so that the sum of squares of the gaps between actual and fitted values is the smallest. Here b is the average yearly change (slope) and a is the trend value at the origin. Because it gives an equation, you can use it to forecast by putting a future X into the equation. It is the most exact of the four methods.
Key formulas to remember
- Straight-line trend
- Y = a + bX
- Y is the trend value, X is time measured from the chosen origin.
- Normal equations
- ΣY = na + bΣX and ΣXY = aΣX + bΣX²
- Use these when the origin is not in the middle.
- Shortcut when ΣX = 0
- a = ΣY ÷ n and b = ΣXY ÷ ΣX²
- Works when X is measured from the middle year (odd n) or from the centre of the series (even n, in years or half-year units).
- Odd-period moving average
- 3-year MA for year t = (Yt-1 + Yt + Yt+1) ÷ 3
- The average is placed against the middle year.
- Even-period moving average
- Take totals of 4 values, add two consecutive totals, divide by 8
- This centres the average against a year. It is called centring.
- Semi-average slope
- b = (Average of 2nd half − Average of 1st half) ÷ gap between the two middle years
- Each average is placed at the middle of its half.
- Values lost in moving average
- Odd period m: (m − 1) ÷ 2 lost at each end
- A 3-year MA loses one value at each end; a 5-year MA loses two.
How to solve Trend Measurement: Moving Averages and Least Squares questions
Pick the method the question names. If it asks for a trend equation or forecast, use least squares.
- 1Read which method is asked: semi-average, moving average or least squares.
- 2For moving average, find the period. Add that many consecutive values, divide by the period, and write each result against the middle year.
- 3For an even period, find moving totals, add pairs of totals, and divide by twice the period to centre.
- 4For semi-average, split the years into two equal parts (leave out the middle year if n is odd), find each mean, and place it at the middle of its part.
- 5For least squares, set X = 0 at the middle year. Use X in steps of 1 for odd n. For even n, use X = ±0.5, ±1.5, ... (in years), or X = ±1, ±3, ... (in half-year units, so b is per half-year).
- 6Compute ΣY, ΣXY and ΣX². Then a = ΣY ÷ n and b = ΣXY ÷ ΣX².
- 7Write Y = a + bX. For a forecast, find X for the required year and substitute.
- 8Check the sign and size of b against the data. Rising data must give positive b.
Quickest way: Centre the origin and use ΣX = 0
When to use it: Any least squares question with equally spaced years.
- Mark the middle year as X = 0. For odd n, X runs ..., −2, −1, 0, 1, 2, ...
- For even n, use X = ±0.5, ±1.5, ... in years, or X = −3, −1, 1, 3 style values in half-year units. In the half-year case, b is per half-year.
- Find a as the plain average of Y. Find b as ΣXY ÷ ΣX².
- For forecasts, count the distance from the origin year carefully and use the same unit of X.
- In MCQs, test the options: the line must pass through the mean of Y at X = 0, so a must equal the mean.
Common mistakes in Trend Measurement: Moving Averages and Least Squares
Placing a moving average against the wrong year.
Students write the average against the first year of the group.
Fix: Always place it against the middle year of the group. For even periods, centre it between two years, then average again.
Using ΣX ≠ 0 formulas by mistake after shifting the origin.
Students mix the shortcut with the full normal equations.
Fix: If ΣX = 0, use the shortcut. Otherwise solve both normal equations together.
Forecasting with the wrong X value.
Students forget where the origin is or the unit of X.
Fix: Write the origin year and unit beside the equation. X = year − origin year, divided by the unit.
Including the middle year in semi-averages for odd n.
Students try to split unevenly.
Fix: Drop the middle year, then average each half.
Dividing the 4-year centred total by 4 instead of 8.
Students forget two totals were added.
Fix: For centring, add two consecutive 4-year totals and divide by 8.
Reading b as the yearly change when X is in half-years.
Even n with X = ±1, ±3 is in half-year units.
Fix: Yearly change is 2b in that case. Check the unit of X before answering.
Worked examples
Example 1
Sales (₹ lakh) of a firm for 5 years, 2019 to 2023, are 10, 14, 16, 20, 25. Fit a straight-line trend by least squares and forecast sales for 2025.
Show the solution
- n = 5. Take 2021 as origin, so X = −2, −1, 0, 1, 2.
- ΣY = 10 + 14 + 16 + 20 + 25 = 85.
- ΣXY = (−2×10) + (−1×14) + 0 + (1×20) + (2×25) = −20 − 14 + 20 + 50 = 36.
- ΣX² = 4 + 1 + 0 + 1 + 4 = 10.
- a = 85 ÷ 5 = 17 and b = 36 ÷ 10 = 3.6.
- Trend line: Y = 17 + 3.6X, with X = 0 at 2021.
- For 2025, X = 4. Y = 17 + 3.6 × 4 = 17 + 14.4 = 31.4.
Answer: Y = 17 + 3.6X; forecast for 2025 is ₹31.4 lakh.
Example 2
Find the 3-year moving averages for production (in tonnes) of 2018 to 2023: 30, 36, 42, 45, 54, 57.
Show the solution
- The period is 3 (odd), so each average goes against the middle year.
- 2019: (30 + 36 + 42) ÷ 3 = 108 ÷ 3 = 36.
- 2020: (36 + 42 + 45) ÷ 3 = 123 ÷ 3 = 41.
- 2021: (42 + 45 + 54) ÷ 3 = 141 ÷ 3 = 47.
- 2022: (45 + 54 + 57) ÷ 3 = 156 ÷ 3 = 52.
- No values for 2018 and 2023, since one value is lost at each end.
Answer: 2019: 36, 2020: 41, 2021: 47, 2022: 52 tonnes.
Exam tips
- For least squares MCQs, compute a first as the mean of Y. It often lets you eliminate two options at once.
- Count how many moving average values remain: n − (period − 1). Options with the wrong count can be dropped.
- Check the unit of X before forecasting, especially for even n.
- Semi-average questions are short: find two means, then the slope between their middle years.
- Expect a negative b when the data is falling. A wrong sign means an arithmetic slip.
Practice questions from Index Numbers and Time Series
- For five years coded X = -2, -1, 0, 1, 2, the profits Y (₹ lakh) are 10, 14, 18, 22 and 31. Using the least squares line Y = a + bX, what is…
- The consumer price index for a city rose from 100 in the base year to 250 in the current year. A worker's money wage in the current year is …
- The consumer price index for a city rose from 200 in the base year to 250 in the current year. A worker's wage in the base year was Rs 20,00…
- A trend line fitted by least squares to annual output of a Coimbatore mill is Y = 40 + 6X, where X is in years with origin at 2020 and Y is …
- For a group of items, the base-year price (p0), current price (p1) and base-year quantity (q0) are: A: p0=10, p1=15, q0=20; B: p0=20, p1=25,…
Trend Measurement: Moving Averages and Least Squares in other exams
The same ground in other exams, if you are preparing for more than one or want another angle on it.
Trend Measurement: Moving Averages and Least Squares: frequently asked questions
Which method of finding trend is the most accurate?
The method of least squares is the most exact because it minimises the sum of squared deviations and gives an equation. Freehand is the least reliable as it depends on personal judgement.
Why do we take X = 0 at the middle year?
It makes ΣX equal to zero, so the normal equations simplify. Then a is just the mean of Y and b is ΣXY ÷ ΣX².
What is the sum of deviations of actual values from the least squares line?
It is zero, so the fitted line passes through the mean values. The sum of squares of these deviations is the minimum possible.
How do I forecast using the trend equation?
Find X for the future year from your origin year, using the same unit as in the equation. Put it into Y = a + bX and compute. The result is an estimate, not a certainty.