Cointegration Models TIME SE R IE S AN ALYSIS IN P YTH ON Rob Reider Adj u nct Professor , NYU - Co u rant Cons u ltant , Q u antopian
What is Cointegration ? T w o series , P and Q can be random w alks t t B u t the linear combination P − c Q ma y not be a random t t w alk ! If that ' s tr u e P − c Q is forecastable t t P and Q are said to be cointegrated t t TIME SERIES ANALYSIS IN PYTHON
Analog y: Dog on a Leash P = O w ner t Q = Dog t Both series look like a random w alk Di � erence , or distance bet w een them , looks mean re v erting If dog falls too far behind , it gets p u lled for w ard If dog gets too far ahead , it gets p u lled back TIME SERIES ANALYSIS IN PYTHON
E x ample : Heating Oil and Nat u ral Gas Heating Oil and Nat u ral Gas both look like random w alks ... TIME SERIES ANALYSIS IN PYTHON
E x ample : Heating Oil and Nat u ral Gas B u t the spread ( di � erence ) is mean re v erting TIME SERIES ANALYSIS IN PYTHON
What T y pes of Series are Cointegrated ? Economic s u bstit u tes Heating Oil and Nat u ral Gas Platin u m and Palladi u m Corn and Wheat Corn and S u gar ... Bitcoin and Ethere u m ? Ho w abo u t competitors ? Coke and Pepsi ? Apple and Blackberr y? No ! Leash broke and dog ran a w a y TIME SERIES ANALYSIS IN PYTHON
T w o Steps to Test for Cointegration Regress P on Q and get slope c t t R u n A u gmented Dicke y- F u ller test on P − c Q to test for t t random w alk Alternati v el y, can u se coint f u nction in statsmodels that combines both steps from statsmodels.tsa.stattools import coint coint(P,Q) TIME SERIES ANALYSIS IN PYTHON
Let ' s practice ! TIME SE R IE S AN ALYSIS IN P YTH ON
Case St u d y: Climate Change TIME SE R IE S AN ALYSIS IN P YTH ON Rob Reider Adj u nct Professor , NYU - Co u rant Cons u ltant , Q u antopian
Anal yz ing Temperat u re Data Temperat u re data : Ne w York Cit y from 1870-2016 Do w nloaded from National Oceanic and Atmospheric Administration ( NOAA ) Con v ert inde x to datetime object Plot data TIME SERIES ANALYSIS IN PYTHON
Anal yz ing Temperat u re Data Test for Random Walk Take � rst di � erences Comp u te ACF and PACF Fit a fe w AR , MA , and ARMA models Use Information Criterion to choose best model Forecast temperat u re o v er ne x t 30 y ears TIME SERIES ANALYSIS IN PYTHON
Let ' s practice ! TIME SE R IE S AN ALYSIS IN P YTH ON
Congrat u lations TIME SE R IE S AN ALYSIS IN P YTH ON Rob Reider Adj u nct Professor , NYU - Co u rant Cons u ltant , Q u antopian
Ad v anced Topics GARCH Models Nonlinear Models M u lti v ariate Time Series Models Regime S w itching Models State Space Models and Kalman Filtering ... TIME SERIES ANALYSIS IN PYTHON
Keep practicing ! TIME SE R IE S AN ALYSIS IN P YTH ON
Recommend
More recommend