Advanced Quantitative Methods 360-301 • CEGEP, Montreal

Revision sheet: time series and forecasting

This sheet covers the last chapter of advanced quantitative methods, the one you then use to read every economic release. It does not repeat the theory of decomposition: it gives the eight places where a correct calculation produces a wrong forecast, and the exact check that catches each one.

It is written for Social Science students at CEGEP taking course 360-301. The corrected exercise set for the same chapter goes through each step, from smoothing to reading a quarterly economic release.

Mark this sheet as read or add it to your favourites: a free account, no password, keeps your read sheets and favourites from one visit to the next, tells you which chapter to tackle next and lets you ask for the method or exercise you are missing. Create your space, an email is enough.

The thread of the chapter

A time series is not a cloud of points: each observation depends on the previous one. The whole method consists in SEPARATING what comes from the trend, the season and chance, before daring to make a forecast.

This chapter is part of 360-301, Advanced Quantitative Methods

The essentials

Four components, and two models to assemble them

  • • TREND, the underlying movement. CYCLE, of variable period. SEASONALITY, of FIXED, known period. IRREGULAR, the remainder.
  • • MULTIPLICATIVE model Y=T×S×C×IY=T\times S\times C\times I when the seasonal swing grows with the level.
  • • ADDITIVE model Y=T+S+C+IY=T+S+C+I when that swing stays constant in absolute value.
  • • The choice shows on the graph: widening waves call for the multiplicative model, waves of constant amplitude for the additive one.
trend dotted, season around ityear 1year 2year 3year 4
The waves widen as the trend rises: this is the signature of a MULTIPLICATIVE model, and the dotted line gives the level around which they oscillate.

Cycle and season differ in one thing only: the period of the season is known in advance, that of the cycle is not.

Smoothing without cheating

  • • The order of a moving average must be a MULTIPLE of the seasonal period: 44 for quarterly data, 1212 for monthly data.
  • • EVEN order: the average falls between two periods; you must CENTRE it by averaging two consecutive moving averages.
  • • A moving average of order pp loses p2\dfrac{p}{2} values at each end, including the MOST RECENT one: it describes the past, it forecasts nothing.
  • • Seasonal index: the ratio of each value to the mean of its year, then the mean of the ratios for the same season. The pp indices must add up to pp.
quarteraverage ratiorenormalized indexQ11.2801.255Q20.9200.902Q30.7600.745Q41.1201.098sum4.0804.000divide by the sum, then multiply by 4
The middle column adds up to 4.084.08 and the right-hand column to 4.0004.000: without this correction, every forecast would be overestimated by two percent.

If the indices do not add up to pp, you RENORMALIZE: divide each by the sum obtained, then multiply by pp.

Forecasting, and the two traps of time

  • • Forecast: fit the TREND, extend it, then MULTIPLY by the seasonal index of the target period.
  • • Check: the pp forecasts for one year must add up to pp times the trend value for that year.
  • • AUTOCORRELATION: neighbouring observations resemble each other. It makes standard errors too SMALL, so you declare significant what is not. Effective size: neff≈n1−ρ1+ρn_{eff}\approx n\dfrac{1-\rho}{1+\rho}.
  • • SPURIOUS trend correlation: two growing series are correlated because they share time. Correlate the CHANGES, never the levels.
246810121416405060708090100110120130140150160116forecasts
The annual means 8080, 9292, 104104 rise by 1212 a year: the trend, dotted, gives 116116 for year 4; each forecast quarter, in orange, is 116116 times its index.

Growth at a constant rate: it is the LOGARITHM of the series that is linear, and the slope on a logarithmic scale gives the rate.

The mistakes that cost marks

These are the errors I correct most often in session. Each one costs marks on a paper, even when the reasoning behind it is right.

1. Choosing a moving-average order unrelated to the period

2 marks, and the trend you get is still seasonal

What not to write

“Quarterly data: I smooth with a moving average of order 33, it is more responsive.”

What to write

“The order must be a MULTIPLE of the period, so 44 for quarterly data. An order of 33 leaves part of the season in the smoothing.”

12345678910111213405060708090100110120130140150order 3order 4
Over three quarters, in red, one season counts double and the curve still ripples; the centred order 44, in green, contains each season once and comes out smooth.

Why: An average over exactly one period contains each season once and only once: that is what cancels the seasonal component. Over three quarters, one season is counted twice.

2. Using an even-order moving average without centring it

1.5 marks, and a shift of half a quarter through the whole series

What not to write

“Moving average of order 44: the first smoothed value goes at the second quarter.”

What to write

“With an EVEN order, the average falls BETWEEN two quarters. I average two consecutive moving averages to re-centre it on a period.”

Why: Four values have their centre of gravity between the second and the third. Centring amounts to a moving average of order 55 with unequal weights, 18\dfrac{1}{8} at the ends.

3. Mistaking a moving average for a forecast

1.5 marks, and a forecast that cannot be produced

What not to write

“The moving average gives the trend, so I extend it to forecast next quarter.”

What to write

“A moving average of order 44 loses TWO values at each end, including the most recent: it stops two quarters before today. To forecast, I must FIT a trend line.”

12345678910111213405060708090100110120130140150nothing
The centred moving average of order 44, in green, stops two quarters before the end of the series: it says nothing about the red zone, nor about the future.

Why: Smoothing is a retrospective operation: each smoothed point needs values located after it. That is exactly what is missing at the end of the series.

4. Not renormalizing the seasonal indices

1.5 marks, and a 2% overestimate on every forecast

What not to write

“The four average ratios are 1.281.28, 0.920.92, 0.760.76 and 1.121.12: those are my indices.”

What to write

“Their sum is 4.084.08, not 44. I divide each by 4.084.08 then multiply by 44, which gives 1.2551.255, 0.9020.902, 0.7450.745 and 1.0981.098.”

Why: The indices must cancel out over a full year, otherwise the season adds a spurious trend: here a purely artificial 22% yearly rise.

5. Deseasonalizing by subtracting in a multiplicative model

2 marks, and the whole deseasonalized series is wrong

What not to write

“Index of 1.251.25 in the first quarter: I take 2525% off the observed value.”

What to write

“Multiplicative model: you DIVIDE by the index. 1301.25=104\dfrac{130}{1.25}=104, not 130×0.75=97.5130\times 0.75=97.5.”

9095100105110115120125130135130 observed÷ 1.25: 104− 25%: 97.5
Dividing 130130 by 1.251.25 gives 104104, in green; taking off 25%25\% gives 97.597.5, in red: 11.25\dfrac{1}{1.25} is 0.800.80, not 0.750.75.

Why: Dividing by 1.251.25 and taking off 2525% are not the same operation: 11.25=0.80\dfrac{1}{1.25}=0.80, not 0.750.75. The five-point gap shows up in every quarter.

6. Comparing a quarter with the previous quarter

the whole commentary question

What not to write

“Sales go from 130130 in the first quarter to 9494 in the second: a 2828% collapse.”

What to write

“The drop is SEASONAL. Compare with the same quarter of the previous year, 9494 against 8383, a rise of 13.313.3%, or else compare the DESEASONALIZED series.”

12345678910111213405060708090100110120130140150− 28%+ 13.3%
From 130130 to 9494, in red, it is the season that falls. At the same quarter of the previous year, in green, 8383 becomes 9494: a rise.

Why: On a seasonal series, the change from one quarter to the next mixes trend and season. The only two honest comparisons are year over year and the deseasonalized series.

7. Correlating two series in levels

the whole conclusion, and it is the critical-thinking question of the chapter

What not to write

“Enrolment and the price of coffee have both risen for ten years: r=0.98r=0.98, the relationship is very strong.”

What to write

“Both series share a trend, so they share time. I correlate the CHANGES from one period to the next: the coefficient falls to 0.080.08.”

LEVELS: r = 0.98CHANGES: r = 0.08
On the left, two curves that rise together; on the right, their changes period by period, which no longer follow each other at all.

Why: Two growing series are mechanically correlated, whatever their real relationship. Moving to changes removes the common trend and leaves only the joint movement.

8. Treating an autocorrelated series as an ordinary sample

1.5 marks, and tests that declare anything significant

What not to write

“I have 4040 quarters, so 4040 observations for my test.”

What to write

“Neighbouring quarters resemble each other. With ρ=0.6\rho=0.6, the effective size is 40×1−0.61+0.6=1040\times\dfrac{1-0.6}{1+0.6}=10: that is the number that goes into the standard errors.”

Why: Each new observation brings less new information when it resembles the previous one. It is the same phenomenon as the design effect in a cluster sample.

Which method to choose

Additive or multiplicative model?

Look at the GRAPH of the series and the amplitude of the seasonal waves over time.

  • If the waves keep the same height in units, whatever the level → ADDITIVE model: the indices are added and sum to ZERO

    Example: a seasonal gap of 10 units, yesterday as today

  • If the waves widen as the series rises → MULTIPLICATIVE model: the indices are multiplied and sum to pp

    Example: a gap of 20% of the level, always

  • If you hesitate → plot the logarithm of the series: if the waves become constant in amplitude there, it is multiplicative

    Example: sales that double in five years

  • If the series contains zero or negative values → ADDITIVE model, necessarily: division no longer makes sense

    Example: a quarterly net migration balance

The multiplicative model is by far the most common in the social sciences: sales, attendance and enrolment almost always vary in proportion to the level.

Which comparison does the question expect?

Look at what is being compared and whether the series is seasonal.

  • If you compare two CONSECUTIVE periods of a seasonal series → compare year over year instead, or switch to the deseasonalized series, and say so

    Example: Q1 against Q2 of the same year

  • If you compare the same quarter of two years → legitimate comparison, the season being identical on both sides

    Example: Q2 of year 2 against Q2 of year 3

  • If the question supplies a deseasonalized series → compare directly from one period to the next: the season has already been removed

    Example: a monthly seasonally adjusted unemployment rate

  • If you compare two SERIES with each other → correlate the CHANGES, never the levels

    Example: enrolment and advertising spending

A change announced “from the previous quarter” with no mention of seasonal adjustment is almost always a seasonal change in disguise.

How the answer is expected to be written

A marker ticks steps. Here they are in order, with the concluding sentence expected word for word.

Computing the seasonal indices and deseasonalizing

When to use it: As soon as the question supplies several years of a periodic series.

  1. 1 Identify the PERIOD and state the model chosen, additive or multiplicative, with its justification.
  2. 2 Compute the mean of each YEAR, then the ratio of each value to the mean of its year.
  3. 3 Average the ratios for the same season across the years.
  4. 4 Check that the indices add up to pp; if not, RENORMALIZE.
  5. 5 Deseasonalize by DIVIDING each value by the index of its season.

Concluding sentence

“The seasonal indices are 1.2501.250, 0.9020.902, 0.7500.750 and 1.0981.098, adding up to 4.0004.000: no renormalization is needed. The deseasonalized series for the third year oscillates around 104104, which confirms the decomposition.”

The trap: Averaging the ratios of the same YEAR instead of the same SEASON: the table is filled in the other direction and every index comes out at 11.

Marking: 1 mark for the justified model, 2 marks for the ratios, 1 mark for the average indices, 1 mark for checking the sum.

Producing a quarterly forecast

When to use it: When the question asks for the forecast values of a future year.

  1. 1 Fit the trend on the annual means, or by least squares on the deseasonalized series.
  2. 2 Extend the trend to the target year and write that value down.
  3. 3 MULTIPLY the trend by the seasonal index of each period.
  4. 4 Check that the forecasts for one year add up to pp times the trend.
  5. 5 Attach the limits of the forecast: the model assumes that the trend and the season continue unchanged.

Concluding sentence

“The trend for the fourth year is 116116; the quarterly forecasts are 145.0145.0, 104.6104.6, 87.087.0 and 127.4127.4, adding up to 464=4×116464=4\times 116.”

The trap: Forgetting to multiply by the index: you then get the same value four times, and the seasonal forecast question has not been answered.

Marking: 1 mark for the extended trend, 2 marks for the four forecasts, 1 mark for the sum check, 1 mark for the limits stated.

Check before you hand in

Five minutes of checking recover more marks than one more problem started in a hurry.

The typical problem, taken apart

Three years of quarterly sales, through to the forecast

Year 1: 100100, 7272, 6060, 8888. Year 2: 115115, 8383, 6969, 101101. Year 3: 130130, 9494, 7878, 114114.

You are asked for the seasonal indices, the deseasonalized series for the third year, and the four forecasts for the fourth year.

12345678910111213405060708090100110120130140150year 1year 2year 3
Three years of four quarters: the first is always the highest, the third the lowest, and the gap grows with the level.

Step 1

Period 44. The seasonal gaps grow with the level, 4040 units of amplitude in the first year against 5252 in the third: MULTIPLICATIVE model.

Why

The choice of model is justified on the DATA, not out of habit. It is a marking point, and it determines whether you will divide or subtract afterwards.

Step 2

Annual means: 8080, 9292, 104104. Ratios for the first quarter: 10080=1.25\dfrac{100}{80}=1.25, 11592=1.25\dfrac{115}{92}=1.25, 130104=1.25\dfrac{130}{104}=1.25.

Why

You divide each value by the mean of ITS year, which removes the trend without having to estimate it. The constancy of the three ratios confirms that the season is stable.

Step 3

Average indices: 1.2501.250, 0.9020.902, 0.7500.750, 1.0981.098. Sum: 4.0004.000, so no renormalization.

Why

The sum check comes before anything else: here it comes out right, but you must write it down, because that is what earns the mark.

Step 4

Deseasonalization of year 3: 1301.250=104.0\dfrac{130}{1.250}=104.0, 940.902=104.2\dfrac{94}{0.902}=104.2, 780.750=104.0\dfrac{78}{0.750}=104.0, 1141.098=103.8\dfrac{114}{1.098}=103.8.

Why

You DIVIDE, because the model is multiplicative. The resulting series is almost flat, which validates the decomposition with no further calculation.

Step 5

Trend: the annual means rise by 1212 a year, so year 4 is forecast at 116116.

Why

The progression is perfectly linear here, which makes the fit immediate. On real data, you would fit a line by least squares.

Step 6

Forecasts: 116×1.250=145.0116\times 1.250=145.0; 116×0.902=104.6116\times 0.902=104.6; 116×0.750=87.0116\times 0.750=87.0; 116×1.098=127.4116\times 1.098=127.4. Sum: 464=4×116464=4\times 116.

Why

The final check closes the problem: if the sum did not give back four times the trend, the indices did not add up to 44.

The conclusion, written out

“The seasonal indices are 1.2501.250, 0.9020.902, 0.7500.750 and 1.0981.098, adding up to exactly 44. The deseasonalized series for the third year hovers around 104104, and the sales forecasts for the fourth year are 145145, 105105, 8787 and 127127, on the assumption that the trend and the season continue.”

The classic mistake on this problem: Comparing the 130130 of the first quarter with the 9494 of the second and announcing a 2828% collapse: on the deseasonalized series, the level has not moved by a tenth of a point.

Learn by heart

  • • SEASON has a fixed, known period, CYCLE a variable one: that is the only thing that tells them apart.
  • • Waves of constant amplitude, ADDITIVE model; widening waves, MULTIPLICATIVE model.
  • • The order of a moving average is a MULTIPLE of the period, and an EVEN order is CENTRED.
  • • The pp seasonal indices add up to pp in a multiplicative model, 00 in an additive one. If not, renormalize.
  • • To deseasonalize in a multiplicative model is to DIVIDE by the index, never to subtract a percentage.
  • • Forecast: the extended trend MULTIPLIED by the index, and the sum for one year is pp times the trend.
  • • Correlate the CHANGES of two series, never their levels: two shared trends are enough to manufacture r=0.98r=0.98.

Frequently asked questions

How do you calculate the seasonal indices of a quarterly series?

Compute the mean of each year, then the ratio of each quarter to the mean of its year. Next, average the ratios for the same quarter across the years. The four indices must add up to four: if they do not, divide each by the sum obtained and multiply by four.

Why centre a moving average of even order?

Because the average of four consecutive values falls between the second and the third, that is, between two quarters rather than on one of them. You then average two consecutive moving averages to bring the result back onto a period, which amounts to giving half weight to the two end values.

How do you deseasonalize a series?

In a multiplicative model, you divide each value by the seasonal index of its period. A value of 130 in the first quarter, with an index of 1.25, gives 104. You never subtract a percentage: dividing by 1.25 is the same as multiplying by 0.80, not by 0.75. In an additive model, you subtract the index.

Why are two rising series always correlated?

Because they share time. Two quantities that each increase on their own, with no link at all, show a very high correlation coefficient simply because both progress with the years. So you correlate the changes from one period to the next, which removes the common trend.

Can you compare a quarter with the previous quarter?

Not on a raw seasonal series: the observed change mixes trend and season, and a twenty-eight percent drop can hide a real rise. You compare either with the same quarter of the previous year, or on the deseasonalized series, and you state which of the two methods you are using.

Practise it

Corrected exercises: Time series and forecasting, 360-301

A method is proved on a paper, not on a sheet. The set for the same chapter takes each of these traps into a problem, with the solution written out step by step.

  • 10 corrected exercises
  • 100 points
  • 150 minutes
Do the exercises
Something missing from this sheet? A method, a trap, an exercise to practise it, a mistake you spotted: tell me, I read every request.

Sending goes through your free space: that is how I can answer you and tell you when the exercise is added. An email is enough, no password. Create your space. Rather not create an account? Write to me directly.

What is it about?
I read every request myself, nobody else sees it. No need to write your name or your school.
When your request is dealt with, you hear about it by email and in your space.

By sending, you agree that I read your request to answer it. It is kept with your account, erased with it, and never published: privacy policy.

Previous sheet Nonparametric tests

© Ahmed Squalli Houssaini. Revision sheet published at www.letuteurscientifique.ca/en/fiches/cegep-aqm-time-series. Free for personal and classroom use; republishing it elsewhere requires written permission (legal notice).

See also

Looking for a 360-301 tutor in Montreal?

Get in touch for a first session. 360-301 arrives at the time of the end-of-program research project, and it is the course where a method error costs you the whole analysis chapter.

Site by Studio Squalli