Time Series

Readings in order — trend under the wiggle.

Readings taken in order of time

A time series is a set of readings of one quantity, taken at regular times and kept in the order they were taken: a temperature every hour, a town’s population every year, a shop’s sales every month.

To draw one, put time along the horizontal axis, earliest on the left, and the reading up the side. Plot one point for each reading and join the points in order with straight lines. The lines show the order of the readings, and how each one changed from the one before. Nothing was measured between two points, so a value read off a joining line is only a guess.

Here are six monthly readings: 3 in January, 5 in February, 4 in March, 6 in April, 5 in May and 7 in June. To read one month, go up from its label to its dot, then across to the scale. The May dot is level with 5.

01234567JanFebMarAprMayJun

One reading per month, plotted in time order and joined from left to right.

The trend under the wiggle

Eight readings, one each quarter of a year, are 3, 5, 4, 6, 5, 7, 6 and 8. From one quarter to the next the series goes up, then down, then up again, so no single step tells you where it is heading.

Look at the low points instead: 3, then 4, then 5, then 6. Every dip lands higher than the dip before. The high points do the same: 5, 6, 7, 8. Under the wiggle, the series rises by 1 every two quarters. That long-run direction is the trend.

A trend can also fall, when each peak tops out lower than the one before, or be flat, when the ups and downs cancel and the series ends about where it started.

012345678q1q2q3q4q5q6q7q8

The dips are 3, 4, 5 and 6, and the peaks are 5, 6, 7 and 8. Each is higher than the one before, so the trend is rising.

A moving average

In this series the wiggle repeats every two quarters: one reading low, the next high. Average each pair of neighboring readings, and every average holds one low reading and one high one, so the wiggle cancels out.

The averages are (3 + 5) ÷ 2 = 4, then (5 + 4) ÷ 2 = 4.5, then (4 + 6) ÷ 2 = 5, then 5.5, 6, 6.5 and 7. They rise by exactly 0.5 a quarter. This is a moving average: the average of a fixed number of readings in a row, moved along one reading at a time.

A moving average must cover one full cycle of the wiggle. When sales rise and fall with the four seasons, the cycle is four quarters long, and the moving average is taken over four readings in a row.

The trend line, and each reading’s distance from it

Each average sits halfway between the two quarters it covers, so the first one, 4, belongs at quarter 1.5, and the last one, 7, at quarter 7.5. They lie on a straight line that rises 0.5 a quarter. Working back from quarter 1.5 to quarter 0 takes off 1.5 × 0.5 = 0.75, so the line starts at 4 − 0.75 = 3.25. The trend line is y = 0.5n + 3.25, where n is the quarter number.

Now compare each reading with the trend. At quarter 1 the trend is 0.5 × 1 + 3.25 = 3.75 and the reading is 3, which is 0.75 below it. At quarter 2 the trend is 4.25 and the reading is 5, which is 0.75 above it. The pattern holds all the way along: every odd quarter is 0.75 below the trend and every even quarter is 0.75 above it.

So each reading is made of two parts: the trend, which carries the long-run change, and a distance from the trend that repeats in a cycle.

quarterreading

The trend line y = 0.5n + 3.25 through the eight readings. The gaps alternate: 0.75 below the line, then 0.75 above it.

Forecasting the next reading

To estimate quarter 9, find the trend there and put back the distance for that point in the cycle. The trend at quarter 9 is 0.5 × 9 + 3.25 = 7.75. Quarter 9 is an odd quarter, so it sits 0.75 below the trend: 7.75 − 0.75 = 7.

Check with the dips. They run 3, 4, 5, 6 at quarters 1, 3, 5 and 7, rising by 1 each time, so the next dip, at quarter 9, is 7.

A forecast like this assumes the trend and the cycle carry on as before. One step past the data is a reasonable estimate; many steps past it is extrapolation that nothing measured supports.

Seasons: compare like with like

Many series rise and fall with the time of year. Ice cream sells more in summer than in winter, every year. The readings here are 2 in January, 7 in July, 3 the next January and 8 the next July.

From July to January the sales fall by 5, and from January to July they rise by 5. Neither change says anything about how the business is doing: it is the season turning, and it happens every year.

A fair comparison takes the same season in each year. This July against last July is 8 against 7, a rise of 1. This January against last January is 3 against 2, also a rise of 1. With the season the same on both sides, a change that is left over is a real change.

012345678JanJulJanJul

Each July is far above the January before it. July against July, 7 then 8, shows the real change of 1.

The usual mistakes

Reading the neighboring dot. Go straight up from the month’s own label; the dot one step to the left or right is a different month.

Comparing a summer month with a winter month, or with the month just before it. The season changes between them, so the difference mixes the trend with the season.

Reading the trend from the first and last readings alone. In the quarterly series, the first reading, 3, is a dip and the last, 8, is a peak, so they suggest a rise of 5 over 7 quarters, about 0.71 a quarter. The trend is 0.5 a quarter; the rest is the wiggle.

Taking the trend value as the forecast. The trend is the middle of the cycle, so the distance for that point in the cycle has to be put back.

Sales with a trend and a season

In the application below, a garden center’s sales rise from year to year and also rise and fall within each year. The trend line is given. The distance of each quarter from it, below the trend in the first quarter of each year and above it in the third, is what turns the trend into an estimate for the next quarter.

Worked example: Two Years of Quarterly Sales, with a Season Riding on Top of a Trend

Question A garden center recorded its sales, in thousands of dollars, for eight quarters. Numbering the quarters 1 to 8, the sales were 28, 40, 50, 42, 44, 56, 66 and 58. Quarters 1 and 5 are the first quarter of a year, and quarters 3 and 7 the third. The trend line is y = 4n + 30, where n is the quarter number. (a) Say what the gradient of the trend line means, and find how far each first quarter and each third quarter lies from the trend. (b) Estimate the sales in quarter 9.

  1. 1.Plot the sales against the quarter number and join the points in order. The record climbs overall, but inside each year it dips and rises again, so there is a trend and a season on top of it.

    0204060123456789sales, $ thousandquarter number8 quarters, joined in order
    0204060123456789sales, $ thousandquarter number8 quarters, joined in order
    The eight quarters, joined in the order they happened. The record climbs overall but dips and rises inside each year.
  2. 2.Check the trend line against the data. The quarter numbers 1 to 8 have mean 4.5, and the sales total 384, so the mean sales are 384 ÷ 8 = 48 thousand dollars. The trend line gives 4 × 4.5 + 30 = 48, so it passes through the mean point.

    0204060123456789sales, $ thousandquarter number384 divided by 8 = 48 thousandthe trend at quarter 4.5 is 48
    0204060123456789sales, $ thousandquarter number384 divided by 8 = 48 thousandthe trend at quarter 4.5 is 48
    The trend line y = 4n + 30 is drawn through the points, and the cross is the mean point (4.5, 48) that it passes through.
  3. 3.Measure the first quarters. In quarter 1 the trend is 4 × 1 + 30 = 34 and the sales were 28, which is 6 below it. In quarter 5 the trend is 50 and the sales were 44, again 6 below.

    0204060123456789sales, $ thousandquarter numberquarter 1: 34 - 28 = 6 belowquarter 5: 50 - 44 = 6 below
    0204060123456789sales, $ thousandquarter numberquarter 1: 34 - 28 = 6 belowquarter 5: 50 - 44 = 6 below
    The two first quarters are measured against the trend: quarter 1 is 34 − 28 = 6 below it and quarter 5 is 50 − 44 = 6 below it.
  4. 4.(a) The gradient 4 means the trend rises by 4 thousand dollars every quarter. In quarter 3 the trend is 42 against sales of 50, and in quarter 7 it is 58 against sales of 66, so a third quarter runs 8 thousand dollars above the trend while a first quarter runs 6 thousand below it.

    0204060123456789sales, $ thousandquarter numberquarter 3: 50 - 42 = 8 abovequarter 7: 66 - 58 = 8 above
    0204060123456789sales, $ thousandquarter numberquarter 3: 50 - 42 = 8 abovequarter 7: 66 - 58 = 8 above
    (a) The two third quarters are 8 thousand dollars above the trend, and the trend itself rises by 4 thousand dollars each quarter.
  5. 5.(b) Quarter 9 is the first quarter of the next year. The trend there is 4 × 9 + 30 = 66, and a first quarter is 6 thousand dollars below the trend, so the estimate is 66 − 6 = 60 thousand dollars, that is $60 000. Check: the last first quarter took 44 thousand dollars, and four quarters of growth at 4 thousand each adds 16, which gives 60 again.

    0204060123456789sales, $ thousandquarter numberquarter 9 trend: 4 × 9 + 30 = 66a first quarter is 6 below: 60
    0204060123456789sales, $ thousandquarter numberquarter 9 trend: 4 × 9 + 30 = 66a first quarter is 6 below: 60
    (b) The trend at quarter 9 is 66; dropping the 6 that a first quarter runs below it gives 60 thousand dollars.

Answer: (a) the trend rises by 4 thousand dollars a quarter, each first quarter lies 6 thousand dollars below the trend and each third quarter lies 8 thousand dollars above it; (b) about $60 000

Common mistakes

  • Taking the last figure, 58 thousand dollars, as the estimate for the next quarter. That figure is a fourth quarter and quarter 9 is a first quarter, and a quarter of growth has to be added as well, so neither part of it is right.
  • Using the trend value 66 on its own. The trend is the average of the four seasons, so it over-estimates a first quarter and under-estimates a third; the seasonal distance has to be put back.

More scatter plots and correlation problems, worked step by step →

Practice Time Series in the app