SlideShare a Scribd company logo
1 of 55
Download to read offline
Jeffrey Yau
Chief Data Scientist, AllianceBernstein, L.P.
Lecturer, UC Berkeley Masters of Information Data
Science
Time Series Forecasting Using
Recurrent Neural Network and
Vector Autoregressive Model
Motivation - Why MTSA?
2
Daily Interest Rates
Days
InterestRates
Agenda
Section I: Time series forecasting problem formulation
Section II: Multivariate (vs. univariate) time series
forecasting
Section III: Two (of the many) approaches to this problem:
– Vector Autoregressive (VAR) Models
– Long Short Term Memory (LSTM) Network
• Formulation
• Implementation
Section IV: Comparison of the two approaches
Section V: A few words on Spark Implementation
3
Section I
• Time series forecasting problem formulation
• Multivariate (vs. univariate) time series forecasting
• Two (of the many) approaches to this problem:
– Vector Autoregressive (VAR) Models
– Long Short Term Memory (LSTM) Network
• Formulation
• Implementation
• Comparison of the two approaches
• A few words on Spark Implementation
4
Forecasting: Problem Formulation
• Forecasting: predicting the future values of the series
using current information set
• Current information set consists of current and past
values of the series and other exogenous series
5
Time Series Forecasting Requires Models
7
A statistical model or a
machine learning
algorithm
Information Set:
Forecast
horizon: h
What models?
9
A model, f(), could be as simple as “a rule” - naive model:
The forecast for tomorrow is the observed value today
Forecast
horizon: h=1
Information Set:
“Rolling” Average Model
10
It could be a slightly more complicated model
The forecast for time t+1 is an average of the observed
values from a predefined, past k time periods
Forecast horizon: h=1 Information Set:
More Sophisticated Model
11
… but there are other, more sophisticated model that
utilize the information set much more efficiently and aim
at optimizing some metrics
Section II
• Time series forecasting problem formulation
• Multivariate (vs. univariate) time series forecasting
• Two (of the many) approaches to this problem:
– Vector Autoregressive (VAR) Models
– Long Short Term Memory (LSTM) Network
• Formulation
• Implementation
• Comparison of the two approaches
• A few words on Spark Implementation
12
Univariate Time Series Models
Statistical relationship is unidirectional
13
values from its own series
exogenous seriesDynamics of series y
Autoregressive Integrated Moving Average
(ARIMA) Model
14
values from the series shocks / “error” terms exogenous series
Limitation: cannot model cross equation dynamics (or
cross series dependency)
Multivariate Time Series Modeling
15
Kequations
lag-1 of the K series
lag-p of the K series
exogenous series
Dynamics of each of the series Interdependence among the series
Section III.A
• Time series forecasting problem formulation
• Multivariate (vs. univariate) time series forecasting
• Two (of the many) approaches to this problem:
– Vector Autoregressive (VAR) Models
– Long Short Term Memory (LSTM) Network
• Formulation
• Implementation
• Comparison of the two approaches
• A few words on Spark Implementation
16
Joint Modeling of Multiple Time Series
17
● a system of linear equations of the K series being
modeled
● only applies to stationary series
● non-stationary series can be transformed into
stationary ones using simple differencing (note: if the
series are not co-integrated, then we can still apply
VAR ("VAR in differences"))
Vector Autoregressive (VAR) Models
18
Vector Autoregressive (VAR) Model of
Order 1
19
K series 1-lag each
AsystemofKequations
General Steps to Build VAR Model
20
1. Load the series
2. Train/validation/test split the series
3. Conduct exploratory time series data analysis on the training set
4. Determine if the series are stationary
5. Transform the series
6. Build a model on the transformed series
7. Model diagnostic
8. Model selection (based on some pre-defined criterion)
9. Conduct forecast using the final, chosen model
10. Inverse-transform the forecast
11. Conduct forecast evaluation
Iterative
ETSDA - Index of Consumer Sentiment
21
autocorrelation function
(ACF) graph
Partial autocorrelation
function (PACF) graph
ETSDA - Beer Consumption Series
22
Autocorrelation function
Transforming the Series
23
Take the simple-difference of the natural logarithmic transformation of
the series
note: difference-transformation
generates missing values
ETSDA on the Transformed Series
24
Is the method we propose capable of answering the following questions?
● What are the dynamic properties of these series? Own lagged
coefficients
● How are these series interact, if at all? Cross-series lagged coefficients
VAR Model Proposed
25
VAR Model Estimation and Output
26
VAR Model Output - Estimated Coefficients
27put your #assignedhashtag here by setting the footer in view-header/footer
VAR Model Output - Var-Covar Matrix
28
VAR Model Diagnostic
29
UMCSENT Beer
VAR Model Selection
30
Model selection, in the case of VAR(p), is the choice of the order and
the specification of each equation
Information criterion can be used for model selection:
VAR Model - Inverse Transform
31
Don’t forget to inverse-transform the forecasted series!
VAR Model - Forecast Using the Model
32
The Forecast Equation:
VAR Model Forecast
33
where T is the last observation period and l is the lag
What do the result mean in this context?
34
Don’t forget to put the result in the existing context!
Section III.B
• Time series forecasting problem formulation
• Multivariate (vs. univariate) time series forecasting
• Two (of the many) approaches to this problem:
– Vector Autoregressive (VAR) Models
– Long Short Term Memory (LSTM) Network
• Formulation
• Implementation
• Comparison of the two approaches
• A few words on Spark Implementation
35
Standard feed-forward network
36
• network architecture does
not have "memory" built in
• inputs are processed
independently
• no “device” to keep the past
information
Vanilla Recurrent Neural Network (RNN)
37
A structure that can retain past information, track the state of the
world, and update the state of the world as the network moves forward
Limitation of Vanilla RNN Architecture
38
Exploding (and vanishing) gradient problems
(Sepp Hochreiter, 1991 Diploma Thesis)
Long Short Term Memory (LSTM) Network
39
LSTM: Hochreiter and Schmidhuber (1997)
40
The architecture of memory cells and gate units from the original
Hochreiter and Schmidhuber (1997) paper
LSTM
41
Another representation of the architecture of memory cells and gate
units: Greff, Srivastava, Koutnık, Steunebrink, Schmidhuber (2016)
(Vanilla) LSTM: 1-minute Overview
42
Chris Colah’s blog gives an excellent introduction to vanilla RNN and LSTM:
http://colah.github.io/posts/2015-08-Understanding-LSTMs/#fnref1
•
Use memory cells and gated units to information flow
LSTM Memory
Cell
ht-1 h
t
Training uses Backward Propagation Through Time (BPTT)
memory cell (state)
hidden state
current input
output gate
forget gate
input gate
Implementation in Keras
Some steps to highlight:
• Formulate the series for a RNN supervised learning regression problem
(i.e. (Define target and input tensors)
• Scale all the series
• Define the (initial) architecture of the LSTM Model
○ Define a network of layers that maps your inputs to your targets and
the complexity of each layer (i.e. number of neurons)
○ Configure the learning process by picking a loss function, an
optimizer, and metrics to monitor
• Produce the forecasts and then reverse-scale the forecasted series
• Calculate loss metrics (e.g. RMSE, MAE)
43
Note that stationarity, as defined previously, is not a requirement
Consumer Sentiment and Housing Starts
44
LSTM Architecture Design and Training -
A Simple Illustration
45
LSTM: Forecast Results (1)
46
Monthly series:
● Training set: 1981 Jan - 2016 Dec
● Test set: 2017 Jan to 2018 Apr
LSTM: Forecast vs Observed Series
47
Housing Stars Consumer Sentiment
Section IV
• Time series forecasting problem formulation
• Multivariate (vs. univariate) time series forecasting
• Two (of the many) approaches to this problem:
– Vector Autoregressive (VAR) Models
– Long Short Term Memory (LSTM) Network
• Formulation
• Implementation
• Comparison of the two approaches
• A few words on Spark Implementation
48put your #assignedhashtag here by setting the footer in view-header/footer
VAR vs. LSTM: Data Type
macroeconomic time
series, financial time
series, business time
series, and other numeric
series
49
images, texts, all the
numeric time series (that
can be modeled by VAR)
VAR LSTM
layers of non-linear
transformations of input
series
VAR vs. LSTM: Parametric form
a linear system of
equations - highly
parameterized
50
VAR LSTM
• not require
stationarity
VAR vs. LSTM: Stationarity Requirement
• applied to stationary
time series only
• its variant (e.g. Vector
Error Correction
Model) can be applied
to co-integrated series
51
VAR LSTM
• data preprocessing is a
lot more involved
• model training and
hyper-parameter
tuning are time
consuming
VAR vs. LSTM: Model Implementation
• data preprocessing is
straight-forward
• model training time is
fast
52
VAR LSTM
Section IV
• Time series forecasting problem formulation
• Multivariate (vs. univariate) time series forecasting
• Two (of the many) approaches to this problem:
– Vector Autoregressive (VAR) Models
– Long Short Term Memory (LSTM) Network
• Formulation
• Implementation
• Comparison of the two approaches
• A few words on Spark Implementation
53put your #assignedhashtag here by setting the footer in view-header/footer
Implementation using Spark
54
Straightforward to use Spark for all the steps (outlined above) up to model
training, such as ...
Ordering in the series matterWait … Not So Fast!
Flint: A Time Series Library for Spark
55
Need time-series aware libraries whose operations preserve the natural
order of the series, such as Flint, open sourced by TwoSigma
(https://github.com/twosigma/flint)
- can handle a variety of datafile types, manipulate and aggregate time
series, and provide time-series-specific functions, such as (time-series)
join, (time-series) filtering, time-based windowing, cycles, and
intervalizing)
Example: Defining a moving average of the beer consumption series
A Few Words on TSA Workflow in Spark
56
Load, pre-process, analyze,
transform series using
time-series aware libraries
Conduct Hyperparameter
Tuning in a distributed
model and use Spark ML
Pipeline
Thank You!
57

More Related Content

What's hot

What is ARIMAX Forecasting and How is it Used for Enterprise Analysis?
What is ARIMAX Forecasting and How is it Used for Enterprise Analysis?What is ARIMAX Forecasting and How is it Used for Enterprise Analysis?
What is ARIMAX Forecasting and How is it Used for Enterprise Analysis?Smarten Augmented Analytics
 
Lesson 5 arima
Lesson 5 arimaLesson 5 arima
Lesson 5 arimaankit_ppt
 
IRJET- Future Stock Price Prediction using LSTM Machine Learning Algorithm
IRJET-  	  Future Stock Price Prediction using LSTM Machine Learning AlgorithmIRJET-  	  Future Stock Price Prediction using LSTM Machine Learning Algorithm
IRJET- Future Stock Price Prediction using LSTM Machine Learning AlgorithmIRJET Journal
 
Deep Learning for Time Series Data
Deep Learning for Time Series DataDeep Learning for Time Series Data
Deep Learning for Time Series DataArun Kejariwal
 
Stock Price Prediction PPT
Stock Price Prediction  PPTStock Price Prediction  PPT
Stock Price Prediction PPTPrashantGanji4
 
Machine Learning Strategies for Time Series Prediction
Machine Learning Strategies for Time Series PredictionMachine Learning Strategies for Time Series Prediction
Machine Learning Strategies for Time Series PredictionGianluca Bontempi
 
A brief introduction of Artificial neural network by example
A brief introduction of Artificial neural network by exampleA brief introduction of Artificial neural network by example
A brief introduction of Artificial neural network by exampleMrinmoy Majumder
 
Arima model (time series)
Arima model (time series)Arima model (time series)
Arima model (time series)Kumar P
 
Time-series Analysis in Minutes
Time-series Analysis in MinutesTime-series Analysis in Minutes
Time-series Analysis in MinutesOrzota
 
Time series predictions using LSTMs
Time series predictions using LSTMsTime series predictions using LSTMs
Time series predictions using LSTMsSetu Chokshi
 
Time series project report report
Time series project report reportTime series project report report
Time series project report reportJaideep Adusumelli
 
Arima model
Arima modelArima model
Arima modelJassika
 
Detection and recognition of face using neural network
Detection and recognition of face using neural networkDetection and recognition of face using neural network
Detection and recognition of face using neural networkSmriti Tikoo
 
Exponential smoothing
Exponential smoothingExponential smoothing
Exponential smoothingJairo Moreno
 
Forecasting exponential smoothing
Forecasting exponential smoothingForecasting exponential smoothing
Forecasting exponential smoothingDoiyan
 

What's hot (20)

Time series Forecasting
Time series ForecastingTime series Forecasting
Time series Forecasting
 
Seasonal ARIMA
Seasonal ARIMASeasonal ARIMA
Seasonal ARIMA
 
What is ARIMAX Forecasting and How is it Used for Enterprise Analysis?
What is ARIMAX Forecasting and How is it Used for Enterprise Analysis?What is ARIMAX Forecasting and How is it Used for Enterprise Analysis?
What is ARIMAX Forecasting and How is it Used for Enterprise Analysis?
 
Lesson 5 arima
Lesson 5 arimaLesson 5 arima
Lesson 5 arima
 
IRJET- Future Stock Price Prediction using LSTM Machine Learning Algorithm
IRJET-  	  Future Stock Price Prediction using LSTM Machine Learning AlgorithmIRJET-  	  Future Stock Price Prediction using LSTM Machine Learning Algorithm
IRJET- Future Stock Price Prediction using LSTM Machine Learning Algorithm
 
Time series
Time seriesTime series
Time series
 
Deep Learning for Time Series Data
Deep Learning for Time Series DataDeep Learning for Time Series Data
Deep Learning for Time Series Data
 
Machine learning & Time Series Analysis
Machine learning & Time Series AnalysisMachine learning & Time Series Analysis
Machine learning & Time Series Analysis
 
Stock Price Prediction PPT
Stock Price Prediction  PPTStock Price Prediction  PPT
Stock Price Prediction PPT
 
Machine Learning Strategies for Time Series Prediction
Machine Learning Strategies for Time Series PredictionMachine Learning Strategies for Time Series Prediction
Machine Learning Strategies for Time Series Prediction
 
A brief introduction of Artificial neural network by example
A brief introduction of Artificial neural network by exampleA brief introduction of Artificial neural network by example
A brief introduction of Artificial neural network by example
 
Arima model (time series)
Arima model (time series)Arima model (time series)
Arima model (time series)
 
Time-series Analysis in Minutes
Time-series Analysis in MinutesTime-series Analysis in Minutes
Time-series Analysis in Minutes
 
Time series predictions using LSTMs
Time series predictions using LSTMsTime series predictions using LSTMs
Time series predictions using LSTMs
 
Time series project report report
Time series project report reportTime series project report report
Time series project report report
 
Arima model
Arima modelArima model
Arima model
 
Detection and recognition of face using neural network
Detection and recognition of face using neural networkDetection and recognition of face using neural network
Detection and recognition of face using neural network
 
Exponential smoothing
Exponential smoothingExponential smoothing
Exponential smoothing
 
Forecasting exponential smoothing
Forecasting exponential smoothingForecasting exponential smoothing
Forecasting exponential smoothing
 
Timeseries forecasting
Timeseries forecastingTimeseries forecasting
Timeseries forecasting
 

Similar to Time Series Forecasting Using Recurrent Neural Network and Vector Autoregressive Model: When and How with Jeffrey Yau

Power System Simulation: History, State of the Art, and Challenges
Power System Simulation: History, State of the Art, and ChallengesPower System Simulation: History, State of the Art, and Challenges
Power System Simulation: History, State of the Art, and ChallengesLuigi Vanfretti
 
Wanted!: Open M&S Standards and Technologies for the Smart Grid - Introducing...
Wanted!: Open M&S Standards and Technologies for the Smart Grid - Introducing...Wanted!: Open M&S Standards and Technologies for the Smart Grid - Introducing...
Wanted!: Open M&S Standards and Technologies for the Smart Grid - Introducing...Luigi Vanfretti
 
Co-Simulation Interfacing Capabilities in Device-Level Power Electronic Circu...
Co-Simulation Interfacing Capabilities in Device-Level Power Electronic Circu...Co-Simulation Interfacing Capabilities in Device-Level Power Electronic Circu...
Co-Simulation Interfacing Capabilities in Device-Level Power Electronic Circu...IJPEDS-IAES
 
Presentation vision transformersppt.pptx
Presentation vision transformersppt.pptxPresentation vision transformersppt.pptx
Presentation vision transformersppt.pptxhtn540
 
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...inside-BigData.com
 
The RaPId Toolbox for Parameter Identification and Model Validation: How Mode...
The RaPId Toolbox for Parameter Identification and Model Validation: How Mode...The RaPId Toolbox for Parameter Identification and Model Validation: How Mode...
The RaPId Toolbox for Parameter Identification and Model Validation: How Mode...Luigi Vanfretti
 
Modeling and Simulation of Electrical Power Systems using OpenIPSL.org and Gr...
Modeling and Simulation of Electrical Power Systems using OpenIPSL.org and Gr...Modeling and Simulation of Electrical Power Systems using OpenIPSL.org and Gr...
Modeling and Simulation of Electrical Power Systems using OpenIPSL.org and Gr...Luigi Vanfretti
 
Scala for Machine Learning
Scala for Machine LearningScala for Machine Learning
Scala for Machine LearningPatrick Nicolas
 
Nafems15 systeme
Nafems15 systemeNafems15 systeme
Nafems15 systemeSDTools
 
Eclipse VIATRA Overview 2017
Eclipse VIATRA Overview 2017Eclipse VIATRA Overview 2017
Eclipse VIATRA Overview 2017Istvan Rath
 
OPAL-RT real-time simulation at RTE
OPAL-RT real-time simulation at RTEOPAL-RT real-time simulation at RTE
OPAL-RT real-time simulation at RTEOPAL-RT TECHNOLOGIES
 
Seminar_New -CESG
Seminar_New -CESGSeminar_New -CESG
Seminar_New -CESGQian Wang
 
Nafems15 Technical meeting on system modeling
Nafems15 Technical meeting on system modelingNafems15 Technical meeting on system modeling
Nafems15 Technical meeting on system modelingSDTools
 
Hardware Implementation of Cascade SVM
Hardware Implementation of Cascade SVMHardware Implementation of Cascade SVM
Hardware Implementation of Cascade SVMQian Wang
 
Threads and Concurrency Identifying Performance Deviations in Thread Pools
Threads and Concurrency Identifying Performance Deviations in Thread PoolsThreads and Concurrency Identifying Performance Deviations in Thread Pools
Threads and Concurrency Identifying Performance Deviations in Thread PoolsPushpalanka Jayawardhana
 
Architecture innovations in POWER ISA v3.01 and POWER10
Architecture innovations in POWER ISA v3.01 and POWER10Architecture innovations in POWER ISA v3.01 and POWER10
Architecture innovations in POWER ISA v3.01 and POWER10Ganesan Narayanasamy
 

Similar to Time Series Forecasting Using Recurrent Neural Network and Vector Autoregressive Model: When and How with Jeffrey Yau (20)

Power System Simulation: History, State of the Art, and Challenges
Power System Simulation: History, State of the Art, and ChallengesPower System Simulation: History, State of the Art, and Challenges
Power System Simulation: History, State of the Art, and Challenges
 
Wanted!: Open M&S Standards and Technologies for the Smart Grid - Introducing...
Wanted!: Open M&S Standards and Technologies for the Smart Grid - Introducing...Wanted!: Open M&S Standards and Technologies for the Smart Grid - Introducing...
Wanted!: Open M&S Standards and Technologies for the Smart Grid - Introducing...
 
Co-Simulation Interfacing Capabilities in Device-Level Power Electronic Circu...
Co-Simulation Interfacing Capabilities in Device-Level Power Electronic Circu...Co-Simulation Interfacing Capabilities in Device-Level Power Electronic Circu...
Co-Simulation Interfacing Capabilities in Device-Level Power Electronic Circu...
 
Presentation vision transformersppt.pptx
Presentation vision transformersppt.pptxPresentation vision transformersppt.pptx
Presentation vision transformersppt.pptx
 
CFD_Lecture_1.pdf
CFD_Lecture_1.pdfCFD_Lecture_1.pdf
CFD_Lecture_1.pdf
 
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
 
The RaPId Toolbox for Parameter Identification and Model Validation: How Mode...
The RaPId Toolbox for Parameter Identification and Model Validation: How Mode...The RaPId Toolbox for Parameter Identification and Model Validation: How Mode...
The RaPId Toolbox for Parameter Identification and Model Validation: How Mode...
 
Modeling and Simulation of Electrical Power Systems using OpenIPSL.org and Gr...
Modeling and Simulation of Electrical Power Systems using OpenIPSL.org and Gr...Modeling and Simulation of Electrical Power Systems using OpenIPSL.org and Gr...
Modeling and Simulation of Electrical Power Systems using OpenIPSL.org and Gr...
 
Machine Learning @NECST
Machine Learning @NECSTMachine Learning @NECST
Machine Learning @NECST
 
Scala for Machine Learning
Scala for Machine LearningScala for Machine Learning
Scala for Machine Learning
 
Nafems15 systeme
Nafems15 systemeNafems15 systeme
Nafems15 systeme
 
Eclipse VIATRA Overview 2017
Eclipse VIATRA Overview 2017Eclipse VIATRA Overview 2017
Eclipse VIATRA Overview 2017
 
OPAL-RT real-time simulation at RTE
OPAL-RT real-time simulation at RTEOPAL-RT real-time simulation at RTE
OPAL-RT real-time simulation at RTE
 
Simulation Software Performances And Examples
Simulation Software Performances And ExamplesSimulation Software Performances And Examples
Simulation Software Performances And Examples
 
Seminar_New -CESG
Seminar_New -CESGSeminar_New -CESG
Seminar_New -CESG
 
Nafems15 Technical meeting on system modeling
Nafems15 Technical meeting on system modelingNafems15 Technical meeting on system modeling
Nafems15 Technical meeting on system modeling
 
F017423643
F017423643F017423643
F017423643
 
Hardware Implementation of Cascade SVM
Hardware Implementation of Cascade SVMHardware Implementation of Cascade SVM
Hardware Implementation of Cascade SVM
 
Threads and Concurrency Identifying Performance Deviations in Thread Pools
Threads and Concurrency Identifying Performance Deviations in Thread PoolsThreads and Concurrency Identifying Performance Deviations in Thread Pools
Threads and Concurrency Identifying Performance Deviations in Thread Pools
 
Architecture innovations in POWER ISA v3.01 and POWER10
Architecture innovations in POWER ISA v3.01 and POWER10Architecture innovations in POWER ISA v3.01 and POWER10
Architecture innovations in POWER ISA v3.01 and POWER10
 

More from Databricks

DW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDatabricks
 
Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1Databricks
 
Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2Databricks
 
Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2Databricks
 
Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4Databricks
 
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of HadoopDatabricks
 
Democratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDemocratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDatabricks
 
Learn to Use Databricks for Data Science
Learn to Use Databricks for Data ScienceLearn to Use Databricks for Data Science
Learn to Use Databricks for Data ScienceDatabricks
 
Why APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML MonitoringWhy APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML MonitoringDatabricks
 
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch FixThe Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch FixDatabricks
 
Stage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI IntegrationStage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI IntegrationDatabricks
 
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorchSimplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorchDatabricks
 
Scaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesScaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesDatabricks
 
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark PipelinesScaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark PipelinesDatabricks
 
Sawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature AggregationsSawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature AggregationsDatabricks
 
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkRedis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkDatabricks
 
Re-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkRe-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkDatabricks
 
Raven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction QueriesRaven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction QueriesDatabricks
 
Processing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache SparkProcessing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache SparkDatabricks
 
Massive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta LakeMassive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta LakeDatabricks
 

More from Databricks (20)

DW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptx
 
Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1
 
Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2
 
Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2
 
Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4
 
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
 
Democratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDemocratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized Platform
 
Learn to Use Databricks for Data Science
Learn to Use Databricks for Data ScienceLearn to Use Databricks for Data Science
Learn to Use Databricks for Data Science
 
Why APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML MonitoringWhy APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML Monitoring
 
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch FixThe Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
 
Stage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI IntegrationStage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI Integration
 
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorchSimplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorch
 
Scaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesScaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on Kubernetes
 
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark PipelinesScaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
 
Sawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature AggregationsSawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature Aggregations
 
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkRedis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
 
Re-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkRe-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and Spark
 
Raven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction QueriesRaven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction Queries
 
Processing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache SparkProcessing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache Spark
 
Massive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta LakeMassive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta Lake
 

Recently uploaded

Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...shivangimorya083
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 

Recently uploaded (20)

Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 

Time Series Forecasting Using Recurrent Neural Network and Vector Autoregressive Model: When and How with Jeffrey Yau

  • 1. Jeffrey Yau Chief Data Scientist, AllianceBernstein, L.P. Lecturer, UC Berkeley Masters of Information Data Science Time Series Forecasting Using Recurrent Neural Network and Vector Autoregressive Model
  • 2. Motivation - Why MTSA? 2 Daily Interest Rates Days InterestRates
  • 3. Agenda Section I: Time series forecasting problem formulation Section II: Multivariate (vs. univariate) time series forecasting Section III: Two (of the many) approaches to this problem: – Vector Autoregressive (VAR) Models – Long Short Term Memory (LSTM) Network • Formulation • Implementation Section IV: Comparison of the two approaches Section V: A few words on Spark Implementation 3
  • 4. Section I • Time series forecasting problem formulation • Multivariate (vs. univariate) time series forecasting • Two (of the many) approaches to this problem: – Vector Autoregressive (VAR) Models – Long Short Term Memory (LSTM) Network • Formulation • Implementation • Comparison of the two approaches • A few words on Spark Implementation 4
  • 5. Forecasting: Problem Formulation • Forecasting: predicting the future values of the series using current information set • Current information set consists of current and past values of the series and other exogenous series 5
  • 6. Time Series Forecasting Requires Models 7 A statistical model or a machine learning algorithm Information Set: Forecast horizon: h
  • 7. What models? 9 A model, f(), could be as simple as “a rule” - naive model: The forecast for tomorrow is the observed value today Forecast horizon: h=1 Information Set:
  • 8. “Rolling” Average Model 10 It could be a slightly more complicated model The forecast for time t+1 is an average of the observed values from a predefined, past k time periods Forecast horizon: h=1 Information Set:
  • 9. More Sophisticated Model 11 … but there are other, more sophisticated model that utilize the information set much more efficiently and aim at optimizing some metrics
  • 10. Section II • Time series forecasting problem formulation • Multivariate (vs. univariate) time series forecasting • Two (of the many) approaches to this problem: – Vector Autoregressive (VAR) Models – Long Short Term Memory (LSTM) Network • Formulation • Implementation • Comparison of the two approaches • A few words on Spark Implementation 12
  • 11. Univariate Time Series Models Statistical relationship is unidirectional 13 values from its own series exogenous seriesDynamics of series y
  • 12. Autoregressive Integrated Moving Average (ARIMA) Model 14 values from the series shocks / “error” terms exogenous series Limitation: cannot model cross equation dynamics (or cross series dependency)
  • 13. Multivariate Time Series Modeling 15 Kequations lag-1 of the K series lag-p of the K series exogenous series Dynamics of each of the series Interdependence among the series
  • 14. Section III.A • Time series forecasting problem formulation • Multivariate (vs. univariate) time series forecasting • Two (of the many) approaches to this problem: – Vector Autoregressive (VAR) Models – Long Short Term Memory (LSTM) Network • Formulation • Implementation • Comparison of the two approaches • A few words on Spark Implementation 16
  • 15. Joint Modeling of Multiple Time Series 17
  • 16. ● a system of linear equations of the K series being modeled ● only applies to stationary series ● non-stationary series can be transformed into stationary ones using simple differencing (note: if the series are not co-integrated, then we can still apply VAR ("VAR in differences")) Vector Autoregressive (VAR) Models 18
  • 17. Vector Autoregressive (VAR) Model of Order 1 19 K series 1-lag each AsystemofKequations
  • 18. General Steps to Build VAR Model 20 1. Load the series 2. Train/validation/test split the series 3. Conduct exploratory time series data analysis on the training set 4. Determine if the series are stationary 5. Transform the series 6. Build a model on the transformed series 7. Model diagnostic 8. Model selection (based on some pre-defined criterion) 9. Conduct forecast using the final, chosen model 10. Inverse-transform the forecast 11. Conduct forecast evaluation Iterative
  • 19. ETSDA - Index of Consumer Sentiment 21 autocorrelation function (ACF) graph Partial autocorrelation function (PACF) graph
  • 20. ETSDA - Beer Consumption Series 22 Autocorrelation function
  • 21. Transforming the Series 23 Take the simple-difference of the natural logarithmic transformation of the series note: difference-transformation generates missing values
  • 22. ETSDA on the Transformed Series 24
  • 23. Is the method we propose capable of answering the following questions? ● What are the dynamic properties of these series? Own lagged coefficients ● How are these series interact, if at all? Cross-series lagged coefficients VAR Model Proposed 25
  • 24. VAR Model Estimation and Output 26
  • 25. VAR Model Output - Estimated Coefficients 27put your #assignedhashtag here by setting the footer in view-header/footer
  • 26. VAR Model Output - Var-Covar Matrix 28
  • 28. VAR Model Selection 30 Model selection, in the case of VAR(p), is the choice of the order and the specification of each equation Information criterion can be used for model selection:
  • 29. VAR Model - Inverse Transform 31 Don’t forget to inverse-transform the forecasted series!
  • 30. VAR Model - Forecast Using the Model 32 The Forecast Equation:
  • 31. VAR Model Forecast 33 where T is the last observation period and l is the lag
  • 32. What do the result mean in this context? 34 Don’t forget to put the result in the existing context!
  • 33. Section III.B • Time series forecasting problem formulation • Multivariate (vs. univariate) time series forecasting • Two (of the many) approaches to this problem: – Vector Autoregressive (VAR) Models – Long Short Term Memory (LSTM) Network • Formulation • Implementation • Comparison of the two approaches • A few words on Spark Implementation 35
  • 34. Standard feed-forward network 36 • network architecture does not have "memory" built in • inputs are processed independently • no “device” to keep the past information
  • 35. Vanilla Recurrent Neural Network (RNN) 37 A structure that can retain past information, track the state of the world, and update the state of the world as the network moves forward
  • 36. Limitation of Vanilla RNN Architecture 38 Exploding (and vanishing) gradient problems (Sepp Hochreiter, 1991 Diploma Thesis)
  • 37. Long Short Term Memory (LSTM) Network 39
  • 38. LSTM: Hochreiter and Schmidhuber (1997) 40 The architecture of memory cells and gate units from the original Hochreiter and Schmidhuber (1997) paper
  • 39. LSTM 41 Another representation of the architecture of memory cells and gate units: Greff, Srivastava, Koutnık, Steunebrink, Schmidhuber (2016)
  • 40. (Vanilla) LSTM: 1-minute Overview 42 Chris Colah’s blog gives an excellent introduction to vanilla RNN and LSTM: http://colah.github.io/posts/2015-08-Understanding-LSTMs/#fnref1 • Use memory cells and gated units to information flow LSTM Memory Cell ht-1 h t Training uses Backward Propagation Through Time (BPTT) memory cell (state) hidden state current input output gate forget gate input gate
  • 41. Implementation in Keras Some steps to highlight: • Formulate the series for a RNN supervised learning regression problem (i.e. (Define target and input tensors) • Scale all the series • Define the (initial) architecture of the LSTM Model ○ Define a network of layers that maps your inputs to your targets and the complexity of each layer (i.e. number of neurons) ○ Configure the learning process by picking a loss function, an optimizer, and metrics to monitor • Produce the forecasts and then reverse-scale the forecasted series • Calculate loss metrics (e.g. RMSE, MAE) 43 Note that stationarity, as defined previously, is not a requirement
  • 42. Consumer Sentiment and Housing Starts 44
  • 43. LSTM Architecture Design and Training - A Simple Illustration 45
  • 44. LSTM: Forecast Results (1) 46 Monthly series: ● Training set: 1981 Jan - 2016 Dec ● Test set: 2017 Jan to 2018 Apr
  • 45. LSTM: Forecast vs Observed Series 47 Housing Stars Consumer Sentiment
  • 46. Section IV • Time series forecasting problem formulation • Multivariate (vs. univariate) time series forecasting • Two (of the many) approaches to this problem: – Vector Autoregressive (VAR) Models – Long Short Term Memory (LSTM) Network • Formulation • Implementation • Comparison of the two approaches • A few words on Spark Implementation 48put your #assignedhashtag here by setting the footer in view-header/footer
  • 47. VAR vs. LSTM: Data Type macroeconomic time series, financial time series, business time series, and other numeric series 49 images, texts, all the numeric time series (that can be modeled by VAR) VAR LSTM
  • 48. layers of non-linear transformations of input series VAR vs. LSTM: Parametric form a linear system of equations - highly parameterized 50 VAR LSTM
  • 49. • not require stationarity VAR vs. LSTM: Stationarity Requirement • applied to stationary time series only • its variant (e.g. Vector Error Correction Model) can be applied to co-integrated series 51 VAR LSTM
  • 50. • data preprocessing is a lot more involved • model training and hyper-parameter tuning are time consuming VAR vs. LSTM: Model Implementation • data preprocessing is straight-forward • model training time is fast 52 VAR LSTM
  • 51. Section IV • Time series forecasting problem formulation • Multivariate (vs. univariate) time series forecasting • Two (of the many) approaches to this problem: – Vector Autoregressive (VAR) Models – Long Short Term Memory (LSTM) Network • Formulation • Implementation • Comparison of the two approaches • A few words on Spark Implementation 53put your #assignedhashtag here by setting the footer in view-header/footer
  • 52. Implementation using Spark 54 Straightforward to use Spark for all the steps (outlined above) up to model training, such as ... Ordering in the series matterWait … Not So Fast!
  • 53. Flint: A Time Series Library for Spark 55 Need time-series aware libraries whose operations preserve the natural order of the series, such as Flint, open sourced by TwoSigma (https://github.com/twosigma/flint) - can handle a variety of datafile types, manipulate and aggregate time series, and provide time-series-specific functions, such as (time-series) join, (time-series) filtering, time-based windowing, cycles, and intervalizing) Example: Defining a moving average of the beer consumption series
  • 54. A Few Words on TSA Workflow in Spark 56 Load, pre-process, analyze, transform series using time-series aware libraries Conduct Hyperparameter Tuning in a distributed model and use Spark ML Pipeline