You are on page 1of 28

Week 2

Can You Forecast Future


Costs?

Predictive Analysis

UTS CRICOS 00099F


Predictive Analysis

INFERENCE PREDICTION

e.g. What is the impact of e.g. What sales levels does our
advertising on sales? model predict for next year?
TIME SERIES
PATTERNS

UTS CRICOS 00099F


Time Series Patterns
Horizontal pattern Trend pattern
80 80

60 60

40 40

20 20

0 0
0 5 10 15 20 25 30 0 5 10 15 20 25 30

Seasonal pattern Trend and seasonal pattern


80 80

60 60

40 40

20 20

0 0
0 5 10 15 20 25 30 0 5 10 15 20 25 30
FORECASTING
METHODS

UTS CRICOS 00099F


Moving Averages (MA)

1 K−1

• Moving average: Yt = σi=0 Yt−𝑖 , K ≥ 1, t=1,..,T.
K
• One-sided MA
• The forecast is the mean of the most recent K time periods:
1 K−1
෡T+1
Y ഥT = ෍ YT−𝑖
=Y
K i=0
• K is the “order” of the MA.
• Small K leads to more volatile forecasts (why?)
• Large K leads to more stable forecasts
Example - MA
• Given the following data, calculate three-month moving average forecasts, where valid.

Month Production 3-month MA forecast


Jul-21 13
Aug-21 15
Sep-21 18
Oct-21 15 15.33
Nov-21 11 16.00
Dec-21 14 14.67 In-sample forecast
Jan-22 17 13.33
Feb-22 22 14.00
Mar-22 17.67 Out-of-sample forecast
Trend and Moving Average

• MA are appropriate for 120.0

horizontal patterns, but the Sales


MA(3)
100.0
persistently:
• overestimate the future 80.0

value when data are


trending down 60.0

• underestimate the future


value when data are 40.0

trending up
20.0

0.0
0 5 10 15 20 25 30
Double Moving Averages (DMA)

• DMA is designed to correct the persistent forecasting errors associated with data trend.
• One set of moving averages is first computed and then a moving average is calculated
on the first moving average:
Yt + Yt−1 + ⋯ + Yt−K+1
Mt =
K

Mt + Mt−1 + ⋯ + Mt−K+1
Mt =
K
DMA Forecasts

• The DMA forecasts are based on the following two parameters:


at = Mt + (Mt − Mt′ )
2
bt = (Mt − Mt′ )
K−1

• Forecasts are generated using the equation:


෡t+p = at + bt×p
Y
p = number of periods ahead to be forecast
Example - DMA

Year Sales Mt=MA(3) Mt'=DMA(3) a b Forecast


2013 8
2014 11 a=10.67+(10.67-10.44)
2015 9 9.33
b=[2/(3-1)](10.67-10.44)
2016 14 11.33
2017 9 10.67 10.44 10.90 0.23
2018 10 11.00 11.00 11.00 0 11.13 10.90+0.23x1
2019 10 9.67 10.46 8.88 -0.79 11.00
2020 8 9.33 10.00 8.66 -0.67 8.09
2021 12 10.00 9.67 10.33 0.33 7.99
2022 10.67

Note here MA(3) and DMA(3) are not forecasts.


DMA Forecast

• DMA corrects the persistent 120.0

Sales
forecasting errors DMA(3)
MA(3)
100.0
associated with data trend
80.0

60.0

40.0

20.0

0.0
0 5 10 15 20 25 30
Single Exponential Smoothing (SES)

• Moving averages: equal weights for the past K observations.


• Exponential smoothing: higher weights for more recent observations. (Why?)
• Smoothing: taking a weighted average of the forecast and the actual value and use it as
the new forecast
෡t+1 = αYt + 1 − α Y
Y ෡t

• α is the smoothing coefficient (0 < α < 1)


෡0
• Requires an initial forecast Y
Why “Exponential”?
• Starting with
෡t+1 = αYt + (1 − α)Y
Y ෡t
• We can make the substitution:
෡t+1 = αYt + 1 − α αYt−1 + 1 − α Y
Y ෡t−1
෡t−1
= αYt + α 1 − α Yt−1 + 1 − α 2 Y
• Substituting again and simplifying gives:
෡t+1 = αYt + α 1 − α 1 Yt−1 + α 1 − α 2 Yt−2 + 1 − α 3 Y
Y ෡t−2

• Since 0<α<1, the coefficients are smaller for observations in distant past.
• Higher α gives greater weights to recent observations.
• The sum of coefficients = 1.
Example - SES

• Using the following data, an initial forecast of 10.5 and an α of 0.2,


the forecast for 2022 is:

Year Sales Forecast


2017 9 10.5
2018 10 10.2 = 0.2 x 9 + 0.8 x 10.5
2019 10 10.16 = 0.2 x 10 + 0.8 x 10.2
2020 8 10.13
2021 12 9.70
2022 10.16 = 0.2 x 12 + 0.8 x 9.7
SES Forecast

• As MA forecasts, SES forecasts 120.0

Sales
have persistent errors when data SES(0.6)
100.0
have trends.
80.0

60.0

40.0

20.0

0.0
0 5 10 15 20 25 30
Holt’s Method

• SES is not appropriate if the data has a trend.

• Holt’s method adjusts the current level by adding the trend in the previous period.

• This adjustment reduces the lag that exists with SES

• The trend is not constant for the entire data set, but is different at each time period.

• Also called double exponential smoothing (just like double moving average): smoothing
both the level and the slope parameters.
Holt’s Method: Equations

• The three equations used in Holt’s method are:


Current level estimate:
Lt = αYt + (1-α)(Lt-1+Tt-1)
α= smoothing constant for level (0 < a < 1)
The trend estimate:
Tt = β(Lt-Lt-1) + (1-β)Tt-1
b = smoothing constant for trend (0 < b < 1)
Forecast p periods ahead with the equation:
෡t+p = Lt + pTt
Y
Example - Holt’s
• Use α = 0.2 and β = 0.1 with initial values L0 = Yഥ and T0 = 0 to forecast one period into
the future:
L0 = ഥ
Y = 9.8, T0 = 0

Year t Yt Lt Tt Yt+p

2017 1 9 9.64 -0.016 L17=0.2x9+0.8x(9.8+0) T17=0.1x(9.64-9.8)+0.9x0

2018 2 10 9.70 -0.008 9.62 Y18=9.64+(-0.016)x1

2019 3 10 9.75 0.002 9.69


2020 4 8 9.40 -0.037 9.75
2021 5 12 9.89 0.015 9.36 L21=0.2x12+0.8x(9.40-0.037) T21=0.1x(9.89-9.40)+0.9x(-0.037)

2022 6 9.91 Y22=9.89+(0.015)x1


Holt’s Forecast

• Holt’s forecasts are better than 120.0

Sales Holt's (0.6;0.2)


SES for trending series SES(0.6)
100.0

80.0

60.0

40.0

20.0

0.0
0 5 10 15 20 25 30
Forecasting using regression analysis

• Linear trend projection

• More on regression analysis in Weeks 9 – 11

𝑦ෝ𝑡 = 𝛼 + 𝛽1 𝑡
Where
𝑦ෝ𝑡 : dependent variable
𝛼: intercept
𝛽1 : slope coefficient
𝑡: time period
DECISION-MAKING
BIASES

UTS CRICOS 00099F


Cognitive Biases

Decision-making errors we make when we


rely on heuristics (mental shortcuts) as
opposed to logically working through the
information that’s available.

Kahneman, D. (2011). Thinking, fast and slow. Macmillan.


Cognitive Biases - Example

• Flip fair coin 10 times:

HHHHHHHHHH

• Next flip:

H or T?
Gambler’s Fallacy

Belief that the probability of a random


event occurring in the future is influenced
by previous instances of that type of
event.
IN-CLASS ACTIVITY

UTS CRICOS 00099F


In-class Activity

Problem: Can You Forecast Future Costs?

Criteria: Dollar difference between Forecast and Actual cost

Alternatives: Linear vs Exponential forecasting

Data: Tuition costs for Harvard graduate schools (1985-2013)

Harvard Financial Aid Office, 2015, "Harvard graduate school tuition", doi:10.7910/DVN/LV0YSQ
Forecasting

▪ Linear:
FORECAST()

▪ Exponential Smoothing:

FORECAST.ETS()

You might also like