time series in 10am recording spss - open university
TRANSCRIPT
Time Series in SPSS
Dr Jason [email protected]
07311 188 800
• This tutorial will begin at 10am for about anhour.
• I will be recording this presentation soplease let me know if you have anyquestions or concerns about this.
• Mics will be muted until the end of thetutorial, when I will also stop recording.
• Feel free to use the Chat Box at any time!• I will email slides out after the tutorial.
Tutorials are enhanced by your interaction Please vote in the polls and ask questions!
M249 Practical Modern Statistics
TMA02 due on 27 January!
• Things you might need today:• M249 Computer Book 2• Note-taking equipment• Drink of your choice
Time Series in SPSS (Computer Book 2)
• Plotting a Time Series• Estimating Time Series Components
• Additive & non-additive models• ARMA & ARIMA models
• Selecting• Fitting• Evaluating• Forecasting
• Forecasting • Smoothing functions
2
Computer Book 2 has detailed instructions!
M249 Practical Modern Statistics
Trend, Variance and Seasonality
3
Time index
Valu
e (a
rb)
Simulation E How would you describe the trend &
variance in this graph?
Trend, Variance and Seasonality
4
Time index
Valu
e (a
rb)
How would you describe the trend &
variance in this graph?
Changing trend Changing variance
No seasonality
Simulation E
Time Series Plotting
5
Analyze→ Forecasting → Sequence Charts
Data: flow.sav Reference: Computer Book 2 pp. 6-8
Time Series Plotting
6
Analyze→ Forecasting → Sequence Charts
Data: flow.sav Reference: Computer Book 2 pp. 6-8
Time Series Plotting
7
Analyze→ Forecasting → Sequence Charts
Data: flow.sav Reference: Computer Book 2 pp. 6-8
Time Series Plotting
8
Chart Editor → Select X-Axis
Data: flow.sav Reference: Computer Book 2 pp. 6-8
Time Series Plotting
9
Period-1
Chart Editor → Select X-Axis
Data: flow.sav Reference: Computer Book 2 pp. 6-8
Time Series Plotting
10
Chart Editor → Select X-Axis
Data: flow.sav Reference: Computer Book 2 pp. 6-8
Estimating Time Series Components
11
M249 Practical Modern Statistics
• Additive model• Multiplicative model• How to estimate components
• Seasonality• Trend & seasonally-adjusted• Irregular (noise)
Real life has noise.Removing the noise helps to show any underlying structures and patterns
Additive Model
12
Xt = mt + st + WtRandom variable
Additive Model
13
Xt = mt + st + WtRandom variable
Trend componentMay be zero, linear or
changing
Can plug in any estimation here
�𝑚𝑚𝑡𝑡 = 𝑀𝑀𝑀𝑀 𝑡𝑡 ; �𝑚𝑚𝑡𝑡 = 𝑆𝑆𝑀𝑀(𝑡𝑡)
Additive Model
14
Xt = mt + st + WtRandom variable
Trend componentMay be zero, linear or
changingSeasonal component
May be zero or varying periodicity
𝑌𝑌𝑡𝑡 = 𝑋𝑋𝑡𝑡 − 𝑆𝑆𝑀𝑀 𝑡𝑡 = 𝑆𝑆𝑡𝑡 + 𝑊𝑊𝑡𝑡′
Seasonal factors sum to zero�𝑠𝑠𝑗𝑗 = 𝐹𝐹𝑗𝑗 − �𝐹𝐹 for 𝑗𝑗 = [1,𝑇𝑇]
Can plug in any estimation here
�𝑚𝑚𝑡𝑡 = 𝑀𝑀𝑀𝑀 𝑡𝑡 ; �𝑚𝑚𝑡𝑡 = 𝑆𝑆𝑀𝑀(𝑡𝑡)
Additive Model
15
Xt = mt + st + WtRandom variable
Trend componentMay be zero, linear or
changingSeasonal component
May be zero or varying periodicity
Irregular componentNoise, error and everything else
𝑌𝑌𝑡𝑡 = 𝑋𝑋𝑡𝑡 − 𝑆𝑆𝑀𝑀 𝑡𝑡 = 𝑆𝑆𝑡𝑡 + 𝑊𝑊𝑡𝑡′
Seasonal factors sum to zero�𝑠𝑠𝑗𝑗 = 𝐹𝐹𝑗𝑗 − �𝐹𝐹 for 𝑗𝑗 = [1,𝑇𝑇]
𝑍𝑍𝑡𝑡 = 𝑋𝑋𝑡𝑡 − �𝑆𝑆𝑡𝑡 = 𝑚𝑚𝑡𝑡 + 𝑊𝑊𝑡𝑡′
Error usually assumed to be distributed with zero
mean and constant variance
𝑊𝑊𝑡𝑡~(0,𝜎𝜎2)Not independent
(correlogram, histogram)
Can plug in any estimation here
�𝑚𝑚𝑡𝑡 = 𝑀𝑀𝑀𝑀 𝑡𝑡 ; �𝑚𝑚𝑡𝑡 = 𝑆𝑆𝑀𝑀(𝑡𝑡)
Additive Model
16
Time index
Valu
e (a
rb)
Transformed from multiplicative model
Simulation B
Irregular componentNoise, error and everything else
Multiplicative Model
17
Xt = mt x st x WtRandom variable
Multiplicative Model
18
Xt = mt x st x WtRandom variable
Trend componentMay be constant, linear
or changing
Irregular componentNoise, error and everything else
Multiplicative Model
19
Xt = mt x st x WtRandom variable
Trend componentMay be constant, linear
or changingSeasonal component
May be zero or varying periodicity
Seasonal factors sum to 1
Irregular componentNoise, error and everything else
Multiplicative Model
20
Xt = mt x st x WtRandom variable
Trend componentMay be constant, linear
or changingSeasonal component
May be zero or varying periodicity
Seasonal factors sum to 1
Irregular componentNoise, error and everything else
𝑌𝑌𝑡𝑡 = log 𝑋𝑋𝑡𝑡= log 𝑚𝑚𝑡𝑡 × 𝑠𝑠𝑡𝑡 × 𝑊𝑊𝑡𝑡= log 𝑚𝑚𝑡𝑡 + log 𝑠𝑠𝑡𝑡 + log 𝑊𝑊𝑡𝑡
Log transformation
Multiplicative Model
21
Deconstructing A Series
22
How would you describe this time
series?
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Deconstructing A Series
23
Changing trend
Constant variance
Seasonal - annual
How would you describe this time
series?
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Deconstructing A Series – Seasonal
24
Raw data Estimated seasonal component �𝑆𝑆𝑡𝑡 Estimated trend component �𝑚𝑚𝑡𝑡 Estimated irregular component �𝑊𝑊𝑡𝑡
Analyze→ Forecasting → Seasonal Decomposition
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Deconstructing A Series – Seasonal
25
Raw data Estimated seasonal component �𝑆𝑆𝑡𝑡 Estimated trend component �𝑚𝑚𝑡𝑡 Estimated irregular component �𝑊𝑊𝑡𝑡
Analyze→ Forecasting → Seasonal Decomposition
Deconstructing A Series - Seasonal
26
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Deconstructing A Series - Seasonal
27
Seasonally-Adjusted Series
𝑍𝑍𝑡𝑡 = 𝑋𝑋𝑡𝑡 − �𝑆𝑆𝑡𝑡= 𝑚𝑚𝑡𝑡 + 𝑊𝑊𝑡𝑡
′
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Deconstructing A Series - Seasonal
28� = 1 × 10−5 ≈ 0
Seasonally-Adjusted Series
𝑍𝑍𝑡𝑡 = 𝑋𝑋𝑡𝑡 − �𝑆𝑆𝑡𝑡= 𝑚𝑚𝑡𝑡 + 𝑊𝑊𝑡𝑡
′
Seasonal Factors
�𝑆𝑆𝑗𝑗 = 𝐹𝐹𝑗𝑗 − �𝐹𝐹
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Deconstructing A Series - Seasonal
29
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Follow the book’s advice on renaming SPSS variables!
Deconstructing A Series - Trend
30
Raw data Estimated seasonal component �𝑆𝑆𝑡𝑡 Estimated trend component �𝑚𝑚𝑡𝑡 Estimated irregular component �𝑊𝑊𝑡𝑡
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Transform → Create Time Series
Deconstructing A Series - Trend
31
Raw data Estimated seasonal component �𝑆𝑆𝑡𝑡 Estimated trend component �𝑚𝑚𝑡𝑡 Estimated irregular component �𝑊𝑊𝑡𝑡
Order must be ODD
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Transform → Create Time Series
Deconstructing A Series - Trend
32
Raw data Estimated seasonal component �𝑆𝑆𝑡𝑡 Estimated trend component �𝑚𝑚𝑡𝑡 Estimated irregular component �𝑊𝑊𝑡𝑡
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Transform → Create Time Series
More informative
variable name
trend
Deconstructing A Series - Trend
33
Raw data Estimated seasonal component �𝑆𝑆𝑡𝑡 Estimated trend component �𝑚𝑚𝑡𝑡 Estimated irregular component �𝑊𝑊𝑡𝑡
Tren
d
Trend Estimate (MA(13))
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Deconstructing A Series - Irregular
34
Raw data Estimated seasonal component �𝑆𝑆𝑡𝑡 Estimated trend component �𝑚𝑚𝑡𝑡 Estimated irregular component �𝑊𝑊𝑡𝑡
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Transform → Compute Variable
Deconstructing A Series - Irregular
35
Raw data Estimated seasonal component �𝑆𝑆𝑡𝑡 Estimated trend component �𝑚𝑚𝑡𝑡 Estimated irregular component �𝑊𝑊𝑡𝑡
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Transform → Compute Variable
Deconstructing A Series
36
Irregular Component Estimate Raw data Estimated seasonal component �𝑆𝑆𝑡𝑡 Estimated trend component �𝑚𝑚𝑡𝑡 Estimated irregular component �𝑊𝑊𝑡𝑡
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Analyze→ Forecasting → Sequence Charts
Deconstructing A Series
37
Irregular Component Estimate Raw data Estimated seasonal component �𝑆𝑆𝑡𝑡 Estimated trend component �𝑚𝑚𝑡𝑡 Estimated irregular component �𝑊𝑊𝑡𝑡
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
Analyze→ Descriptive Statistics → Descriptives
Analyze→ Forecasting → Sequence Charts
Deconstructing A Series Raw data Estimated seasonal component �𝑆𝑆𝑡𝑡 Estimated trend component �𝑚𝑚𝑡𝑡 Estimated irregular component �𝑊𝑊𝑡𝑡
Unemployment Claimants
Raw claimantsSeasonally-adjusted seriesMoving average (13)
http
s://
desp
icab
lem
e.fa
ndom
.com
/wik
i/Dav
e
38
Data: claimants.sav Reference: Computer Book 2 pp. 16-20
ARMA & ARIMA models
39
M249 Practical Modern Statistics
• Model selection • Fitting a model
• Estimating parameters
• Evaluating a model• Goodness-of-fit
• Forecasting using a model• Predicting future values with prediction intervals
ARMA & ARIMA models
• Book 2 (S14, pp.115-127) goes into some detail about how to select suitable candidate ARMA and ARIMA models
• Principle of Parsimony• Correlogram and partial correlogram indications
40
ARMA & ARIMA models
• Book 2 (S14, pp.115-127) goes into some detail about how to select suitable candidate ARMA and ARIMA models
• Principle of Parsimony• Correlogram and partial correlogram indications
• Here, I’ll show how to build an ARIMA model and we’ll compare the fit of two candidates
41
ARMA & ARIMA models
• Book 2 (S14, pp.115-127) goes into some detail about how to select suitable candidate ARMA and ARIMA models
• Principle of Parsimony• Correlogram and partial correlogram indications
• Here, I’ll show how to build an ARIMA model and we’ll compare the fit of two candidates
42
ARIMA framework assumes that a time series is stationary• Constant mean, variance• The I in ARIMA covers differencing and other
methods to make the series stationary
ARIMA Model Fitting
• We’ll fit two models:• ARIMA (0,0,1): 𝑋𝑋𝑡𝑡 − 𝜇𝜇 = 𝑍𝑍𝑡𝑡 − 𝜃𝜃1𝑍𝑍𝑡𝑡−1
• ARIMA (1,0,0): 𝑋𝑋𝑡𝑡 − 𝜇𝜇 = 𝛽𝛽1 𝑋𝑋𝑡𝑡−1 − 𝜇𝜇 + 𝑍𝑍𝑡𝑡
43
ACF: 𝜌𝜌𝑞𝑞 = −𝜃𝜃11+𝜃𝜃12
ACF: 𝜌𝜌𝑘𝑘 = 𝛽𝛽1𝑘𝑘
Here we have theoreticalmodels we hope fit our
(noisy) real data
ARIMA Model Fitting
• We’ll fit two models:• ARIMA (0,0,1): 𝑋𝑋𝑡𝑡 − 𝜇𝜇 = 𝑍𝑍𝑡𝑡 − 𝜃𝜃1𝑍𝑍𝑡𝑡−1
• ARIMA (1,0,0): 𝑋𝑋𝑡𝑡 − 𝜇𝜇 = 𝛽𝛽1 𝑋𝑋𝑡𝑡−1 − 𝜇𝜇 + 𝑍𝑍𝑡𝑡
• SPSS uses Root Mean Squared Error (RMSE) as the cost function
• 𝑅𝑅𝑀𝑀𝑆𝑆𝑅𝑅 = ∑𝑖𝑖=1𝑛𝑛 𝑥𝑥𝑖𝑖− �𝑥𝑥𝑖𝑖 2
𝑛𝑛• 𝑆𝑆𝑆𝑆𝑅𝑅 = 𝑛𝑛 − 𝑑𝑑 − 𝑘𝑘 𝑅𝑅𝑀𝑀𝑆𝑆𝑅𝑅2
44
ACF: 𝜌𝜌𝑞𝑞 = −𝜃𝜃11+𝜃𝜃12
ACF: 𝜌𝜌𝑘𝑘 = 𝛽𝛽1𝑘𝑘
Here we have theoreticalmodels we hope fit our
(noisy) real data
ARIMA(0,0,1) Model Fitting
Source data is flow.sav and we’ll use the seasonally-adjusted series
45
Data: flow.sav Reference: Computer Book 2 pp. 42-55
Let’s get modelling
ARIMA(0,0,1) Model Fitting
46
Data: flow.sav Reference: Computer Book 2 pp. 42-55
Analyze→ Forecasting → Create Traditional Models
ARIMA(0,0,1) Model Fitting
47
Data: flow.sav Reference: Computer Book 2 pp. 42-55
Analyze→ Forecasting → Create Traditional Models
Set other options as shown in Computer Book 2
ARIMA(0,0,1) Model Fitting
48
Data: flow.sav Reference: Computer Book 2 pp. 42-55
𝑋𝑋𝑡𝑡 − 𝜇𝜇 = 𝑍𝑍𝑡𝑡 − 𝜃𝜃1𝑍𝑍𝑡𝑡−1
𝑋𝑋𝑡𝑡 − 1.374 = 𝑍𝑍𝑡𝑡 + 0.401𝑍𝑍𝑡𝑡−1
Goodness of fit
Parameters of fit
ARIMA(0,0,1) Model Fitting – Errors
49
For the model to be a good fit, errors should be uncorrelated and approx. Normal (0,𝜎𝜎2)
Data: flow.sav Reference: Computer Book 2 pp. 42-55
Analyse error distribution
ARIMA(0,0,1) Model Fitting – Errors
For the model to be a good fit, errors should be uncorrelated and approx. Normal (0,𝜎𝜎2)
50
Graphs → Legacy Dialogs→ HistogramAnalyze→ Descriptives → Explore → Plots
Data: flow.sav Reference: Computer Book 2 pp. 42-55
ARIMA(0,0,1) Model Fitting – Errors
For the model to be a good fit, errors should be uncorrelated and approx. Normal (0,𝜎𝜎2)
51
This is a specifictest for
Normality, and is both more
sensitive and more powerful
than K-S.Graphs → Legacy Dialogs→ HistogramAnalyze→ Descriptives → Explore → Plots
Data: flow.sav Reference: Computer Book 2 pp. 42-55
ARIMA(0,0,1) Model Fitting – Errors
52
For the model to be a good fit, errors should be uncorrelated and approx. Normal (0,𝜎𝜎2)
Analyze→ Forecasting → Autocorrelations
Data: flow.sav Reference: Computer Book 2 pp. 42-55
ARIMA(0,0,1) Model Fitting – Errors
53
For the model to be a good fit, errors should be uncorrelated and approx. Normal (0,𝜎𝜎2)
Analyze→ Forecasting → Autocorrelations
Data: flow.sav Reference: Computer Book 2 pp. 42-55
ARIMA(0,0,1) Model Fitting – Errors
54
For the model to be a good fit, errors should be uncorrelated and approx. Normal (0,𝜎𝜎2)
Analyze→ Forecasting → Autocorrelations
Data: flow.sav Reference: Computer Book 2 pp. 42-55
ARIMA(1,0,0) Model Fitting
55
Set other options as shown in Computer Book 2
Data: flow.sav Reference: Computer Book 2 pp. 42-55
ARIMA(1,0,0) Model Fitting
56
𝑋𝑋𝑡𝑡 − 𝜇𝜇 = 𝛽𝛽1 𝑋𝑋𝑡𝑡−1 − 𝜇𝜇
𝑋𝑋𝑡𝑡 − 1.373 = 0.383 𝑋𝑋𝑡𝑡−1 − 1.373 + 𝑍𝑍𝑡𝑡
Data: flow.sav Reference: Computer Book 2 pp. 42-55
ARIMA(1,0,0) Model Fitting
57
𝑋𝑋𝑡𝑡 − 𝜇𝜇 = 𝛽𝛽1 𝑋𝑋𝑡𝑡−1 − 𝜇𝜇
𝑋𝑋𝑡𝑡 − 1.373 = 0.383 𝑋𝑋𝑡𝑡−1 − 1.373 + 𝑍𝑍𝑡𝑡
Data: flow.sav Reference: Computer Book 2 pp. 42-55
Goodness of fit
Parameters of fit
ARIMA(1,0,0) Model Fitting
58
For the model to be a good fit, errors should be uncorrelated and approx. Normal (0,𝜎𝜎2)
Graphs → Legacy Dialogs→ HistogramAnalyze→ Descriptives → Explore → Plots
Data: flow.sav Reference: Computer Book 2 pp. 42-55
Analyse error distribution
ARIMA(1,0,0) Model Fitting
59
For the model to be a good fit, errors should be uncorrelated and approx. Normal (0,𝜎𝜎2)
Graphs → Legacy Dialogs→ HistogramAnalyze→ Descriptives → Explore → Plots
Data: flow.sav Reference: Computer Book 2 pp. 42-55
ARIMA(1,0,0) Model Fitting
60
For the model to be a good fit, errors should be uncorrelated and approx. Normal (0,𝜎𝜎2)
Analyze→ Forecasting → Autocorrelations
Data: flow.sav Reference: Computer Book 2 pp. 42-55
Model Comparison
61
Serial Model Parsimony(p + q) 𝜇𝜇 Parameter
2 RMSE Ljung-Box p
Error Mean
Error Normality p
A ARIMA(0,0,1) 1 1.374 -0.401 0.563 0.129 4.7x10-4 0.681
B ARIMA(1,0,0) 1 1.373 0.383 0.564 0.164 8.68x10-4 0.722
Which model do you choose – A or B?
Data: flow.sav Reference: Computer Book 2 pp. 42-55
Cautious Forecasting
62
What do all forecasting models
assume?
Cautious Forecasting
63
What do all forecasting models
assume?
All forecasting methods in this module assume that the past
is a guide to the future.
Cautious Forecasting
64
What do all forecasting models
assume?
All forecasting methods in this module assume that the past
is a guide to the future.
Past values can therefore be
used to predict future values.
Cautious Forecasting
65
What do all forecasting models
assume?
All forecasting methods in this module assume that the past
is a guide to the future.
Past values can therefore be
used to predict future values.
This is not always the case!
Forecast with ARIMA (0,0,1)
66
Quite wide prediction intervals compared to observed data variance
Data: flow.sav Reference: Computer Book 2 pp. 42-55
Forecast
Further Reading (OU Library E-books)• Time Series Analysis: Forecasting and Control
• https://pmt-eu.hosted.exlibrisgroup.com/permalink/f/gvehrt/TN_cdi_safari_books_9780470272848
• Forecasting Fundamentals• https://pmt-
eu.hosted.exlibrisgroup.com/permalink/f/h21g24/44OPN_ALMA_DS51128131320002316
• Error analysis for biologists: statistics you can understand• https://pmt-
eu.hosted.exlibrisgroup.com/permalink/f/gvehrt/TN_cdi_askewsholts_vlebooks_9781119106906
Other Resources• M249 materials
(https://learn2.open.ac.uk/course/view.php?id=208584&area=resources)
• M249 Student Forums
• Wikipedia
• CrossValidated (https://stats.stackexchange.com/ )
• SPSS help (https://www.ibm.com/uk-en/products/spss-statistics )
• YouTube – Research By Design (https://www.youtube.com/channel/UCXLbK1bH-w1oklGm4dLYrHw )
• Contact me:• [email protected]• 07311 188 800
67
Thank you! Any questions?
Recording will be available from M249-20J Online Tutorial Roomhttps://learn2.open.ac.uk/mod/connecthosted/view.php?id=1648457&group=270251
Smoothing & Forecasting
68
M249 Practical Modern Statistics
• Above, we used a simple centred moving average to estimate the trend component –this is an example of smoothing
• Other methods can be applied to an additive model without explicit decomposition• Exponential – constant trend, no seasonality• Holt – variable trend, no seasonality• Holt-Winters – variable trend with seasonality
Smoothing & Forecasting
69
M249 Practical Modern Statistics
• Above, we used a simple centred moving average to estimate the trend component –this is an example of smoothing
• Other methods can be applied to an additive model without explicit decomposition• Exponential – constant trend, no seasonality• Holt – variable trend, no seasonality• Holt-Winters – variable trend with seasonality
• Here we’ll assume that Holt-Winters is suitable for claimants.sav
• Time Series Models are straight forward but have lots of options; here I’ll show the start and end result only
Smoothing & Forecasting
70
The Holt-Winters exponential model has three parameters which are optimised automatically by SPSS:
Exponential Model: 𝑋𝑋𝑡𝑡 = 𝑚𝑚 + 𝑏𝑏𝑡𝑡 + 𝑠𝑠𝑡𝑡 + 𝑊𝑊𝑡𝑡
1-Step Ahead Forecast: �𝑥𝑥𝑡𝑡+1 = �𝑚𝑚𝑡𝑡 + �𝑏𝑏 + �𝑠𝑠𝑡𝑡+1
Smoothing & Forecasting
71
The Holt-Winters exponential model has three parameters which are optimised automatically by SPSS:
Exponential Model: 𝑋𝑋𝑡𝑡 = 𝑚𝑚 + 𝑏𝑏𝑡𝑡 + 𝑠𝑠𝑡𝑡 + 𝑊𝑊𝑡𝑡
1-Step Ahead Forecast: �𝑥𝑥𝑡𝑡+1 = �𝑚𝑚𝑡𝑡 + �𝑏𝑏 + �𝑠𝑠𝑡𝑡+1
Parameter Function Initial Value
𝛼𝛼 Level 𝑥𝑥1
𝛾𝛾 Slope 0 𝑜𝑜𝑜𝑜𝑥𝑥𝑡𝑡+1 − 𝑥𝑥1
𝑇𝑇
𝛿𝛿 Seasonal component adjustment 𝑆𝑆𝑗𝑗 = 𝐹𝐹𝑗𝑗 − �𝐹𝐹
𝛼𝛼, 𝛾𝛾, 𝛿𝛿 ∈ 0,1 3
Smoothing & Forecasting
72
The Holt-Winters exponential model has three parameters which are optimised automatically by SPSS:
Exponential Model: 𝑋𝑋𝑡𝑡 = 𝑚𝑚 + 𝑏𝑏𝑡𝑡 + 𝑠𝑠𝑡𝑡 + 𝑊𝑊𝑡𝑡
1-Step Ahead Forecast: �𝑥𝑥𝑡𝑡+1 = �𝑚𝑚𝑡𝑡 + �𝑏𝑏 + �𝑠𝑠𝑡𝑡+1
Parameter Function Initial Value
𝛼𝛼 Level 𝑥𝑥1
𝛾𝛾 Slope 0 𝑜𝑜𝑜𝑜𝑥𝑥𝑡𝑡+1 − 𝑥𝑥1
𝑇𝑇
𝛿𝛿 Seasonal component adjustment 𝑆𝑆𝑗𝑗 = 𝐹𝐹𝑗𝑗 − �𝐹𝐹
𝛼𝛼, 𝛾𝛾, 𝛿𝛿 ∈ 0,1 30 1
Little weight on recent observations
Most weight on recent observations
Smoothing & Forecasting
73
The Holt-Winters exponential model has three parameters which are optimised automatically by SPSS:
Exponential Model: 𝑋𝑋𝑡𝑡 = 𝑚𝑚 + 𝑏𝑏𝑡𝑡 + 𝑠𝑠𝑡𝑡 + 𝑊𝑊𝑡𝑡
1-Step Ahead Forecast: �𝑥𝑥𝑡𝑡+1 = �𝑚𝑚𝑡𝑡 + �𝑏𝑏 + �𝑠𝑠𝑡𝑡+1
Parameter Function Initial Value
𝛼𝛼 Level 𝑥𝑥1
𝛾𝛾 Slope 0 𝑜𝑜𝑜𝑜𝑥𝑥𝑡𝑡+1 − 𝑥𝑥1
𝑇𝑇
𝛿𝛿 Seasonal component adjustment 𝑆𝑆𝑗𝑗 = 𝐹𝐹𝑗𝑗 − �𝐹𝐹
𝛼𝛼, 𝛾𝛾, 𝛿𝛿 ∈ 0,1 30 1
Little weight on recent observations
Most weight on recent observations
SPSS deals with all of this automatically!
Smoothing & Forecasting – Holt-Winters
74
Data: claimants.sav Reference: Computer Book 2 pp. 33-37
Analyze→ Forecasting → Create Traditional Models
Smoothing & Forecasting – Holt-Winters
75
Data: claimants.sav Reference: Computer Book 2 pp. 33-37
Analyze→ Forecasting → Create Traditional Models
Simple Forecasting
76
Claimant numbers with 12 month forecast
Data: claimants.sav Reference: Computer Book 2 pp. 33-37
Simple Forecasting
77
Claimant numbers with 12 month forecast
Data: claimants.sav Reference: Computer Book 2 pp. 33-37
Simple Forecasting
78
Claimant numbers with 12 month forecast
Hmmm.. H0 for Ljung-Box is that there is zerocorrelation between errors. This p-value suggeststhat this model may not be the best for the data
Data: claimants.sav Reference: Computer Book 2 pp. 33-37
Forecasting & Errors
79
Actual claimant numbers with 12 month forecast
Clai
man
ts
Month
Visually, the forecast looks pretty close to reality, even up to 12 months out.
Data: claimants.sav Reference: Computer Book 2 pp. 33-37
Forecasting & Errors
80
Actual claimant numbers with 12 month forecast
Clai
man
ts
Month
Visually, the forecast looks pretty close to reality, even up to 12 months out.
How can we objectively assess different models?
Data: claimants.sav Reference: Computer Book 2 pp. 33-37
Forecasting & Errors
81
Actual claimant numbers with 12 month forecast
Clai
man
ts
Month
Visually, the forecast looks pretty close to reality, even up to 12 months out.
How can we objectively assess different models?
1. Compare cost (error or loss) functiona. SPSS uses RMSEb. SSE also in the materials
2. Examine error correlogram3. Examine histogram of errors
More to come on this later
Data: claimants.sav Reference: Computer Book 2 pp. 33-37