Cointegration Models TIME SE R IE S AN ALYSIS IN P YTH ON Rob - - PowerPoint PPT Presentation

cointegration models
SMART_READER_LITE
LIVE PREVIEW

Cointegration Models TIME SE R IE S AN ALYSIS IN P YTH ON Rob - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

Cointegration Models

TIME SE R IE S AN ALYSIS IN P YTH ON

Rob Reider

Adjunct Professor, NYU-Courant Consultant, Quantopian

slide-2
SLIDE 2

TIME SERIES ANALYSIS IN PYTHON

What is Cointegration?

Two series, P and Q can be random walks But the linear combination P − c Q may not be a random walk! If that's true

P − c Q is forecastable P and Q are said to be cointegrated

t t t t t t t t

slide-3
SLIDE 3

TIME SERIES ANALYSIS IN PYTHON

Analogy: Dog on a Leash

P = Owner Q = Dog

Both series look like a random walk Dierence, or distance between them, looks mean reverting If dog falls too far behind, it gets pulled forward If dog gets too far ahead, it gets pulled back t t

slide-4
SLIDE 4

TIME SERIES ANALYSIS IN PYTHON

Example: Heating Oil and Natural Gas

Heating Oil and Natural Gas both look like random walks...

slide-5
SLIDE 5

TIME SERIES ANALYSIS IN PYTHON

Example: Heating Oil and Natural Gas

But the spread (dierence) is mean reverting

slide-6
SLIDE 6

TIME SERIES ANALYSIS IN PYTHON

What Types of Series are Cointegrated?

Economic substitutes Heating Oil and Natural Gas Platinum and Palladium Corn and Wheat Corn and Sugar ... Bitcoin and Ethereum? How about competitors? Coke and Pepsi? Apple and Blackberry? No! Leash broke and dog ran away

slide-7
SLIDE 7

TIME SERIES ANALYSIS IN PYTHON

Two Steps to Test for Cointegration

Regress P on Q and get slope c Run Augmented Dickey-Fuller test on P − c Q to test for random walk Alternatively, can use coint function in statsmodels that combines both steps

from statsmodels.tsa.stattools import coint coint(P,Q)

t t t t

slide-8
SLIDE 8

Let's practice!

TIME SE R IE S AN ALYSIS IN P YTH ON

slide-9
SLIDE 9

Case Study: Climate Change

TIME SE R IE S AN ALYSIS IN P YTH ON

Rob Reider

Adjunct Professor, NYU-Courant Consultant, Quantopian

slide-10
SLIDE 10

TIME SERIES ANALYSIS IN PYTHON

Analyzing Temperature Data

Temperature data: New York City from 1870-2016 Downloaded from National Oceanic and Atmospheric Administration (NOAA) Convert index to datetime object Plot data

slide-11
SLIDE 11

TIME SERIES ANALYSIS IN PYTHON

Analyzing Temperature Data

Test for Random Walk Take rst dierences Compute ACF and PACF Fit a few AR, MA, and ARMA models Use Information Criterion to choose best model Forecast temperature over next 30 years

slide-12
SLIDE 12

Let's practice!

TIME SE R IE S AN ALYSIS IN P YTH ON

slide-13
SLIDE 13

Congratulations

TIME SE R IE S AN ALYSIS IN P YTH ON

Rob Reider

Adjunct Professor, NYU-Courant Consultant, Quantopian

slide-14
SLIDE 14

TIME SERIES ANALYSIS IN PYTHON

Advanced Topics

GARCH Models Nonlinear Models Multivariate Time Series Models Regime Switching Models State Space Models and Kalman Filtering ...

slide-15
SLIDE 15

Keep practicing!

TIME SE R IE S AN ALYSIS IN P YTH ON