Chapter 3 Time Series Analysis
Chapter 3 Time Series Analysis
Historigram
A graph of a time series
X axis represents time e.g. day, week, month, quarter, year
Y axis represents the values of the variable
545
540
Fuel consumption (liter)
535
530
525
520
515
510
505
500
495
1 2 3 4 1 2 3 4 1 2 3 4
Quarter
Chapter 7 – Page 1
Historigram: Monthly sales of CD (in $'000)
6
5
Sales ($'000)
4
3
2
1
0
Feb
June
Oct
July
Sept
Nov
Dec
Mar
Apr
May
Aug
Jan
Month
Trend
is the underlying long-term movement of the variable over
time
Three types of trend:
1. Downward trend
2. Upward trend
3. Constant trend/ No clear movement
Example 1
Historigram: Quarterly sales Air cond. (000s)
6
5.5
5
Sales (000s)
4.5
4
3.5
3
2.5
2
1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
Quarter
Chapter 7 – Page 2
Overall there appears to be an increase in the number of
sales although the sales figures are fluctuating quarter by
quarter. The general /overall movement indicates an upward
trend
Seasonal variations
are short-term regular periodic movement in the value of the
variable
are due to different circumstances which prevail and affect
results at different times of the year, days of the week, times
of the day etc
For example:
1. Sales of ice cream are higher in summer than in winter, this
recurring pattern repeats every year
2. Cash sales in departmental store are higher on weekend than
on weekday each week
Cyclical variations
are long-term oscillations or swings about the trend
may or may not be periodic
are commonly associated with economic / trade cycle,
representing intervals of prosperity, recession, depression
and recovery
Trade cycle
Y prosperity
recovery
recession
depression
X
Chapter 7 – Page 3
Random variations
Purely random and irregular once-and-for all events which are
completely unpredictable
Accidental fluctuations for e.g. the weather may be
particularly hot resulting in above normal ice cream sales for
1 year. Catastrophic fluctuations for e.g. fire, earthquake,
flood etc
Since they are unpredictable, we assume that in the long run
they will tend to cancel each other out, and that in our
analysis, we may initially ignore their impact
Example 2
A company is investigating the number of order (thousands) of
three of its products, A, B and C, and has quarterly data available
for the past three years. Draw a historigram of the data for each
of the three products and comment on the trend and seasonal
components.
Product
Year Quarter A B C
2020 1 84 5 2.0
2 90 8 2.4
3 112 9 1.8
4 107 10 1.6
2021 1 88 14 2.1
2 95 17 2.3
3 118 18 1.7
4 116 22 1.6
2022 1 98 24 2.0
2 106 24 2.3
3 128 27 1.8
4 124 28 1.7
Chapter 7 – Page 4
Solution:
140
Number of order ('000s)
130
120
110
100
90
80
1 2 3 4 1 2 3 4 1 2 3 4
1990 1991 1992 Year
2020 2021 2022
2020
30
Number of order ('000s)
25
20
15
10
0
1 2 3 4 1 2 3 4 1 2 3 4
1990 1991 1992
Year
2020 2021 2022
2.5
2.4
Number of order ('000s)
2.3
2.2
2.1
2
1.9
1.8
1.7
1.6
1.5
1 2 3 4 1 2 3 4 1 2 3 4
1990 1991 1992
Year
2020 2021 2022
Chapter 7 – Page 5
Combining The Components
Given the four components (T, S, C, R) of any time series, they
are usually combined in one of the two alternative models.
1. The additive model
2. The multiplicative model
Evening
Evening
Evening
Evening
Afternoon
Morning
Afternoon
Morning
Afternoon
Morning
Morning
Afternoon
Morning
Afternoon
250
200
150
100
50
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Chapter 7 – Page 7
Example 3
Find the least squares trend line for the time series. Hence
forecast the sales for the year 2023.
Solution:
Let Y = sales (thousand units)
X = ranking by year
Year X Y X2 XY
2018 1 27 1 27
2019 2 30 4 60
2020 3 33 9 99
2021 4 37 16 148
2022 5 41 25 205
Total 15 168 55 539
Chapter 7 – Page 8
Moving averages method
Most commonly used method to identify the trend
Involves the calculation of a set of averages
A moving average is obtained by replacing each value in a
series by the mean of itself, some values directly preceding
and directly following it
By using moving averages of appropriate orders, we can
eliminate seasonal, cyclic, and random variations. Thus,
leaving only the trend movement
Note:
The period of the moving average must coincide with the
length of the natural cycle of the series. Examples:
(i) Moving average trend of numbers unemployed
for the quarters for several years must have a
period of 4.
(ii) Moving average trend of total monthly sales of
a business for a number of years must have a
period of 12.
(iii) Moving average trend for the daily takings of a
supermarket (open six days per week) over a
number of weeks must have a period of 6.
Chapter 7 – Page 9
Example 4
Absentees due to sickness
Week Monday Tuesday Wednesday Thursday Friday
1 4 7 8 11 18
2 3 8 10 13 21
3 6 9 13 17 28
Find the trend for the time series using moving averages method.
Solution:
Let Y = absentees due to sickness
5-day 5-day
Week Day Y moving moving
total average
(Trend)
1 Monday 4
Tuesday 7
Wednesday 8 48 9.6
Thursday 11
Friday 18
2 Monday 3
Tuesday 8
Wednesday 10
Thursday 13 58 11.6
Friday 21 59 11.8
3 Monday 6 62 12.4
Tuesday 9 66 13.2
Wednesday 13 73 14.6
Thursday 17
Friday 28
Chapter 7 – Page 10
Example 5
Sales (000’s)
Year Quarter 1 Quarter 2 Quarter 3 Quarter 4
1 - 42 55 36
2 16 50 53 40
3 28 58 69 59
Find the trend using the moving averages method.
2 42
3 55
149 37.2500
4 36
2 1 16
2 50
3 53
171 42.7500
4 40 43.7500
179 44.7500
3 1 28 46.7500
195 48.7500
2 58 51.1250
214 53.5000
3 69
4 59
Chapter 7 – Page 11
Measuring the Components
(b) Identifying the seasonal component
Seasonal variation has a distinctive characteristic of being
periodic with a recurring pattern from year to year, month to
month, week to week or day to day.
NOTE:
Using additive model to obtain the average seasonal variation,
the total average seasonal variations should be zero. If it is not,
the following adjustment is necessary:
Chapter 7 – Page 12
Example 6
Using the time series and moving averages trend obtained in
Example 5, calculate the average seasonal variations by using
the additive model and interpret your results.
Solution:
4-quarter
4-quarter 4-quarter Centred
Year Quarter Y moving moving moving (Y–T)
total average average
(Trend)
1 1 -
2 42
3 55
149 37.2500
4 36 38.2500
157 39.2500
2 1 16 39
155 38.7500
2 50 39.2500
159 39.7500
3 53 41.2500 11.7500
171 42.7500
4 40 43.7500 -3.7500
179 44.7500
3 1 28 46.7500 -18.7500
195 48.7500
2 58 51.1250 6.8750
214 53.5000
3 69
4 59
Chapter 7 – Page 13
Average seasonal variations(000’s):
Quarter
Year 1 2 3 4 Total
1
2
3
Total -41.7500
*Adjustment 0.8281
Adjusted
average -20.0469 0
0 − (−3.3125)
* Adjustment = = 0.8281
4
Chapter 7 – Page 14
Using the multiplicative model ( Y = T S )
Given the actual data (Y) and the calculated trend values (T):
S=Y÷T (in ratio form)
or S = (Y ÷ T) 100 (in percentage form)
NOTE:
Using the multiplicative model to obtain the seasonal
variations, the total of the average seasonal variations would be
predicted to be n where n is the number of seasons/time periods
in a section. If it is not, an adjustment is necessary as below:
No. of seasons
𝐀𝐝𝐣𝐮𝐬𝐭𝐦𝐞𝐧𝐭 =
Actual average total
Chapter 7 – Page 15
Example 7
Using the time series and moving averages trend obtained in
Example 5, calculate the average seasonal variation using the
multiplicative model and interpret your results.
Solution:
4-quarter
4-quarter 4-quarter Centred
Year Quarter Y moving moving moving (Y÷T)
total average average
(Trend)
1 1 -
2 42
3 55
149 37.2500
4 36 38.2500
157 39.2500
2 1 16 39
155 38.7500
2 50 39.2500
159 39.7500
3 53 41.2500 1.2848
171 42.7500
4 40 43.7500 0.9143
179 44.7500
3 1 28 46.7500 0.5989
195 48.7500
2 58 51.1250 1.1345
214 53.5000
3 69
4 59
Chapter 7 – Page 16
Average seasonal variations:
Quarter
Year 1 2 3 4 Total
1
2 -
3
Total -
Average 3.9214
*Adjustment -
Adjusted
0.5147 1.2283 1.3105 0.9464 4
average
4
*Adjustment = = 1.0200
3.9214
Chapter 7 – Page 17
Forecasting Using Trend and Seasonal Factor
A particular use of time series analysis is in forecasting
Assume that patterns of past data will be broadly continued,
at least into the short-term future
Using the past data to predict the future values
Chapter 7 – Page 18
Example 8
Using seasonal variations (additive model) obtained in Example
6, forecast the sales for the first two quarters of year 4.
Solution:
Seasonal
Estimated Trend Forecast sales
variation
Year Quarter d (000’s), 𝑇𝑒𝑠𝑡 (000’s), 𝑌𝑒𝑠𝑡
(000’s)
4 1
Example 9
Using the seasonal variations (multiplicative model) obtained in
Example 7, forecast the sales for the first two quarters of year 4.
Solution:
Seasonal
Estimated Trend Forecast sales
variation
Year Quarter d (000’s), 𝑇𝑒𝑠𝑡 (000’s), 𝑌𝑒𝑠𝑡
(000’s)
4 1
Chapter 7 – Page 19
Deseasonalising a time series
The effect is to smooth away seasonal fluctuations, leaving
a clear view of what might be expected ‘had seasons not
existed’
Also known as seasonally adjusted data
Seasonally adjusted data for additive model: Y − S
Seasonally adjusted data for Multiplicative model: Y S
Example 10
Deseasonalise the time series data in Example 6 (Additive
model).
Solution:
Sales Seasonal Deseasonalised
(000’s) variation (000’s) sales (000’s)
Year Q Y S Y-S
1 1 - - 20.0469 -
2 42 9.6406 32.3594
3 55 12.5781 42.4219
4 36 - 2.1719 38.1719
2 1 16 - 20.0469 36.0469
2 50 9.6406
3 53 12.5781
4 40 - 2.1719
3 1 28 - 20.0469
2 58 9.6406
3 69 12.5781
4 59 - 2.1719
Chapter 7 – Page 20
Example 11
Seasonally adjust the following time series data in Example 7
using the multiplicative model.
Solution:
Seasonally
Sales Seasonal adjusted sales
(000’s) variation (000’s)
Year Q Y S Y÷S
1 1 - 0.5147 -
2 42 1.2283 34.1936
3 55 1.3105 41.9687
4 36 0.9464 38.0389
2 1 16 0.5147 31.0861
2 50 1.2283
3 53 1.3105
4 40 0.9464
3 1 28 0.5147
2 58 1.2283
3 69 1.3105
4 59 0.9464
Chapter 7 – Page 21
Example 12
The following table shows the daily income (in RM) of a
stallholder who sells shoes from Wednesday to Sunday over a
3-week period:
Solution:
a) b)
Week Day Y 5-Day MT 5-Day MA (T) Y - T
1 Wed 180
Thu 250
Fri 500
Sat 600
Sun 640 2170 434 206
2 Wed 150 2120 424 -274
Thu 280 2070 414 -134
Fri 450 2080 416 34
Sat 550 2140 428 122
Sun 650 2090 418 232
3 Wed 210 2030 406 -196
Thu 230 2000 400 -170
Fri 390 1930 386 4
Sat 520
Sun 580
Chapter 7 – Page 22
b)
Week Wed Thu Fri Sat Sun Total
1 66 172 206
2 -274 -134 34 122 232
3 -196 -170 4
Total 104 294 438
Average 34.6667 147 219 13.6667
Adjustment -2.7333 -2.7333 -2.7333
Adjusted
31.9333 144.2667 216.2667 0
average
Adjustment =
4 Thu
d)
Week Day Y S Y-S
3 Fri
Chapter 7 – Page 23
BAMS2923 STATISTICAL ANALYSIS FOR BUSINESS
TUTORIAL 3 (TIME SERIES ANALYSIS)
Quarter
Year
1 2 3 4
1 32 48 40 16
2 24 56 40 8
3 24 48 32 16
Chapter 7 – Page 24
3. The table below shows the number of tourists who visit a town
in October 2022.
Number of tourists
Week
Mon Tue Wed Thu Fri Sat Sun
1 172 392 432 427 405 655 689
2 192 402 442 438 416 665 701
3 202 414 454 450 428 677 718
4 212 424 467 460 440 686 725
Number of students
Year Semester 1 Semester 2 Semester 3
2018 359 262 135
2019 330 271 151
2020 299 279 173
2021 280 250 190
2022 272 221 252
Chapter 7 – Page 25
5. The daily output (in units) from a factory is as shown in the
following table for a four-week period.
Answers
Chapter 7 – Page 26
(d) 0.5833; 134.7610, 121.5610, 144.9276
5. (a) 500, 498, 504, 506, 502, 506, 512, 514, 514, 516,
518, 520, 522, 504, 506, 506
(b) 0.7359, 0.8674, 0.9175, 1.1590, 1.3199
(c) 373.2485, 440.2922
Chapter 7 – Page 27
Past Year Questions
Chapter 7 – Page 28