Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
66 views21 pages

Chapter 4-Moving Average and Smoothing

Chapter 4 discusses forecasting methods for time series data, focusing on moving averages and exponential smoothing. It introduces the moving average method, which is effective for data without trends or seasonality, and explains the exponential smoothing methods, including simple exponential smoothing and Holt's method. The chapter emphasizes the importance of selecting appropriate parameters for accurate forecasting.

Uploaded by

nam phong quách
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views21 pages

Chapter 4-Moving Average and Smoothing

Chapter 4 discusses forecasting methods for time series data, focusing on moving averages and exponential smoothing. It introduces the moving average method, which is effective for data without trends or seasonality, and explains the exponential smoothing methods, including simple exponential smoothing and Holt's method. The chapter emphasizes the importance of selecting appropriate parameters for accurate forecasting.

Uploaded by

nam phong quách
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

LÊ QUANG CẢNH 2/12/2025

Chapter 4: Moving averages and exponential


smoothing

What did you learn in chapter 3?

 Trend & extrapolation


 A component of a time series showing long term movement
 Extrapolation is to extend the pattern found in past and present into future.
 Extrapolation uses as forecast when satisfies conditions (3)
 Linear trends/ Non-linear trends
 Procedures
 Identify the trend (fitting curve)/linearize the non-linear trend
 Estimate the trend
 Make forecast
 Evaluate forecast
 Examples

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 1
LÊ QUANG CẢNH 2/12/2025

Contents

 Introduction to the method


 Moving average
 Exponential smoothing
 Simple exponential smoothing
 Holt’s Trend Corrected Exponential Smoothing (Double exponential smoothing)
 Winter Exponential smoothing (Triple exponential smoothing)

1. Introduction

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 2
LÊ QUANG CẢNH 2/12/2025

Introduction

 This chapter introduces forecasting models applicable to time series data without
seasonal/cyclical, trend components
 Methods are used for forecasting a single variable in the short-term
 This method can be also used to identify a trend component of a time series
 Methods
 Moving average
 Exponential smoothing

2. Moving average

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 3
LÊ QUANG CẢNH 2/12/2025

Moving average/Averaging method

 A time series is generated by a constant process subject to random error,


then its mean can be used as a forecast for the next period.
 This method is appropriate when there is no noticeable trend or
seasonality
 It is a simple and popular forecasting method
 It is also used to eliminate the seasonal component

Moving average/ Averaging Methods

 Suppose:
 m moving periods; time series y
1
 m moving period mean ̄ ̄ =

 If there is no noticeable trend or seasonality, ̄ can be used as a forecast value


for the next period
1
= =

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 4
LÊ QUANG CẢNH 2/12/2025

Moving average/Averaging Methods

 The moving average for time period t is the mean of the “m” most recent observations.
 The constant number m is specified at the outset
 The smaller the number m, the more weight is given to recent periods and vice verse
 A large m is desirable when there are wide, infrequent fluctuations in the series.
 A small m is most desirable when there are sudden shifts in the level of series.

 Equal weights are assigned to each observation used in the average

Moving average/Averaging Methods

 Forecast procedures
 Identify moving periods (m)

 Make forecast

 Do forecast evaluation

10

10

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 5
LÊ QUANG CẢNH 2/12/2025

Example: Weekly Department Store Sales

Period (t) Sales (y)


1 5.3
2 4.4
 The weekly sales figures 3
4
5.4
5.8

(in millions of dollars) 5


6
5.6
4.8

presented in the table are 7


8
5.6
5.6
9 5.4
collected. 10
11
6.5
5.1

 What is the sale of the 12


13
5.8
5
14 6.2
following week? 15
16
5.6
6.7
17 5.2
18 5.5
19 5.8
20 5.1
21 5.8
22 6.7
23 5.2
24 6
25 5.8 11

11

Example: Weekly Department Store Sales

Weekly Sales (mil. USD)


8

4
Sales

0
0 5 10 15 20 25 30

Weeks 12

12

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 6
LÊ QUANG CẢNH 2/12/2025

Example: Weekly Department Store Sales

 Use a three-week moving average (m=3) for the department store sales to
forecast for the week 24 and 26.
( + + ) 5.2 + 6.7 + 5.8
= = = 5.9
3 3
y 25  y 24  y 23 5 .8  6  5 .2
yˆ 26    5 .7
3 3

 The forecast error is


e24  y24  yˆ24  6  5.9  .1

= − = . − . =− .

13

13

Example: Weekly Department Store Sales


Period (t) Sales (y) Y-hat3 Y-hat5
1 5.3
2 4.4
3 5.4
 MAPE3 = 9.04% 4 5.8 5.03
5 5.6 5.20
 MAPE5 = 8.11% 6 4.8 5.60 5.3
7 5.6 5.40 5.2
Weekly Sales Forecasts
8 5.6 5.33 5.44
8 9 5.4 5.33 5.48
10 6.5 5.53 5.4
7 11 5.1 5.83 5.58
12 5.8 5.67 5.64
6
13 5 5.80 5.68
14 6.2 5.30 5.56
5
15 5.6 5.67 5.72
Sales (y) 16 6.7 5.60 5.54
S a le s

4
forecast 17 5.2 6.17 5.86
3
18 5.5 5.83 5.74
19 5.8 5.80 5.84
2 20 5.1 5.50 5.76
21 5.8 5.47 5.66
1 22 6.7 5.57 5.48
23 5.2 5.87 5.78
0 24 6 5.90 5.72
0 5 10 15 20 25 30
25 5.8 5.97 5.76
Weeks 14
26 5.67 5.90

14

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 7
LÊ QUANG CẢNH 2/12/2025

3. Exponential Smoothing
3.1 Simple Exponential Smoothing

15

15

Introduction

 Exponential smoothing methods (3)


 The simplest exponential smoothing method is the single smoothing (SES)
method where only one parameter needs to be estimated
 Holt’s method makes use of two different parameters and allows forecasting for
series with trend.
 Holt-Winters’ method involves three smoothing parameters to smooth the data,
the trend, and the seasonal index.

16

16

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 8
LÊ QUANG CẢNH 2/12/2025

Introduction

 This method provides an exponentially weighted moving average of all


previously observed values.
 Appropriate for data with no predictable upward or downward trend.
 The aim is to estimate the current level and use it as a forecast of future
value.

17

17

Introduction

 This method initiates from two principles


 Closer observation has stronger impact (large weight)
 Current error should be used to calculate the following forecast values
= + = + ( − )

18

18

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 9
LÊ QUANG CẢNH 2/12/2025

Simple Exponential Smoothing Method

 Formally, the exponential smoothing equation is


Ft  1   y t  (1   ) Ft

 Ft 1  forecast for the next period.


  = smoothing constant.
 yt = observed value of series in period t.
 F t = old forecast for period t.
 The forecast Ft+1 is based on weighting the most recent observation yt with
a weight  and weighting the most recent forecast Ft with a weight of (1- )
19

19

Simple Exponential Smoothing Method

 The implication of exponential smoothing can be better seen if the


previous equation is expanded by replacing Ft with its components as
follows:
Ft 1   y t  (1   ) Ft
  y t  (1   )[ y t 1  (1   ) Ft 1 ]
  y t   (1   ) y t 1  (1   ) 2 Ft 1

20

20

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 10
LÊ QUANG CẢNH 2/12/2025

Simple Exponential Smoothing Method

 If this substitution process is repeated by replacing Ft-1 by its components,


Ft-2 by its components, and so on the result is:
= + (1 − ) + (1 − ) + (1 − ) +⋯

+ (1 − ) + (1 − )

= (1 − ) + (1 − )

 Therefore, Ft+1 is the weighted moving average of all past observations.

21

21

Simple Exponential Smoothing Method

 The following table shows the weights assigned to past observations for
 = 0.2, 0.4, 0.6, …..
Weight assigned to 0.2 0.4 0.6 0.8 0.9
Yt 0.2 0.4 0.6 0.8 0.9
Yt-1 0.2(1-0.2) 0.4(1-0.4) 0.6(1-0.6)
Yt-2 0.2(1-0.2)2 0.4(1-0.4)2 0.6(1-0.6)2
Yt-3 0.2(1-0.2)3 0.4(1-0.4)3 0.6(1-0.6)3
Yt-4 0.2(1-0.2)4 0.4(1-0.4)4 0.6(1-0.6)4
Yt-5 0.2(1-0.2)5 0.4(1-0.4)5 0.6(1-0.6)5
22

22

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 11
LÊ QUANG CẢNH 2/12/2025

Simple Exponential Smoothing Method

 The exponential smoothing equation rewritten in the following


form elucidate the role of weighting factor .
Ft 1  Ft   ( y t  Ft )
 Exponential smoothing forecast is the old forecast plus an
adjustment for the error that occurred in the last forecast.

23

23

Simple Exponential Smoothing Method

 The value of smoothing constant  must be between 0 and 1


  can be equal to 0 or 1.
 If stable predictions with smoothed random variation is desired, then a
small value of  is desire.
 If a rapid response to a real change in the pattern of observations is
desired, a large value of  is appropriate.
 m periods mainly affect the forecast value:
 = 2/(m+1)
24

24

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 12
LÊ QUANG CẢNH 2/12/2025

Simple Exponential Smoothing Method

 To estimate , Forecasts are computed for  equal to .1, .2, .3, …, .9 and
the sum of squared forecast error is computed for each.
 The value of  with the smallest MAPE is chosen for use in producing
the future forecasts.

25

25

Simple Exponential Smoothing Method

 To start the algorithm, we need F1 because


F2   y1  (1   ) F1
 Since F1 is not known, we can
 Set the first estimate equal to the first observation.
 Use the average of the first five or six observations for the initial
smoothed value.

26

26

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 13
LÊ QUANG CẢNH 2/12/2025

Example: Weekly Department Store Sales

Period (t) Sales (y)


1 5.3

 The weekly sales figures 2


3
4.4
5.4
4 5.8
(in millions of dollars) 5 5.6
6 4.8
presented in the table are 7
8
5.6
5.6
collected. 9
10
5.4
6.5
11 5.1
 What is the sale of the 12
13
5.8
5
following week? 14
15
6.2
5.6
16 6.7
17 5.2
18 5.5
19 5.8
20 5.1
21 5.8
22 6.7
23 5.2
24 6 27
25 5.8

27

Example: Weekly Department Store Sales


Period (t) Sales (y) alpha=0.3 alpha=0.6
1 5.3 5.3 5.3
2 4.4 5.30 5.30
3 5.4 5.03 4.76

 Since no forecast is 4
5
5.8
5.6
5.14
5.34
5.14
5.54
5.42 5.58
available for the first 6
7
4.8
5.6 5.23 5.11
8 5.6 5.34 5.40
period, we set the first 9 5.4 5.42 5.52
10 6.5 5.41 5.45
estimate equal to the first 11 5.1 5.74
5.55
6.08
5.49
12 5.8
observation. 13
14
5
6.2
5.62
5.44
5.68
5.27

 We try  =0.3, and 0.6. 15


16
5.6
6.7
5.67
5.65
5.83
5.69
17 5.2 5.96 6.30
18 5.5 5.73 5.64
19 5.8 5.66 5.56
20 5.1 5.70 5.70
21 5.8 5.52 5.34
22 6.7 5.61 5.62
23 5.2 5.93 6.27
24 6 5.71 5.63
25 5.8 5.80 5.85
28
5.80 5.82

28

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 14
LÊ QUANG CẢNH 2/12/2025

Example: Weekly Department Store Sales

 MAPE = 8.64% for  = 0.3


 MAPE = 10.20% for  = 0.6
7
6.5
6
5.5
5
4.5
4
3.5
3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Sales (y) alpha=0.3
29

29

3. Exponential Smoothing
3.2 Holt’s Exponential Smoothing

30

30

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 15
LÊ QUANG CẢNH 2/12/2025

Holt’s Exponential smoothing

 Applied for time series having a linear trend


 An extension of simple exponential smoothing by two
exponential smoothing parameters
 Adding a growth factor (or trend factor) as a way of adjusting
for the trend.

31

31

Holt’s Exponential smoothing

 Three equations and two smoothing constants are used in the


model.
 The exponentially smoothed series or current level estimate.
= + (1 − )( + )
 The trend estimate.
= ( − ) + (1 − )
 Forecast m periods into the future.
= + ∗

32

32

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 16
LÊ QUANG CẢNH 2/12/2025

Holt’s Exponential smoothing

 Lt = Estimate of the level of the series at time t


  = smoothing constant for the data.
 yt = actual value of series in period t.
  = smoothing constant for trend estimate
 bt = estimate of the slope of the series at time t
 l = periods to be forecast into the future.

33

33

Holt’s Exponential smoothing

 The weight  and  can be selected subjectively or by


minimizing a measure of forecast error such as MAPE.
 Large weights result in more rapid changes in the component.
 Small weights result in less rapid changes.

34

34

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 17
LÊ QUANG CẢNH 2/12/2025

Summary

 Moving average
 No trend, seasonality, and cyclicality
 Same weight for observation in the moving period
 Simple Exponential Moving average
 No trend, seasonality, and cyclicality
 Different weight, smaller to the past observations
 Holt’s exponential moving average
 With a linear trend
 Use two exponential smoothing parameters
 Do not show advantages over extrapolation
35

35

36

36

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 18
LÊ QUANG CẢNH 2/12/2025

Holt’s Exponential smoothing

 The initialization process for Holt’s linear exponential smoothing requires


two estimates:
 One to get the first smoothed value for L1
 The other to get the trend b1.
 One alternative is to set L1 = y1 and
= − or
= or
=0

37

37

Example: Quarterly sales of ABC company


Year Quarter t sales
2012 1 1 500
2 2 350

 The following table shows the 3


4
3
4
250
400
2013 1 5 450
sales of ABC Company. 2
3
6
7
350
200
4 8 300
 These are quarterly sales from 2014 1
2
9
10
350
200

2012 through 2018. 3


4
11
12
150
400
2015 1 13 550
2 14 350
3 15 250
4 16 550
2016 1 17 550
2 18 400
3 19 350
4 20 600
2017 1 21 750
2 22 500
3 23 400
4 24 650
2018 1 25 850
2 26 600
3 27 450
38
4 28 700

38

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 19
LÊ QUANG CẢNH 2/12/2025

Example: Quarterly sales of ABC company

 Examination of the plot shows: 900

A non-stationary time series


800

data.
700

600

 Seasonal variation seems to exist. 500

Saws
 Sales for the first and fourth quarter 400

are larger than other quarters. 300

200

100

0
0 5 10 15 20 25 30

Year

39

39

Example: Quarterly sales of ABC company

 The plot of the data shows that there might be trending in the data
therefore we will try Holt’s model to produce forecasts.
 We need two initial values
 The first smoothed value for L1
 The initial trend value b1.
 We will use the first observation for the estimate of the smoothed value
L1, and the initial trend value b1 = 0.
 We will use  = .3 and =.1.
40

40

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 20
LÊ QUANG CẢNH 2/12/2025

Example: Quarterly sales of ABC company


Year Quarter t sales Lt bt Ft+m
2012 1 1 500 500.00 0.00 500.00
2 2 350 455.00 -4.50 500.00
3 3 250 390.35 -10.52 450.50
4 4 400 385.88 -9.91 379.84
2013 1 5 450 398.18 -7.69 375.97
2 6 350 378.34 -8.90 390.49
3 7 200 318.61 -13.99 369.44
4 8 300 303.23 -14.13 304.62
2014 1 9 350 307.38 -12.30 289.11
2 10 200 266.55 -15.15 295.08
3 11 150 220.98 -18.19 251.40
4 12 400 261.95 -12.28 202.79
2015 1 13 550 339.77 -3.27 249.67
2 14 350 340.55 -2.86 336.50
3 15 250 311.38 -5.49 337.69
4 16 550 379.12 1.83 305.89
2016 1 17 550 431.67 6.90 380.95
2 18 400 427.00 5.74 438.57
3 19 350 407.92 3.26 432.74
4 20 600 467.83 8.93 411.18
2017 1 21 750 558.73 17.12 476.75
2 22 500 553.10 14.85 575.85
3 23 400 517.56 9.81 567.94
4 24 650 564.16 13.49 527.37
2018 1 25 850 659.35 21.66 577.65
2 26 600 656.71 19.23 681.01
3 27 450 608.16 12.45 675.94 41
4 28 700 644.43 14.83 620.61

41

Example: Quarterly sales of ABC company

 RMSE for this application is ( = .3 and = .1): RMSE = 155.5


 The plot also showed the possibility of seasonal variation that needs to be
investigated. Quarterly Saw Sales Forecast Holt's Method

900

800

700

600

500
Sales

sales
Ht+m
400

300

200

100

0
0 5 10 15 20 25 30
Quarters 42

42

INSTITUTE FOR SUSTAINABLE


DEVELOPMENT 21

You might also like