0% found this document useful (0 votes)
57 views

Forecasting 3

This document provides an introduction to demand forecasting and time series modelling. It discusses several forecasting methods including moving averages, exponential smoothing, and Holt's method. Simple exponential smoothing uses a single smoothing equation to update the level or mean of a non-seasonal time series with no trend over time. Holt's method extends this by including equations to update both the level and trend, allowing it to forecast time series that exhibit a trend pattern. The document provides examples and explanations of how to apply these forecasting techniques.

Uploaded by

Mario Vasquez
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)
57 views

Forecasting 3

This document provides an introduction to demand forecasting and time series modelling. It discusses several forecasting methods including moving averages, exponential smoothing, and Holt's method. Simple exponential smoothing uses a single smoothing equation to update the level or mean of a non-seasonal time series with no trend over time. Holt's method extends this by including equations to update both the level and trend, allowing it to forecast time series that exhibit a trend pattern. The document provides examples and explanations of how to apply these forecasting techniques.

Uploaded by

Mario Vasquez
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/ 26

Introduction to demand forecasting

Forecasting

MSc. Marı́a Belen Segovia

Escuela Superior Politécnica del Litoral

2022
A General Approach to Time Series Modelling
Forecasting

I Forecasting the future values of an observed time series is an


important problem in many areas, including economics, produc-
tion planning, sales forecasting and stock control.

I Suppose we have an observed time series {x1 , . . . , xn }. Then,


the basic problem is to estimate future values such as xn+h ,
where the integer h is called the lead time or forecasting horizon.

I Notation:
n
I Let Xn+h denote the forecast made at time n for Xn+h .
I For instance, when h = 1 we have: Xn+1n
=forecast for Xn+1 ,
made at time n.
Remember that: Forecasting is a form of extrapolation, with all the
dangers that it involves.
Forecasting choice of method

I How the forecast is going to be used.


I The type of time series (e.g. macroeconomic series or sales fig-
ures) and its properties (e.g. are trend and seasonality present?).
As always, a time plot of the data is very helpful.
I How many past observations are available.
I The length of the forecasting horizon.
I The number of series to be forecast and the cost allowed per
series.
I The skill and experience of the analyst. Analysts should select
a method with which they feel ‘happy’ and for which relevant
computer software is available.
Moving Average
We will discuss the Moving Average adaptative method.
The moving average method is used when demand has no observable
trend or seasonality. In this case:

Systematic component of demand = level

In this method the level in t is estimated as the average demand


over the most recent N periods.This represents an N -period moving
average and is evaluated as follows:
1
µt = (xt + xt−1 + . . . + xt−N +1 )
N
The current forecast for all future periods is the same and is based
on the current estimate of level. The forecast is stated as
n n
Xn+1 = µt and Xn+h = µt
Moving Average
After observing the demand for time point n + 1, we revise the
estimates as follows:
1
ut+1 = (xt+1 + xt + . . . + xt−N +2 )
N
Then,
n
Xn+2 = ut+1

I To compute the new moving average, we simply add the latest


observation and drop the oldest one.
I The revised moving average serves as the next forecast.
I The moving average corresponds to giving the last N periods of
data equal weight when forecasting and ignoring all data older
than this new moving average.
I As we increase N , the moving average becomes less responsive
to the most recently observed demand.
Moving Average
Example

A supermarket has experienced weekly demand of milk of

x1 = 120, x2 = 127, x3 = 114, and x4 = 122

gallons over the past four weeks.


I Forecast demand for Period 5 using a four-period moving aver-
age.
I What is the forecast error if demand in Period 5 turns out to
be 125 gallons?
Exponential Smoothing

Exponential smoothing (ES) is the name given to a general class


of forecasting procedures that rely on simple updating equations to
calculate forecasts.
Forecasts produced using exponential smoothing methods are weighted
averages of past observations, with the weights decaying exponen-
tially as the observations get older.
Simple Exponential Smoothing

Simple Exponential Smoothing should only be used for non-seasonal


time series showing no systematic trend. That is,

Systematic component of demand = level

I Using the naive method, all forecasts for the future are equal
to the last observed value of the series.
I Using the average method, all future forecasts are equal to a
simple average of the observed data.
I We often want something between these two extremes. For
example, it may be sensible to attach larger weights to more
recent observations than to observations from the distant past.
Simple Exponential Smoothing

Given a non-seasonal time series, say x1 , x2 , . . . , xn with no system-


atic trend, it is natural to forecast xn+1 by means of a weighted sum
of the past observations.

Forecasts are calculated using weighted averages, where the weights


decrease exponentially as observations come from further in the past
— the smallest weights are associated with the oldest observations:

n
Xn+1 = αxn + α(1 − α)1 xn−1 + α(1 − α)2 xn−2 + . . .
where 0 < α < 1 is the smoothing parameter.

The set of weights {α(1 − α)i , ∀i = 0, . . . , N − 1} are geometric


weights, which decrease by a constant ratio for every unit increase
in the lag.
Simple Exponential Smoothing

The following table below shows the weights associated to obser-


vations for two different values of α when using simple exponential
smoothing for forecasting.

Observed α(1 − α)i


i (lag)
value α = 0.2 α = 0.4
xn 0 0.2 0.4
xn−1 1 0.16 0.24
xn−2 2 0.128 0.144
xn−3 3 0.1024 0.0864
xn−4 4 0.08192 0.05184
xn−5 5 0.0655 0.0311
Simple Exponential Smoothing
Weighted average form

The last equation implies an infinite number of past observations,


but in practice we only have finite number of observations. There-
fore, it can be written in its recurrence form as:

n
Xn+1 = αxn + (1 − α)Xnn−1
The forecast at time n + 1 is equal to a weighted average between
the most recent observation xn and the previous forecast Xnn−1 .
where 0 ≤ α ≤ 1 is the smoothing parameter.

Similarly, we can write the fitted values as:

x̂tt+1 = αxt + (1 − α)x̂tt−1


for t = 1, . . . , n.
Simple Exponential Smoothing
Weighted average form

The process has to start somewhere, so we let the first fitted value
at time 1 be denoted by `0 (which will be estimated as well). Then,

x̂12 = αx1 + (1 − α)`0


x̂23 = αx2 + (1 − α)x̂12
..
.
x̂nn+1 = αxn + (1 − α)x̂n−1
n

Substituting each equation into the following equation, we obtain


n−1
X
n
Xn+1 = α(1 − α)j xn−j + (1 − α)n `0
j=0

The last term becomes tiny for large n.


Simple Exponential Smoothing
Component form

Component form representations of exponential smoothing methods


comprise a forecast equation and a smoothing equation for each of
the components included in the method. The component form of
simple exponential smoothing is given by:

n
Forecast equation Xn+h = `n
Smoothing equation `t = αxt + (1 − α)`t−1

where `t is the level (or the smoothed value) of the series at time t.
If we replace lt with x̂tt+1 and `t−1 with x̂tt−1 in the smoothing equa-
tion, we will recover the weighted average form of simple exponential
smoothing.
Simple Exponential Smoothing
Flat forecast

Simple exponential smoothing has a “flat” forecast function:


n
Xn+h = `n h = 1, 2, 3, . . .
Simple Exponential Smoothing
Smoothing constant α

The value of the smoothing constant α depends on the properties


of the given time series. Values between 0.1 and 0.3 are commonly
used and produce a forecast that depends on a large number of past
observations. Values close to one are used rather less often and give
forecasts that depend much more on recent observations. When
α = 1, the forecast is equal to the most recent observation(naive
method).
Holt’s method

Holt (1957) extended simple exponential smoothing to allow the


forecasting of data with a trend. This method involves a forecast
equation and two smoothing equations (one for the level and one
for the trend)
Recall that in the absence of trend and seasonality, the one-step-
ahead forecast from simple ES can be thought of as an estimate of
the local mean level of the series, so that simple ES can be regarded
as a way of updating the local level of the series, say `t , this suggest
the equation of the form:

`t = αxt + (1 − α)`t−1
Holt’s method

Suppose we now wish to include a trend term, bt say, which is the


expected increase or decrease per unit time period in the current
level. Then a plausible pair of equations for updating the values of
`t and bt in recurrence form are the following

t
Forecast equation Xt+h = `t + hbt
Level equation `t = αxt + (1 − α)(`t−1 + bt−1 )
Trend equation bt = β ∗ (`t − `t−1 ) + (1 − β ∗ )bt−1

where `t denotes an estimate of the level of the series at time t, bt


denotes an estimate of the trend (slope) of the series at time t, α
is the smoothing parameter for the level, 0 ≤ α ≤ 1, and β ∗ is the
smoothing parameter for the trend, 0 ≤ β ∗ ≤ 1.
Holt’s method

The forecast function is no longer flat but trending. The h-step-


ahead forecast is equal to the last estimated level plus h times the
last estimated trend value. Hence the forecasts are a linear function
of h.
Holt Winters

Holt (1957) and Winters (1960) extended Holt’s method to capture


seasonality. The Holt-Winters seasonal method comprises the fore-
cast equation and three smoothing equations — one for the level `t ,
one for the trend bt , and one for the seasonal component st , with
corresponding smoothing parameters α,β ∗ and γ. We use m to de-
note the frequency of the seasonality, i.e., the number of seasons
in a year. For example, for quarterly data m = 4, and for monthly
data m = 12.
There are two variations:
I Additive method
I Multiplicative method
Holt Winters

I The additive method is preferred when the seasonal variations


are roughly constant through the series, while the multiplicative
method is preferred when the seasonal variations are changing
proportional to the level of the series.
I With the additive method, the seasonal component is expressed
in n the scale of the observed series, and in the level equation
the series is seasonally adjusted by subtracting the seasonal
component. Within each year, the seasonal component will
add up to approximately zero.
I For an additive model, seasonal effects are adjusted so that the
average of d seasonal components is 0 (this is equivalent to
their sum being equal to 0);
Holt Winters

I With the multiplicative method, the seasonal component is ex-


pressed in relative terms (percentages), and the series is season-
ally adjusted by dividing through by the seasonal component.
Within each year, the seasonal component will sum up to ap-
proximately m.
I For a multiplicative model, the m seasonal effects are adjusted
so that they average to 1 (this is equivalent to their sum being
equal to m);
Holt Winters
Holt-Winter’s additive method

The component form for the additive method is:

t
Xt+h = `t + hbt + st+h−m(k+1)
`t = α(xt − st−m ) + (1 − α)(`t−1 + bt−1 )
bt = β ∗ (`t − `t−1 ) + (1 − β ∗ )bt−1
st = γ(xt − `t−1 − bt−1 ) + (1 − γ)st−m

where k is the integer part of (h − 1)/m which ensures that the


estimates of the seasonal indices used for forecasting come from the
final year of the sample.
Holt Winters
Holt-Winter’s additive method

The level equation shows a weighted average between the season-


ally adjusted observation (xt − st−m ) and the non-seasonal forecast
`t−1 + bt−1 for time t.

The trend equation is identical to Holt’s linear method. The seasonal


equation shows a weighted average between the current seasonal
index, (xt − `t−1 − bt−1 ) and the seasonal index of the same season
last year (i.e., m time periods ago).
Holt Winters
Holt-Winter’s multiplicative method

The component form for the multiplicative method is:

t
Xt+h = (`t + hbt )st+h−m(k+1)
xt
`t = α( ) + (1 − α)(`t−1 + bt−1 )
st−m
bt = β ∗ (`t − `t−1 ) + (1 − β ∗ )bt−1
xt
st = γ( ) + (1 − γ)st−m
`t−1 + bt−1
References

I Hyndman, R.J., Athanasopoulos, G. (2018) Forecasting: prin-


ciples and practice, 2nd edition, OTexts: Melbourne, Australia.
OTexts.com/fpp2. Accessed on June 2021.
I Chatfield, C.,Xing H.(2019). The analysis of time series: an
introduction with R.(7edn) Boca Raton: Taylor Francis, 2019.
ISBN 9781138066137
I Ioannis Papastathopoulos Time series course UoE 2020.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy