SlideShare a Scribd company logo
1 of 44
Lesson 2: Stationary Time Series
2
Learning Objectives
You will be able to do the following:
▪ Define "stationarity."
▪ Describe methods for determining stationarity.
▪ Explain how to transform nonstationary time-series data.
▪ Use Python* to identify and transform nonstationary time-series data.
4
What Is Stationarity?
A stationary time series is a time series where there are no changes in the
underlying system.
▪ Constant mean (no trend)
▪ Constant variance (no heteroscedacticity)
▪ Constant autocorrelation structure
▪ No periodic component (no seasonality)
5
Assumption 1: Constant Mean
6
Assumption 2: Constant Variance
7
Autocorrelation
Autocorrelation is a key concept in time-series analysis.
▪ Autocorrelation is the correlation between a measurement at two
different times.
▪ The time interval between values is called the lag.
▪ For example, stock prices may be correlated from one day to the next
with a lag value of 1.
▪ Autocorrelation often results in a pattern, whereas a time series without
autocorrelation will exhibit randomness.
8
No autocorrelation Has autocorrelation
9
Assumption 3: Constant Autocorrelation Structure
A stationary time series has constant autocorrelation structure throughout
the entire series.
▪ If the autocorrelation remains constant throughout the series, a simple
transformation can be used to remove the autocorrelation.
▪ This will be useful for several future models.
10
Why Is Stationarity Important?
Stationarity is a fundamental assumption in many time-series forecasting
models:
▪ Without it many basic time-series models would break down.
▪ Transformations can be applied to convert a nonstationary time series to a
stationary one before modeling.
▪ While there are more advanced time-series models that can handle
nonstationary data, that is beyond the scope of this lesson.
12
13
14
15
16
18
How to Identify Nonstationary Time-Series Data
There are several ways to identify nonstationary time-series data:
▪ Run-sequence plots
▪ Summary statistics
▪ Histogram plot
▪ Augmented Dickey-Fuller test
19
Run-Sequence Plot
A run-sequence plot is simply a plot of your time-series data.
▪ This should always be your first step in time-series analysis.
▪ It often shows whether there is underlying structure.
▪ Be on the lookout for trend, seasonality, and autocorrelation.
▪ The previous plots are great examples.
20
Summary Statistics
Calculating the mean and variance over time is a useful way to discern
whether the series is stationary.
▪ A simple but effective way to do this is to split your data into chunks over
time and compute statistics for each chunk.
▪ Large deviations in either the mean or the variance among chunks are
problematic and mean that your data is nonstationary.
21
Stationary
Data
Chunk 1 Chunk 2 Chunk 3
Mean:
Variance:
The chunks have similar mean and variance.
19.8
12.3
18.6
13.1
18.5
12.8f
22
Nonstationary
Data
Chunk 1 Chunk 2 Chunk 3
Mean:
Variance:
19.8
12.3
30.6
13.1
49.5
12.8
There are large deviations in the mean between chunks.
23
Nonstationary
Data
Chunk 1 Chunk 2 Chunk 3
Mean:
Variance:
There are large deviations in the variance between chunks.
19.8
11.8
18.6
40.6
18.5
41.3
24
Histogram Plot
A histogram plot gives important clues into a time series’ underlying structure.
▪ If you see a distribution that is approximately normal, that’s a good indication
your time series is stationary.
▪ If you see a nonnormal distribution, that’s a good indication your time series is
nonstationary.
25
Stationary
26
Nonstationary
27
Augmented Dickey-Fuller Test
The Augmented Dickey-Fuller test is a hypothesis test that tests specifically
for stationarity.
▪ We generally say that the series is nonstationary if the p-value is less than
0.05.
▪ It is a less appropriate test to use with small datasets or when
heteroscedasticity is present.
▪ It is best to pair ADF with other techniques, such as run-sequence plots,
summary statistics, or histograms.
29
How to Transform Nonstationary Time-Series Data
There are several ways to transform nonstationary time-series data:
▪ Remove trend (constant mean)
▪ Remove heteroscedasticity with log (constant variance)
▪ Remove autocorrelation with differencing (exploit constant structure)
▪ Remove seasonality (no periodic component)
▪ Oftentimes you’ll have to do several of these on one dataset!
30
Example 1: Trend & Seasonality Present
A time series with a trend or seasonality component is a nonstationary series. To
make it stationary, we can do the following:
▪ Subtract the trend so that the series has constant mean.
▪ Subtract the seasonality so that the series has no periodic component.
31
Example 1: Trend & Seasonality Components
32
Example 1: Trend & Seasonality Components
33
Example 1: Trend & Seasonality Removed
34
Example 2: Heteroscedasticity Present
A time series with differing variances in two distinct regions is a nonstationary
series. To make it stationary, we can do the following:
▪ Apply the log transformation.
▪ This squashes the larger values so that the variances are closer.
35
Example 2: Heteroscedasticity Present
36
Example 2: Heteroscedasticity Squashed
37
Example 3: Autocorrelation Present
Say a given time series has autocorrelation with a lag of 1. By definition, this is
a nonstationary series in its current form. To make it stationary, we can do the
following:
▪ Difference the data by subtracting by a specific lag.
▪ How you determine the appropriate lag will be covered in the future during
Lesson 4.
38
Example 2: Autocorrelation Present
39
Example 2: Autocorrelation Removed
41
Use Python to Identify and Transform Nonstationarity
Next up is a look at applying these concepts in Python.
▪ See notebook entitled Introduction_to_Stationarity_student.ipynb
42
Learning Objectives Recap
In this session you learned how to do the following:
▪ Define "stationarity"
▪ Describe methods for determining stationarity
▪ Explain how to transform nonstationary time-series data
▪ Use Python to identify and transform nonstationary time-series data
Legal Notices and Disclaimers
This presentation is for informational purposes only. INTEL MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS
SUMMARY.
Intel technologies’ features and benefits depend on system configuration and may require enabled hardware, software or
service activation. Performance varies depending on system configuration. Check with your system manufacturer or
retailer or learn more at intel.com.
Sample source code is released under the Intel Sample Source Code License Agreement.
Intel, the Intel logo, the Intel. Experience What’s Inside logo, and Intel. Experience What’s Inside are trademarks of Intel
Corporation in the U.S. and/or other countries.
*Other names and brands may be claimed as the property of others.
Copyright © 2018, Intel Corporation. All rights reserved.
43
Lesson 2 stationary_time_series

More Related Content

What's hot (20)

Time series.ppt
Time series.pptTime series.ppt
Time series.ppt
 
Time Series Analysis.pptx
Time Series Analysis.pptxTime Series Analysis.pptx
Time Series Analysis.pptx
 
1634 time series and trend analysis
1634 time series and trend analysis1634 time series and trend analysis
1634 time series and trend analysis
 
Time series slideshare
Time series slideshareTime series slideshare
Time series slideshare
 
Trend analysis and time Series Analysis
Trend analysis and time Series Analysis Trend analysis and time Series Analysis
Trend analysis and time Series Analysis
 
ARIMA
ARIMA ARIMA
ARIMA
 
Time Series
Time SeriesTime Series
Time Series
 
ECONOMETRICS
ECONOMETRICSECONOMETRICS
ECONOMETRICS
 
Introduction to time series.pptx
Introduction to time series.pptxIntroduction to time series.pptx
Introduction to time series.pptx
 
Panel slides
Panel slidesPanel slides
Panel slides
 
Autocorrelation
AutocorrelationAutocorrelation
Autocorrelation
 
Heteroscedasticity
HeteroscedasticityHeteroscedasticity
Heteroscedasticity
 
Econometrics
EconometricsEconometrics
Econometrics
 
Autocorrelation- Concept, Causes and Consequences
Autocorrelation- Concept, Causes and ConsequencesAutocorrelation- Concept, Causes and Consequences
Autocorrelation- Concept, Causes and Consequences
 
Introduction to Econometrics
Introduction to EconometricsIntroduction to Econometrics
Introduction to Econometrics
 
Index Numbers
Index NumbersIndex Numbers
Index Numbers
 
Time Series Analysis - Modeling and Forecasting
Time Series Analysis - Modeling and ForecastingTime Series Analysis - Modeling and Forecasting
Time Series Analysis - Modeling and Forecasting
 
Auto Correlation Presentation
Auto Correlation PresentationAuto Correlation Presentation
Auto Correlation Presentation
 
Basic concepts of_econometrics
Basic concepts of_econometricsBasic concepts of_econometrics
Basic concepts of_econometrics
 
Unit Root Test
Unit Root Test Unit Root Test
Unit Root Test
 

Similar to Lesson 2 stationary_time_series

prediction of_inventory_management
prediction of_inventory_managementprediction of_inventory_management
prediction of_inventory_managementFEG
 
forecasting model
forecasting modelforecasting model
forecasting modelFEG
 
Lesson 1 introduction_to_time_series
Lesson 1 introduction_to_time_seriesLesson 1 introduction_to_time_series
Lesson 1 introduction_to_time_seriesankit_ppt
 
Weather forecasting model.pptx
Weather forecasting model.pptxWeather forecasting model.pptx
Weather forecasting model.pptxVisheshYadav12
 
Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...
Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...
Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...Universitat Politècnica de Catalunya
 
Time Series Analysis: Theory and Practice
Time Series Analysis: Theory and PracticeTime Series Analysis: Theory and Practice
Time Series Analysis: Theory and PracticeTetiana Ivanova
 
Time Series Anomaly Detection with .net and Azure
Time Series Anomaly Detection with .net and AzureTime Series Anomaly Detection with .net and Azure
Time Series Anomaly Detection with .net and AzureMarco Parenzan
 
ARIMA Model for analysis of time series data.ppt
ARIMA Model for analysis of time series data.pptARIMA Model for analysis of time series data.ppt
ARIMA Model for analysis of time series data.pptREFOTDEBuea
 
Discovering signal in financial time series- where and how to start
Discovering signal in financial time series- where and how to startDiscovering signal in financial time series- where and how to start
Discovering signal in financial time series- where and how to startNicholasSherman11
 
Performance OR Capacity #CMGimPACt2016
Performance OR Capacity #CMGimPACt2016 Performance OR Capacity #CMGimPACt2016
Performance OR Capacity #CMGimPACt2016 Alex Gilgur
 
Machine Learning in the Financial Industry
Machine Learning in the Financial IndustryMachine Learning in the Financial Industry
Machine Learning in the Financial IndustrySubrat Panda, PhD
 
ADS Introduction
ADS IntroductionADS Introduction
ADS IntroductionNagendraK18
 
Time Series Analysis and Forecasting.ppt
Time Series Analysis and Forecasting.pptTime Series Analysis and Forecasting.ppt
Time Series Analysis and Forecasting.pptssuser220491
 
Demand time series analysis and forecasting
Demand time series analysis and forecastingDemand time series analysis and forecasting
Demand time series analysis and forecastingM Baddar
 

Similar to Lesson 2 stationary_time_series (20)

prediction of_inventory_management
prediction of_inventory_managementprediction of_inventory_management
prediction of_inventory_management
 
forecasting model
forecasting modelforecasting model
forecasting model
 
Lesson 1 introduction_to_time_series
Lesson 1 introduction_to_time_seriesLesson 1 introduction_to_time_series
Lesson 1 introduction_to_time_series
 
Time series analysis
Time series analysisTime series analysis
Time series analysis
 
Weather forecasting model.pptx
Weather forecasting model.pptxWeather forecasting model.pptx
Weather forecasting model.pptx
 
Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...
Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...
Training Deep Networks with Backprop (D1L4 Insight@DCU Machine Learning Works...
 
Time Series Analysis: Theory and Practice
Time Series Analysis: Theory and PracticeTime Series Analysis: Theory and Practice
Time Series Analysis: Theory and Practice
 
Time Series Anomaly Detection with .net and Azure
Time Series Anomaly Detection with .net and AzureTime Series Anomaly Detection with .net and Azure
Time Series Anomaly Detection with .net and Azure
 
ARIMA Model.ppt
ARIMA Model.pptARIMA Model.ppt
ARIMA Model.ppt
 
ARIMA Model for analysis of time series data.ppt
ARIMA Model for analysis of time series data.pptARIMA Model for analysis of time series data.ppt
ARIMA Model for analysis of time series data.ppt
 
ARIMA Model.ppt
ARIMA Model.pptARIMA Model.ppt
ARIMA Model.ppt
 
Discovering signal in financial time series- where and how to start
Discovering signal in financial time series- where and how to startDiscovering signal in financial time series- where and how to start
Discovering signal in financial time series- where and how to start
 
Ch9 slides
Ch9 slidesCh9 slides
Ch9 slides
 
Ch9_slides.ppt
Ch9_slides.pptCh9_slides.ppt
Ch9_slides.ppt
 
Performance OR Capacity #CMGimPACt2016
Performance OR Capacity #CMGimPACt2016 Performance OR Capacity #CMGimPACt2016
Performance OR Capacity #CMGimPACt2016
 
ARIMA.pptx
ARIMA.pptxARIMA.pptx
ARIMA.pptx
 
Machine Learning in the Financial Industry
Machine Learning in the Financial IndustryMachine Learning in the Financial Industry
Machine Learning in the Financial Industry
 
ADS Introduction
ADS IntroductionADS Introduction
ADS Introduction
 
Time Series Analysis and Forecasting.ppt
Time Series Analysis and Forecasting.pptTime Series Analysis and Forecasting.ppt
Time Series Analysis and Forecasting.ppt
 
Demand time series analysis and forecasting
Demand time series analysis and forecastingDemand time series analysis and forecasting
Demand time series analysis and forecasting
 

More from ankit_ppt

Deep learning summary
Deep learning summaryDeep learning summary
Deep learning summaryankit_ppt
 
08 neural networks
08 neural networks08 neural networks
08 neural networksankit_ppt
 
06 image features
06 image features06 image features
06 image featuresankit_ppt
 
05 contours seg_matching
05 contours seg_matching05 contours seg_matching
05 contours seg_matchingankit_ppt
 
04 image transformations_ii
04 image transformations_ii04 image transformations_ii
04 image transformations_iiankit_ppt
 
03 image transformations_i
03 image transformations_i03 image transformations_i
03 image transformations_iankit_ppt
 
02 image processing
02 image processing02 image processing
02 image processingankit_ppt
 
01 foundations
01 foundations01 foundations
01 foundationsankit_ppt
 
Text similarity measures
Text similarity measuresText similarity measures
Text similarity measuresankit_ppt
 
Text generation and_advanced_topics
Text generation and_advanced_topicsText generation and_advanced_topics
Text generation and_advanced_topicsankit_ppt
 
Nlp toolkits and_preprocessing_techniques
Nlp toolkits and_preprocessing_techniquesNlp toolkits and_preprocessing_techniques
Nlp toolkits and_preprocessing_techniquesankit_ppt
 
Matrix decomposition and_applications_to_nlp
Matrix decomposition and_applications_to_nlpMatrix decomposition and_applications_to_nlp
Matrix decomposition and_applications_to_nlpankit_ppt
 
Machine learning and_nlp
Machine learning and_nlpMachine learning and_nlp
Machine learning and_nlpankit_ppt
 
Latent dirichlet allocation_and_topic_modeling
Latent dirichlet allocation_and_topic_modelingLatent dirichlet allocation_and_topic_modeling
Latent dirichlet allocation_and_topic_modelingankit_ppt
 
Intro to nlp
Intro to nlpIntro to nlp
Intro to nlpankit_ppt
 
Ot regularization and_gradient_descent
Ot regularization and_gradient_descentOt regularization and_gradient_descent
Ot regularization and_gradient_descentankit_ppt
 
Ml10 dimensionality reduction-and_advanced_topics
Ml10 dimensionality reduction-and_advanced_topicsMl10 dimensionality reduction-and_advanced_topics
Ml10 dimensionality reduction-and_advanced_topicsankit_ppt
 
Ml9 introduction to-unsupervised_learning_and_clustering_methods
Ml9 introduction to-unsupervised_learning_and_clustering_methodsMl9 introduction to-unsupervised_learning_and_clustering_methods
Ml9 introduction to-unsupervised_learning_and_clustering_methodsankit_ppt
 

More from ankit_ppt (20)

Deep learning summary
Deep learning summaryDeep learning summary
Deep learning summary
 
08 neural networks
08 neural networks08 neural networks
08 neural networks
 
07 learning
07 learning07 learning
07 learning
 
06 image features
06 image features06 image features
06 image features
 
05 contours seg_matching
05 contours seg_matching05 contours seg_matching
05 contours seg_matching
 
04 image transformations_ii
04 image transformations_ii04 image transformations_ii
04 image transformations_ii
 
03 image transformations_i
03 image transformations_i03 image transformations_i
03 image transformations_i
 
02 image processing
02 image processing02 image processing
02 image processing
 
01 foundations
01 foundations01 foundations
01 foundations
 
Word2 vec
Word2 vecWord2 vec
Word2 vec
 
Text similarity measures
Text similarity measuresText similarity measures
Text similarity measures
 
Text generation and_advanced_topics
Text generation and_advanced_topicsText generation and_advanced_topics
Text generation and_advanced_topics
 
Nlp toolkits and_preprocessing_techniques
Nlp toolkits and_preprocessing_techniquesNlp toolkits and_preprocessing_techniques
Nlp toolkits and_preprocessing_techniques
 
Matrix decomposition and_applications_to_nlp
Matrix decomposition and_applications_to_nlpMatrix decomposition and_applications_to_nlp
Matrix decomposition and_applications_to_nlp
 
Machine learning and_nlp
Machine learning and_nlpMachine learning and_nlp
Machine learning and_nlp
 
Latent dirichlet allocation_and_topic_modeling
Latent dirichlet allocation_and_topic_modelingLatent dirichlet allocation_and_topic_modeling
Latent dirichlet allocation_and_topic_modeling
 
Intro to nlp
Intro to nlpIntro to nlp
Intro to nlp
 
Ot regularization and_gradient_descent
Ot regularization and_gradient_descentOt regularization and_gradient_descent
Ot regularization and_gradient_descent
 
Ml10 dimensionality reduction-and_advanced_topics
Ml10 dimensionality reduction-and_advanced_topicsMl10 dimensionality reduction-and_advanced_topics
Ml10 dimensionality reduction-and_advanced_topics
 
Ml9 introduction to-unsupervised_learning_and_clustering_methods
Ml9 introduction to-unsupervised_learning_and_clustering_methodsMl9 introduction to-unsupervised_learning_and_clustering_methods
Ml9 introduction to-unsupervised_learning_and_clustering_methods
 

Recently uploaded

UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxkalpana413121
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...josephjonse
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)ChandrakantDivate1
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfsumitt6_25730773
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptAfnanAhmad53
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelDrAjayKumarYadav4
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
Memory Interfacing of 8086 with DMA 8257
Memory Interfacing of 8086 with DMA 8257Memory Interfacing of 8086 with DMA 8257
Memory Interfacing of 8086 with DMA 8257subhasishdas79
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Ramkumar k
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxMustafa Ahmed
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesRashidFaridChishti
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 

Recently uploaded (20)

UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .ppt
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata Model
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Memory Interfacing of 8086 with DMA 8257
Memory Interfacing of 8086 with DMA 8257Memory Interfacing of 8086 with DMA 8257
Memory Interfacing of 8086 with DMA 8257
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 

Lesson 2 stationary_time_series

  • 1. Lesson 2: Stationary Time Series
  • 2. 2 Learning Objectives You will be able to do the following: ▪ Define "stationarity." ▪ Describe methods for determining stationarity. ▪ Explain how to transform nonstationary time-series data. ▪ Use Python* to identify and transform nonstationary time-series data.
  • 3.
  • 4. 4 What Is Stationarity? A stationary time series is a time series where there are no changes in the underlying system. ▪ Constant mean (no trend) ▪ Constant variance (no heteroscedacticity) ▪ Constant autocorrelation structure ▪ No periodic component (no seasonality)
  • 7. 7 Autocorrelation Autocorrelation is a key concept in time-series analysis. ▪ Autocorrelation is the correlation between a measurement at two different times. ▪ The time interval between values is called the lag. ▪ For example, stock prices may be correlated from one day to the next with a lag value of 1. ▪ Autocorrelation often results in a pattern, whereas a time series without autocorrelation will exhibit randomness.
  • 8. 8 No autocorrelation Has autocorrelation
  • 9. 9 Assumption 3: Constant Autocorrelation Structure A stationary time series has constant autocorrelation structure throughout the entire series. ▪ If the autocorrelation remains constant throughout the series, a simple transformation can be used to remove the autocorrelation. ▪ This will be useful for several future models.
  • 10. 10 Why Is Stationarity Important? Stationarity is a fundamental assumption in many time-series forecasting models: ▪ Without it many basic time-series models would break down. ▪ Transformations can be applied to convert a nonstationary time series to a stationary one before modeling. ▪ While there are more advanced time-series models that can handle nonstationary data, that is beyond the scope of this lesson.
  • 11.
  • 12. 12
  • 13. 13
  • 14. 14
  • 15. 15
  • 16. 16
  • 17.
  • 18. 18 How to Identify Nonstationary Time-Series Data There are several ways to identify nonstationary time-series data: ▪ Run-sequence plots ▪ Summary statistics ▪ Histogram plot ▪ Augmented Dickey-Fuller test
  • 19. 19 Run-Sequence Plot A run-sequence plot is simply a plot of your time-series data. ▪ This should always be your first step in time-series analysis. ▪ It often shows whether there is underlying structure. ▪ Be on the lookout for trend, seasonality, and autocorrelation. ▪ The previous plots are great examples.
  • 20. 20 Summary Statistics Calculating the mean and variance over time is a useful way to discern whether the series is stationary. ▪ A simple but effective way to do this is to split your data into chunks over time and compute statistics for each chunk. ▪ Large deviations in either the mean or the variance among chunks are problematic and mean that your data is nonstationary.
  • 21. 21 Stationary Data Chunk 1 Chunk 2 Chunk 3 Mean: Variance: The chunks have similar mean and variance. 19.8 12.3 18.6 13.1 18.5 12.8f
  • 22. 22 Nonstationary Data Chunk 1 Chunk 2 Chunk 3 Mean: Variance: 19.8 12.3 30.6 13.1 49.5 12.8 There are large deviations in the mean between chunks.
  • 23. 23 Nonstationary Data Chunk 1 Chunk 2 Chunk 3 Mean: Variance: There are large deviations in the variance between chunks. 19.8 11.8 18.6 40.6 18.5 41.3
  • 24. 24 Histogram Plot A histogram plot gives important clues into a time series’ underlying structure. ▪ If you see a distribution that is approximately normal, that’s a good indication your time series is stationary. ▪ If you see a nonnormal distribution, that’s a good indication your time series is nonstationary.
  • 27. 27 Augmented Dickey-Fuller Test The Augmented Dickey-Fuller test is a hypothesis test that tests specifically for stationarity. ▪ We generally say that the series is nonstationary if the p-value is less than 0.05. ▪ It is a less appropriate test to use with small datasets or when heteroscedasticity is present. ▪ It is best to pair ADF with other techniques, such as run-sequence plots, summary statistics, or histograms.
  • 28.
  • 29. 29 How to Transform Nonstationary Time-Series Data There are several ways to transform nonstationary time-series data: ▪ Remove trend (constant mean) ▪ Remove heteroscedasticity with log (constant variance) ▪ Remove autocorrelation with differencing (exploit constant structure) ▪ Remove seasonality (no periodic component) ▪ Oftentimes you’ll have to do several of these on one dataset!
  • 30. 30 Example 1: Trend & Seasonality Present A time series with a trend or seasonality component is a nonstationary series. To make it stationary, we can do the following: ▪ Subtract the trend so that the series has constant mean. ▪ Subtract the seasonality so that the series has no periodic component.
  • 31. 31 Example 1: Trend & Seasonality Components
  • 32. 32 Example 1: Trend & Seasonality Components
  • 33. 33 Example 1: Trend & Seasonality Removed
  • 34. 34 Example 2: Heteroscedasticity Present A time series with differing variances in two distinct regions is a nonstationary series. To make it stationary, we can do the following: ▪ Apply the log transformation. ▪ This squashes the larger values so that the variances are closer.
  • 37. 37 Example 3: Autocorrelation Present Say a given time series has autocorrelation with a lag of 1. By definition, this is a nonstationary series in its current form. To make it stationary, we can do the following: ▪ Difference the data by subtracting by a specific lag. ▪ How you determine the appropriate lag will be covered in the future during Lesson 4.
  • 40.
  • 41. 41 Use Python to Identify and Transform Nonstationarity Next up is a look at applying these concepts in Python. ▪ See notebook entitled Introduction_to_Stationarity_student.ipynb
  • 42. 42 Learning Objectives Recap In this session you learned how to do the following: ▪ Define "stationarity" ▪ Describe methods for determining stationarity ▪ Explain how to transform nonstationary time-series data ▪ Use Python to identify and transform nonstationary time-series data
  • 43. Legal Notices and Disclaimers This presentation is for informational purposes only. INTEL MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY. Intel technologies’ features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. Check with your system manufacturer or retailer or learn more at intel.com. Sample source code is released under the Intel Sample Source Code License Agreement. Intel, the Intel logo, the Intel. Experience What’s Inside logo, and Intel. Experience What’s Inside are trademarks of Intel Corporation in the U.S. and/or other countries. *Other names and brands may be claimed as the property of others. Copyright © 2018, Intel Corporation. All rights reserved. 43

Editor's Notes

  1. Lag of 1