SlideShare a Scribd company logo
1 of 26
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
Example - Monthly International
Airline Passengers
Source: Time Series Analysis: Forecasting and Control by Box and Jenkins (1976)
2
Example – Human
Electrocardiogram (ECG)
Source: Time Series Analysis by N. Janson
3
time
voltage ~ 1 sec
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
Time-Series Components
5
Time Series
Cyclical
Component
Irregular
Component
Trend
Component
Seasonal
Component
Overall,
persistent, long-
term movement
Regular periodic
fluctuations,
usually within a
day or 12-month
period
Repeating swings
or movements
over more than
one year
Erratic or residual
fluctuations
Trend Component
6
Sales
Time
Downward linear trend
Sales
Time
Upward nonlinear trend
Time
Sales
Seasonal Component
7
Sales
Time (Quarterly)
Winter
Spring
Summer
Fall
Winter
Spring
Summer
Fall
Cyclical Component
8
Sales
1 Cycle
Year
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
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
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
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
Example – Natural Gas Usage
13
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
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
Example – Annual Data
16
Year Sales
1
2
3
4
5
6
7
8
9
10
11
etc…
23
40
25
27
32
48
33
37
37
50
40
etc…
Annual Sales
0
10
20
30
40
50
60
1 2 3 4 5 6 7 8 9 10 11
Year
Sales
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





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
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
Error Metrics to Compare
Forecasts
20
Mean Absolute Deviation Root Mean Squared Error
Mean Squared Error Mean absolute % Error
Linear Trends Forecasting
21
Double Exponential Smoothing of Coal
Production data 1960-2007
Linear Regression of Coal Production data
X
b
b
Ŷ 1
0 

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
Capturing Seasonality & Trend
23
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
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
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

More Related Content

Similar to Time Series Analysis and Forecasting in Practice

Managerial_Economics_Ch4_1.ppt
Managerial_Economics_Ch4_1.pptManagerial_Economics_Ch4_1.ppt
Managerial_Economics_Ch4_1.pptAbhishekModak17
 
Managerial_Economics_Ch4_1 (1).ppt
Managerial_Economics_Ch4_1 (1).pptManagerial_Economics_Ch4_1 (1).ppt
Managerial_Economics_Ch4_1 (1).pptAbhishekModak17
 
Forecasting
ForecastingForecasting
Forecasting3abooodi
 
Time Series Analysis.pptx
Time Series Analysis.pptxTime Series Analysis.pptx
Time Series Analysis.pptxSunny429247
 
Wavelet Multi-resolution Analysis of High Frequency FX Rates
Wavelet Multi-resolution Analysis of High Frequency FX RatesWavelet Multi-resolution Analysis of High Frequency FX Rates
Wavelet Multi-resolution Analysis of High Frequency FX RatesaiQUANT
 
Lesson08_static11
Lesson08_static11Lesson08_static11
Lesson08_static11thangv
 
OPM101Chapter.ppt
OPM101Chapter.pptOPM101Chapter.ppt
OPM101Chapter.pptVasudevPur
 
Lesson08_new
Lesson08_newLesson08_new
Lesson08_newshengvn
 
MACROECONOMICS-CH9
MACROECONOMICS-CH9MACROECONOMICS-CH9
MACROECONOMICS-CH9kkjjkevin03
 
Enterprise_Planning_TimeSeries_And_Components
Enterprise_Planning_TimeSeries_And_ComponentsEnterprise_Planning_TimeSeries_And_Components
Enterprise_Planning_TimeSeries_And_Componentsnanfei
 
Making Sense of Metering Data
Making Sense of Metering DataMaking Sense of Metering Data
Making Sense of Metering DataCharles Simchick
 
2 session 2a_hp case study_2010_cfvg
2 session 2a_hp case study_2010_cfvg2 session 2a_hp case study_2010_cfvg
2 session 2a_hp case study_2010_cfvgkimsach
 

Similar to Time Series Analysis and Forecasting in Practice (20)

Managerial_Economics_Ch4_1.ppt
Managerial_Economics_Ch4_1.pptManagerial_Economics_Ch4_1.ppt
Managerial_Economics_Ch4_1.ppt
 
Managerial_Economics_Ch4_1 (1).ppt
Managerial_Economics_Ch4_1 (1).pptManagerial_Economics_Ch4_1 (1).ppt
Managerial_Economics_Ch4_1 (1).ppt
 
Forecasting
ForecastingForecasting
Forecasting
 
Time Series Analysis.pptx
Time Series Analysis.pptxTime Series Analysis.pptx
Time Series Analysis.pptx
 
Models Of The Short Rate
Models Of The  Short  RateModels Of The  Short  Rate
Models Of The Short Rate
 
Wavelet Multi-resolution Analysis of High Frequency FX Rates
Wavelet Multi-resolution Analysis of High Frequency FX RatesWavelet Multi-resolution Analysis of High Frequency FX Rates
Wavelet Multi-resolution Analysis of High Frequency FX Rates
 
Chapter-3_Heizer_S1.pptx
Chapter-3_Heizer_S1.pptxChapter-3_Heizer_S1.pptx
Chapter-3_Heizer_S1.pptx
 
Lesson08_static11
Lesson08_static11Lesson08_static11
Lesson08_static11
 
Samba0804
Samba0804Samba0804
Samba0804
 
forecasting.pptx
forecasting.pptxforecasting.pptx
forecasting.pptx
 
OPM101Chapter.ppt
OPM101Chapter.pptOPM101Chapter.ppt
OPM101Chapter.ppt
 
Multivariate analysis
Multivariate analysisMultivariate analysis
Multivariate analysis
 
Lesson08_new
Lesson08_newLesson08_new
Lesson08_new
 
SRAS SFLS
SRAS SFLSSRAS SFLS
SRAS SFLS
 
MACROECONOMICS-CH9
MACROECONOMICS-CH9MACROECONOMICS-CH9
MACROECONOMICS-CH9
 
Demand forecasting
Demand forecastingDemand forecasting
Demand forecasting
 
Demand forecasting.
Demand forecasting.Demand forecasting.
Demand forecasting.
 
Enterprise_Planning_TimeSeries_And_Components
Enterprise_Planning_TimeSeries_And_ComponentsEnterprise_Planning_TimeSeries_And_Components
Enterprise_Planning_TimeSeries_And_Components
 
Making Sense of Metering Data
Making Sense of Metering DataMaking Sense of Metering Data
Making Sense of Metering Data
 
2 session 2a_hp case study_2010_cfvg
2 session 2a_hp case study_2010_cfvg2 session 2a_hp case study_2010_cfvg
2 session 2a_hp case study_2010_cfvg
 

More from Dilum Bandara

Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine LearningDilum Bandara
 
Introduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCAIntroduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCADilum Bandara
 
Introduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive AnalyticsIntroduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive AnalyticsDilum Bandara
 
Introduction to Concurrent Data Structures
Introduction to Concurrent Data StructuresIntroduction to Concurrent Data Structures
Introduction to Concurrent Data StructuresDilum Bandara
 
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-MatrixHard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-MatrixDilum Bandara
 
Introduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with HadoopIntroduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with HadoopDilum Bandara
 
Embarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel ProblemsEmbarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel ProblemsDilum Bandara
 
Introduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale ComputersIntroduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale ComputersDilum Bandara
 
Introduction to Thread Level Parallelism
Introduction to Thread Level ParallelismIntroduction to Thread Level Parallelism
Introduction to Thread Level ParallelismDilum Bandara
 
CPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching TechniquesCPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching TechniquesDilum Bandara
 
Data-Level Parallelism in Microprocessors
Data-Level Parallelism in MicroprocessorsData-Level Parallelism in Microprocessors
Data-Level Parallelism in MicroprocessorsDilum Bandara
 
Instruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware TechniquesInstruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware TechniquesDilum Bandara
 
Instruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler TechniquesInstruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler TechniquesDilum Bandara
 
CPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An IntroductionCPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An IntroductionDilum Bandara
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
High Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPHigh Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPDilum Bandara
 
Introduction to Content Delivery Networks
Introduction to Content Delivery NetworksIntroduction to Content Delivery Networks
Introduction to Content Delivery NetworksDilum Bandara
 
Peer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and StreamingPeer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and StreamingDilum Bandara
 
Wired Broadband Communication
Wired Broadband CommunicationWired Broadband Communication
Wired Broadband CommunicationDilum Bandara
 

More from Dilum Bandara (20)

Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 
Introduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCAIntroduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCA
 
Introduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive AnalyticsIntroduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive Analytics
 
Introduction to Concurrent Data Structures
Introduction to Concurrent Data StructuresIntroduction to Concurrent Data Structures
Introduction to Concurrent Data Structures
 
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-MatrixHard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
 
Introduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with HadoopIntroduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with Hadoop
 
Embarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel ProblemsEmbarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel Problems
 
Introduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale ComputersIntroduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale Computers
 
Introduction to Thread Level Parallelism
Introduction to Thread Level ParallelismIntroduction to Thread Level Parallelism
Introduction to Thread Level Parallelism
 
CPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching TechniquesCPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching Techniques
 
Data-Level Parallelism in Microprocessors
Data-Level Parallelism in MicroprocessorsData-Level Parallelism in Microprocessors
Data-Level Parallelism in Microprocessors
 
Instruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware TechniquesInstruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware Techniques
 
Instruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler TechniquesInstruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler Techniques
 
CPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An IntroductionCPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An Introduction
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
High Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPHigh Performance Networking with Advanced TCP
High Performance Networking with Advanced TCP
 
Introduction to Content Delivery Networks
Introduction to Content Delivery NetworksIntroduction to Content Delivery Networks
Introduction to Content Delivery Networks
 
Peer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and StreamingPeer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and Streaming
 
Mobile Services
Mobile ServicesMobile Services
Mobile Services
 
Wired Broadband Communication
Wired Broadband CommunicationWired Broadband Communication
Wired Broadband Communication
 

Recently uploaded

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 

Recently uploaded (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 

Time Series Analysis and Forecasting in Practice

  • 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
  • 3. Example – Human Electrocardiogram (ECG) Source: Time Series Analysis by N. Janson 3 time voltage ~ 1 sec
  • 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
  • 5. Time-Series Components 5 Time Series Cyclical Component Irregular Component Trend Component Seasonal Component Overall, persistent, long- term movement Regular periodic fluctuations, usually within a day or 12-month period Repeating swings or movements over more than one year Erratic or residual fluctuations
  • 6. Trend Component 6 Sales Time Downward linear trend Sales Time Upward nonlinear trend Time Sales
  • 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
  • 13. Example – Natural Gas Usage 13
  • 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
  • 16. Example – Annual Data 16 Year Sales 1 2 3 4 5 6 7 8 9 10 11 etc… 23 40 25 27 32 48 33 37 37 50 40 etc… Annual Sales 0 10 20 30 40 50 60 1 2 3 4 5 6 7 8 9 10 11 Year Sales
  • 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