1. Time Series Analysis
& Forecasting
CS5122 DESCRIPTIVE & PREDICTIVE ANALYTICS
DILUM BANDARA
DILUM.BANDARA@UOM.LK
Some slides adapted from business analytics: Methods, models, and
decisions, 1st edition by James R. Evans
2. Example - Monthly International
Airline Passengers
Source: Time Series Analysis: Forecasting and Control by Box and Jenkins (1976)
2
4. System, Process, & Signal
Source: Time Series Analysis by N. Janson
A collection of observations of state variables made sequentially in time
◦ Can be Univariate, Bivariate, or Multivariate
4
System
State variable 1
State variable 2
Signals
9. Forecasting
Managers require good forecasts of future event(s)
Business Analysts may choose from a wide range of
forecasting techniques to support decision making
3 major forecasting approaches
1. Qualitative & judgmental techniques
2. Statistical time-series models
3. Explanatory/causal models
9
10. 3 Major Forecasting Approaches
Used when historical data are
unavailable
Considered highly subjective and
judgmental
Common Approaches to
Forecasting
Causal
Quantitative forecasting methods
Qualitative forecasting methods
Time Series
Use past data to predict future
values
10
11. Qualitative & Judgmental
Forecasting
Rely on experience & intuition
They are necessary when historical data is not
available or when predictions are needed far into
the future
Historical analogy approach obtains a forecast
through comparative analysis with prior situations
Delphi method questions an anonymous panel of
experts 2-3 times in order to reach a convergence of
opinion on forecasted variable
11
12. Example – Predicting Price of
Oil
Early 1988 – oil price was about $22 a barrel
Mid-1988 – oil price dropped to $11 a barrel
Price decrease due to oversupply/lower demand
OPEC eventually reduced supply
In 2000 – price rose to $27
Late 2001 – price dropped to $23
12
14. Statistical Forecasting Models
Simple Models
1. Simple Moving Average (SMA)
2. Simple Exponential Smoothing
Time Series with Linear Trends
1. Double moving average
2. Double exponential smoothing
3. Simple linear regression
These are based on the linear trend equation Ft+k = at + bt k
Forecast for k periods into the future is a function of level at and
the trend bt
Models differ in their computations of at and bt
14
15. Simple Moving Average (SMA)
Method
A smoothing method
Averages random fluctuations in a times series
Assumes future observations will be similar to the recent past
A k-period (window) moving average averages the most recent k
observations
Larger k results in smoother forecast models
15
17. Example – Annual Data (Cont.)
17
Each moving average is for a consecutive block
of 5 years
Year Sales
1 23
2 40
3 25
4 27
5 32
6 48
7 33
8 37
9 37
10 50
11 40
Average
Year
5-Year
Moving
Average
3 29.4
4 34.4
5 33.0
6 35.4
7 37.4
8 41.0
9 39.4
… …
5
5
4
3
2
1
3
5
32
27
25
40
23
29.4
18. Example – Annual Data (Cont.)
5-year moving average smoothers data & makes it easier to
see the underlying trend
18
Annual vs. 5-Year Moving Average
0
10
20
30
40
50
60
1 2 3 4 5 6 7 8 9 10 11
Year
Sales
Annual 5-Year Moving Average
19. Simple Exponential Smoothing
Method
α – smoothing constant between 0 and 1
α close to 0 – biased to past, capture long-term
trend
α close to 1 – biased to present, respond quickly
19
20. Error Metrics to Compare
Forecasts
20
Mean Absolute Deviation Root Mean Squared Error
Mean Squared Error Mean absolute % Error
21. Linear Trends Forecasting
21
Double Exponential Smoothing of Coal
Production data 1960-2007
Linear Regression of Coal Production data
X
b
b
Ŷ 1
0
22. Forecasting Models with
Seasonality
1. Linear Regression using dummy variables
2. Holt-Winters models
1. Additive – stable seasonality
2. Multiplicative – amplitude changes over time
3 parameters are use to smooth:
level, α
trend, β
seasonality, γ
22
Forecasting Natural Gas Usage Using Holt-Winters No-Trend Model
24. Autoregressive Modeling
Takes advantage of autocorrelation
◦ 1st order - correlation between consecutive values
◦ 2nd order - correlation between values 2 periods apart
pth order Autoregressive model
24
i
p
-
i
p
2
-
i
2
1
-
i
1
0
i Y
A
Y
A
Y
A
A
Y δ
Random Error
25. Forecasting with
Causal Variables
Sales of fuel is influenced by fuel price
Predict gasoline sales using both time & price per gallon
◦ Price per gallon is a causal variable
◦ Causal or explanatory variables may influence the time series
25
26. Forecasting in Practice
Judgmental & Qualitative methods are used for forecasting
sales of product lines & broad company & industry
forecasts.
Simple time-series models are used for short- & medium-
range forecasts.
Regression methods are typically used for long-term
forecasts
Beware of:
◦ Assuming mechanism that governs the time series behavior in the past will
still hold in the future
◦ Using mechanical extrapolation of trend to forecast future without
considering personal judgments, business experiences, changing
technologies, & habits
26