You are on page 1of 22

Chapter 7 Time Series Analysis and Forecasting

Time Series is a set of observations of a variable taken at


specific times, usually at equal time intervals.

Examples of times series data


1. Daily output of a factory for the past three weeks.
2. Monthly sales of a company over the last two years.
3. Annual total operating costs of a warehouse for the last
10 years.

Time series analysis is concerned with the movement of the


variable’s values from one time period to the next, it enables
us to understand the past and use the past information to
forecast what will happen in future and thus help with
production, planning and other future decision making.

Historigram/Time Series Plot


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 (Y)

1
Components/ movements/ variations of a time series
A time series can be decomposed into 4 components
1. Trend (T)
2. Seasonal variation (S)
3. Cyclical variation (C)
4. Random variatiom (R)

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 or No clear movement

2
Eg 1:

Overall, there appears to be an increase in the number of sales


although the sales figures are fluctuating quarter by quarter.
( 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 a 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 stores are higher on weekend
than on weekday each week.

3
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 and
recovery.

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. E.g. fire, earthquake, flood etc.
➢ Since they are predictable, 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.

Eg 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.
4
5
Downward trend

Additive and multiplicative models


➢ The time series additive model
Y=T+S+R
where Y = given time series value
T = trend component
S = seasonal component
R = random/residual component

➢ The time series multiplicative model


Y=TSR

Y and T are actual quantities, while S, C and R are


ratios.

6
Moving average method to determine the trend (T)
➢ Moving averages (of period n) for n values of a time
series are arithmetic means of successive and
overlapping values, taken n at a time.

Eg 3: Calculate trend value for the data value using moving


averages within an appropriate period of 4.
Year Quarter Original Moving Moving Centered moving
data (Y) total (MT) average average (T)
+4 values (MA) 4 CMA
1 1 2.2

2 5.0
18.3 4.575
3 7.9 4.6625
19 4.75
4 3.2 4.775
19.2 4.8
2 1 2.9 4.8375
19.5 4.875
2 5.2 4.95
20.1 5.025
3 8.2 5.0625
20.4 5.1
4 3.8 5.175
21 5.25
3 1 3.2 5.3625
21.9 5.475
2 5.8 5.5125
22.2 5.55
3 9.1

4 4.1
(2m) (2m) (2m)

7
Eg 4: Find the trend for the time series using moving averages
method.
Week Absence due to sickness
Monday Tuesday Wednesday Thursday Friday
1 4 7 8 11 18
2 3 8 10 13 21
3 6 9 13 17 28

Soln:
Week Day Y 5-day Moving total (MT) 5-day Moving average
(+5 values) (5) (T), (MA)
1 Monday 4

Tuesday 7

Wednesday 8 48 9.6

Thursday 11 47 9.4

Friday 18 48 9.6

2 Monday 3 50 10

Tuesday 8 52 10.4

Wednesday 10 55 11

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
(2m) (2m)
8
Eg 5: Find the trend using the moving averages method.
Year Sales (000’s)
Qtr 1 Qtr 2 Qtr 3 Qtr 4
2010 - 42 55 36
2011 16 50 53 40
2012 28 58 69 59

Soln:
Year Quarter Original Moving Moving Centered Y-T
data (Y) total average moving
average (T)
2010 2 42

3 55
149 37.25
4 36 38.25
157 39.25
2011 1 16 39
155 38.75
2 50 39.25
159 39.75
3 53 41.25
171 42.75
4 40 43.75
179 44.75
2012 1 28 46.75
195 48.75
2 58 51.125
214 53.5
3 69

4 59

9
Seasonal Variation
➢ Components given an average effect on the trend which
is solely attributable to the season itself.
➢ An average by how much a particular season will tend to
increase or decrease the underlying trend in terms of
deviations from (additive model) or percentages of
(multiplicative model) the trend.
➢ Technique for calculating seasonal variation
❖ Additive model
1) Calculate for each time point, the value of Y – T
(the difference between original value and the
trend).
2) For each season in turn, find the average
(arithmetic mean) of the Y – T values in a
specific seasonal table.
3) If the total of the averages differs from zero,
adjust one or more of them, so that their total is
zero.

10
Eg 6: The sales of company (Y in RM’000) are given below,
together with a previously calculated trend (T). The
subsequent calculations to find the seasonal variation
are shown below.

Year Qtr Y T Y–T


1 1 20 23 -3
2 15 29 -14
3 60 34 26
4 30 39 -9
2 1 35 45 -10
2 25 50 -25
3 100 55 45
4 50 61 -11

Soln:
Qtr 1 Qtr 2 Qtr 3 Qtr 4 Total
Year 1 -3 -14 26 -9
Year 2 -10 -25 45 -11
Total -13 -39 71 -20
Average +
-6.5 -19.5 35.5 -0.5 ≠0
-10
Adjustment 0.125 0.125 0.125 0.125
-(-0.54)
Average Seasonal -6.375 -19.375 35.625 -9.875 0
variation (ASV)

Interpretation:
The average seasonal effect Qtr 1 is to deflate the trend by
6.375 (RM’000) and for Qtr 3 is to inflate the trend
by 35.625 (RM’000).

11
Eg 7: The following data gives UK Outward passenger
movements (in million) by sea.
a) Find the 4-quarter moving average trend and the
values of the seasonal variation for each of the 4
quarters (using an additive model).
b) Calculate the average seasonal variation.
Qtr 1 Qtr 2 Qtr 3 Qtr 4
2.2 5.0 7.9 3.2
Year 1
2.9 5.2 8.2 3.8
Year 2
3.2 5.8 9.1 4.1
Year 3

Soln:
Year Quarter Original Moving Moving Centered Y–T
data (Y) total average moving average
(T)
1 1 2.2

2 5.0
18.3 4.575
3 7.9 4.6625 3.2375
19 4.75
4 3.2 4.775 -1.575
19.2 4.8
2 1 2.9 4.8375 -1.9375
19.5 4.875
2 5.2 4.95 0.25
20.1 5.025
3 8.2 5.0625 3.1375
20.4 5.1
4 3.8 5.175 -1.375
21 5.25
3 1 3.2 5.3625 -2.1625
21.9 5.475
2 5.8 5.5125 0.2875
22.2 5.55
3 9.1

4 4.1

12
b)
Qtr 1 Qtr 2 Qtr 3 Qtr 4 Total

- - 3.2375 -1.575
Year1
-1.9375 0.25 3.1375 -1.375
Year 2
-2.1625 0.2875 - -
Year 3
-4.1 0.5375 6.375 -2.95
Total
-2.05 0.26875 3.1875 -1.475 -0.06875
Average
+
0.0171875 0.0171875 0.0171875 0.0171875
Adjustment
−0.06875

4
-2.03 0.29 3.20 -1.46 0
Average seasonal
variation (ASV)

Interpretation:
The average seasonal effect Qtr 1 is to deflate the trend by
2.03 (million) and for Qtr 3 is to inflate the trend by 3.20
(million).

❖ Multiplicative Model
𝑌
1) Calculate for each time point, the value of 𝑇.
𝑌
2) For each season of all years, find the average of 𝑇
values.
3) If the total of the averages differs from n, adjust
them so that their total is n.
n = number of recorded data in a period

13
Eg 8:

Year Quarter Original Moving Moving Centered moving 𝑌


data (Y) total average average (T) 𝑇
2010 1 90

2 138
516 129
3 188 128 1.46875
508 127
4 100 124.5 0.80321
488 122
2011 1 82 118.5 0.69198
460 115
2 118 113.5 1.03965
448 112
3 160 110.5 1.44796
436 109
4 88 106.5 0.82629
416 104
2012 1 70 101 0.69307
392 98
2 98 96.5 1.01554
380 95
3 136

4 76

Qtr 1 Qtr 2 Qtr 3 Qtr 4 Total

- - 1.46875 0.80321
2010
0.69198 1.03965 1.44796 0.82629
2011
0.69307 1.01554 - -
2012
1.38505 2.05519 2.91671 1.6295
Total
0.69253 1.02760 1.458355 0.81475 4
Average
69.25% 102.76% 145.84% 81.48%
14
Interpretation: The seasonal variation obtained in
multiplicative model are not true variations but percentage
increases or decreases. Without seasonal fluctuation, the
seasonal variation should be 100%. Due to seasonal fluctuation ,
sales in Qtr 1 was 30.75% below average sales, Sales in Qtr 2
was 2.76% above average sales. Sales in Qtr 3 was 45.84%
above the average sales. Sales in Qtr 4 was 18.52% below the
average sales.

Deseasonalising a time series


➢ A set of typical indexes is very useful in adjusting a
series (for example, sales).
➢ The resulting series (sales) is called deseasonalised sales
or seasonally adjusted sales.
➢ The reason for deseasonalising a series (sales) is to
remove the seasonal fluctuations so that the trend and
cycle can be studied.
❖ Additive model
The adjustment is performed by subtracting seasonal
values from each of the original time series values and
represent algebraically by:
Seasonally adjusted value = Y – S
❖ Multiplicative model
The adjustment is performed by dividing each of the
original time series values by seasonal values and is
represented algebraically by:
𝑌
Seasonally adjusted value = , (S in ratio) Or
𝑆

15
𝑌×100
Seasonally adjusted value = , (S in percentage)
𝑆

Eg 9: Year Qtr Y T S Y–S


1 1 20 23 -6.375 26.375
2 15 29 -19.375 34.375
3 60 34 35.625 24.375
4 30 39 -9.875 39.875
2 1 35 45 -6.375 41.375
2 25 50 -19.375 44.375
3 100 55 35.625 64.375
4 50 61 -9.875 59.875

Forecasting using trend and seasonal component

Additive Model
➢ Estimate a trend value for the time point using average
rate of change in trend over the whole period.

𝐿𝑎𝑠𝑡 𝑡𝑟𝑒𝑛𝑑 𝑣𝑎𝑙𝑢𝑒−𝐹𝑖𝑟𝑠𝑡 𝑡𝑟𝑒𝑛𝑑 𝑣𝑎𝑙𝑢𝑒


Average rate of change = 𝑛−1
Average increase in trend (AIT)

where n = total number of trend values

➢ Identify the seasonal variation S, appropriate to the time


point.
➢ Yest = Test + S
Where Test = projected trend value
S = appropriate seasonal variation value
Yest = estimated data value (Forecast value)
16
Multiplicative Model
➢ Estimate a trend for the time point using average rate of
change in trend over the whole period.

𝐿𝑎𝑠𝑡 𝑡𝑟𝑒𝑛𝑑 𝑣𝑎𝑙𝑢𝑒−𝑓𝑖𝑟𝑠𝑡 𝑡𝑟𝑒𝑛𝑑 𝑣𝑎𝑙𝑢𝑒


Average rate of change = 𝑛−1

where n = total number of trend values

➢ Identify the seasonal variation S, appropriate to the time


point.
➢ Yest = Test  S

Eg 10: The sales department of XYZ Company supplies the


sales data, recorded three times a year, over 4 years.
Year Jan-Apr May-Aug Sept-Dec
85 120 65
1
90 140 80
2
95 150 85
3
100 160 95
4
a) Draw a historigram for the above data.
b) Establish the trend by calculating the moving
averages.
c) Determine the average seasonal components, using
additive model.
d) Forecast the sales for year 5.

17
Soln:
a)
Time Series Plot
180
160
140
120
Sales

100
80
60
40
20
0

Sept-Dec
Sept-Dec

Sept-Dec

Sept-Dec
May-Aug

May-Aug

May-Aug

May-Aug
Jan-Apr

Jan-Apr

Jan-Apr

Jan-Apr
1 2 3 4
Year

Comment: This is an increasing trend. Every May-Aug


recording the highest sales. Every Sept-Aug
recording the lowest sales.

b) Let Y = sales c)
Year Season Y Moving Moving Y-T
total (+3) average,
T(3)
J-A 85 Ist trend
1
M-A 120 270 90 30
S-D 65 275 91.67 -26.67
J-A 90 295 98.33 -8.33
2
M-A 140 310 103.33 36.67
S-D 80 315 105 -25
J-A 95 325 108.33 -13.33
3
M-A 150 330 110 40
S-D 85 335 111.67 -26.67
J-A 100 345 115 -15
4
M-A 160 355
Last trend 118.33 41.67

18
S-D 95 d=1
J-A 2
Year
M-A 3
5
S-D 4

c)
Year Jan-Apr May-Aug Sept-Dec Total
- 30 -26.67
1
-8.33 36.67 -25
2
-13.33 40 -26.67
3
-15 41.67 -
4
-36.66 148.34 -78.34
Total
-12.22 37.085 -26.113 -1.248
Average +
0.416 0.416 0.416
Adjustment
−1.248
−( ) = 0.416
3
-11.804 37.501 -25.697 0
Average seasonal
variation(S or ASV)
−1.248
Adjustment = −( 3
) = 0.416

19
118.33−90
d) The average increase in trend (AIT) = = 3.148
10−1

Forecast, Yest = Test + S

Season d Test = Tlast +d(AIT) S Forecast


J-A 2 118.33+2(3.148) -11.804 124.626+(-11.804)
Year = 112.822
= 124.626
5 127.774 + 37.501
M-A 3 118.33+3(3.148) 37.501
=165.275
= 127.774
S-D 4 118.33+4(3.148) -25.697 130.922 + (-25.697)
= 105.225
= 130.922
Test = Tlast + d(AIT)
d = no. of quarters deviated from the last trend value

Eg 11: The quarterly sales (RM’000) of a certain sports


equipment by a sports shop from the year 2006 to
2009 are shown in the table below.

2006 2007 2008 2009


- 8 20 40
First quarter
- 30 50 62
Second
quarter
- 60 80 92
Third quarter
24 20 40 -
Fourth quarter

20
a) Determine the moving average trend and hence, the
mean seasonal variation using multiplicative model.

b) Predict the sales for the 1st quarter of 2010.


Soln: a)
Year Quarter Original Moving Moving Centered 𝑌
data (Y) total average moving 𝑇
average (T)
2006 4 24

2007 1 8
122 30.5
2 30 30 1
118 29.5
3 60 31 1.935
130 32.5
4 20 35 0.571
150 37.5
2008 1 20 40 0.5
170 42.5
2 50 45 1.111
190 47.5
3 80 50 1.6
210 52.5
4 40 54 0.741
222 55.5
2009 1 40 57 0.702
234 58.5
2 62 d=1

3 92 2

4 - 3
21
2010 1 42.73 4

Qtr 1 Qtr 2 Qtr 3 Qtr 4 Total

- 1 1.935 0.571
2007
0.5 1.111 1.6 0.741
2008
0.702 - - -
2009
1.202 2.111 3.535 1.312
Total
0.601 1.0555 1.7675 0.656 4.08
Average
0.9804 0.9804 0.9804 0.9804
Adjustment
4
= 0.9804
4.08
0.59 1.03 1.73 0.64 4
Mean seasonal
variation, S
57−30
b) AIT = = 3.857
8−1

Year Quarter d Test=Tlast+d(AIT) S Forecast


1 4 57 + 4(3.857) = 0.59 72.428×0.59
2010
72.428 = 42.73 (RM000)

22

You might also like