SlideShare a Scribd company logo
Introduction to Algorithmic Trading Strategies
Lecture 4
Pairs Trading by Cointegration
Haksun Li
haksun.li@numericalmethod.com
www.numericalmethod.com
Outline
 Distance method
 Cointegration
 Stationarity
 Dickey–Fuller tests
2
References
 Pairs Trading: A Cointegration Approach. Arlen David
Schmidt. University of Sydney. Finance Honours
Thesis. November 2008.
 Likelihood-Based Inference in Cointegrated Vector
Autoregressive Models. Soren Johansen. Oxford
University Press, USA. February 1, 1996.
3
Pairs Trading
 Definition: trade one asset (or basket) against another
asset (or basket)
 Long one and short the other
 Intuition: For two closely related assets, they tend to
“move together” (common trend). We want to buy the
cheap one and sell the expensive one.
 Exploit short term deviation from long term equilibrium.
 Try to make money from “spread”.
4
Spread
 𝑍 = 𝑋 − 𝛽𝑌
 𝛽
 hedge ratio
 cointegration coefficient
5
Dollar Neutral Hedge
 Suppose ES (S&P500 E-mini future) is at 1220 and each
point worth $50, its dollar value is about $61,000.
Suppose NQ (Nasdaq 100 E-mini future) is at 1634 and
each point worth $20, its dollar value is $32,680.
 𝛽 =
61000
32680
= 1.87.
 𝑍 = 𝐸𝐸 − 1.87 × 𝑁𝑁
 Buy Z = Buy 10 ES contracts and Sell 19 NQ contracts.
 Sell Z = Sell 10 ES contracts and Buy 19 NQ contracts.
6
Market Neutral Hedge
 Suppose ES has a beta of 1.25, NQ 1.11.
 We use 𝛽 =
1.25
1.11
= 1.13
7
Dynamic Hedge
 𝛽 changes with time, covariance, market conditions,
etc.
 Periodic recalibration.
8
Distance
 The distance between two time series:
 𝑑 = ∑ 𝑥𝑖 − 𝑦𝑗
2
 𝑥𝑖, 𝑦𝑗 are the normalized prices.
 We choose a pair of stocks among a collection with the
smallest distance, 𝑑.
9
Distance Trading Strategy
 Sell Z if Z is too expensive.
 Buy Z if Z is too cheap.
 How do we do the evaluation?
10
Z Transform
 We normalize Z.
 The normalized value is called z-score.
 𝑧 =
𝑥−𝑥̅
𝜎 𝑥
 Other forms:
 𝑧 =
𝑥−𝑀×𝑥̅
𝑆×𝜎 𝑥
 M, S are proprietary functions for forecasting.
11
A Very Simple Distance Pairs Trading
 Sell Z when z > 2 (standard deviations).
 Sell 10 ES contractsand Buy 19 NQ contracts.
 Buy Z when z < -2 (standard deviations).
 Buy 10 ES contractsand Sell 19 NQ contracts.
12
Pros of the Distance Model
 Model free.
 No mis-specification.
 No mis-estimation.
 Distance measure intuitively captures the LOP idea.
13
Cons of the Distance Model
 Does not guarantee stationarity.
 Cannot predict the convergence time (expected
holding period).
 Ignores the dynamic nature of the spread process,
essentially treat the spread as i.i.d.
 Using more strict criterions works for equity. In fixed
income trading, we don’t have the luxury of throwing
away many pairs.
14
Risks in Pairs Trading
 Long term equilibrium does not hold.
 Systematic market risk.
 Firm specific risk.
 Liquidity.
15
Stationarity
 These ad-hoc 𝛽calibration does not guarantee the
single most important statistical property in trading:
stationarity.
 Strong stationarity: the joint probability distribution
of 𝑥𝑡 does not change over time.
 Weak stationarity: the first and second moments do
not change over time.
 Covariance stationarity
16
Cointegration
 Cointegration: select a linear combination of assets to
construct an (approximately) stationary portfolio.
 A stationary stochastic process is mean-reverting.
 Long when the spread/portfolio/basket falls
sufficiently below a long term equilibrium.
 Short when the spread/portfolio/basket rises
sufficiently above a long term equilibrium.
17
Objective
 Given two I(1) price series, we want to find a linear
combination such that:
 𝑧𝑡 = 𝑥𝑡 − 𝛽𝑦𝑡 = 𝜇 + 𝜀𝑡
 𝜀 𝑡 is I(0), a stationary residue.
 𝜇 is the long term equilibrium.
 Long when 𝑧𝑡 < 𝜇 − Δ.
 Sell when 𝑧𝑡 > 𝜇 + Δ.
18
Stocks from the Same Industry
 Reduce market risk, esp., in bear market.
 Stocks from the same industry are likely to be subject to the
same systematic risk.
 Give some theoretical unpinning to the pairs trading.
 Stocks from the same industry are likely to be driven by the
same fundamental factors (common trends).
19
Cointegration Definition
 𝑋𝑡~CI 𝑑, 𝑏 if
 All components of 𝑋𝑡 are integrated of same order 𝑑.
 There exists a 𝛽𝑡 such that the linear combination,𝛽𝑡 𝑋𝑡 =
𝛽1 𝑋1𝑡 + 𝛽2 𝑋2𝑡 + ⋯ + 𝛽 𝑛 𝑋 𝑛𝑡, is integrated of order
𝑑 − 𝑏 , 𝑏 > 0.
 𝛽is the cointegrating vector, not unique.
20
Illustration for Trading
 Suppose we have two assets, both reasonably I(1), we
want to find 𝛽 such that
 𝑍 = 𝑋 + 𝛽𝑌 is I(0), i.e., stationary.
 In this case, we have 𝑑 = 1, 𝑏 = 1.
21
A Simple VAR Example
 𝑦𝑡 = 𝑎11 𝑦𝑡−1 + 𝑎12 𝑧𝑡−1 + 𝜀 𝑦𝑦
 𝑧𝑡 = 𝑎21 𝑦𝑡−1 + 𝑎22 𝑧𝑡−1 + 𝜀 𝑧𝑡
 Theorem 4.2, Johansen, places certain restrictions on
the coefficients for the VAR to be cointegrated.
 The roots of the characteristics equation lie on or outside
the unit disc.
22
Coefficient Restrictions
 𝑎11 =
1−𝑎22 −𝑎12 𝑎21
1−𝑎22
 𝑎22 > −1
 𝑎12 𝑎21 + 𝑎22 < 1
23
VECM (1)
 Taking differences
 𝑦𝑡 − 𝑦𝑡−1 = 𝑎11 − 1 𝑦𝑡−1 + 𝑎12 𝑧𝑡−1 + 𝜀 𝑦𝑦
 𝑧𝑡 − 𝑧𝑡−1 = 𝑎21 𝑦𝑡−1 + 𝑎22 − 1 𝑧𝑡−1 + 𝜀 𝑧𝑡

Δ𝑦𝑡
Δ𝑧𝑡
=
𝑎11 − 1 𝑎12
𝑎21 𝑎22 − 1
𝑦𝑡−1
𝑧𝑡−1
+
𝜀 𝑦𝑦
𝜀 𝑧𝑡
 Substitution of 𝑎11

Δ𝑦𝑡
Δ𝑧𝑡
=
−𝑎12 𝑎21
1−𝑎22
𝑎12
𝑎21 𝑎22 − 1
𝑦𝑡−1
𝑧𝑡−1
+
𝜀 𝑦𝑦
𝜀 𝑧𝑡
24
VECM (2)
 Δ𝑦𝑡 = 𝛼 𝑦 𝑦𝑡−1 − 𝛽𝑧𝑡−1 + 𝜖 𝑦𝑦
 Δ𝑧𝑡 = 𝛼 𝑧 𝑦𝑡−1 − 𝛽𝑧𝑡−1 + 𝜖 𝑧𝑡
 𝛼 𝑦 =
−𝑎12 𝑎21
1−𝑎22
 𝛼 𝑧 = 𝑎21
 𝛽 =
1−𝑎22
𝑎21
, the cointegrating coefficient
 𝑦𝑡−1 − 𝛽𝑧𝑡−1 is the long run equilibrium, I(0).
 𝛼 𝑦, 𝛼 𝑧 are the speed of adjustment parameters.
25
Interpretation
 Suppose the long run equilibrium is 0,
 Δ𝑦𝑡, Δ𝑧𝑡 responds only to shocks.
 Suppose 𝛼 𝑦 < 0, 𝛼 𝑧 > 0,
 𝑦𝑡 decreases in response to a +ve deviation.
 𝑧𝑡 increases in response to a +ve deviation.
26
Granger Representation Theorem
 If 𝑋𝑡is cointegrated, an VECM form exists.
 The increments can be expressed as a functions of the
dis-equilibrium, and the lagged increments.
 Δ𝑋𝑡 = 𝛼𝛽′ 𝑋𝑡−1 + ∑ 𝑐𝑡Δ𝑋𝑡−1 + 𝜀 𝑡
 In our simple example, we have

Δ𝑦𝑡
Δ𝑧𝑡
=
𝛼 𝑦
𝛼 𝑧
1 −𝛽
𝑦𝑡−1
𝑧𝑡−1
+
𝜀 𝑦𝑦
𝜀 𝑧𝑡
27
Granger Causality
 𝑧𝑡 does not Granger Cause 𝑦𝑡 if lagged values of
Δ𝑧𝑡−𝑖 do not enter the Δ𝑦𝑡 equation.
 𝑦𝑡 does not Granger Cause 𝑧𝑡 if lagged values of
Δ𝑦𝑡−𝑖 do not enter the Δ𝑧𝑡 equation.
28
Test for Stationarity
 An augmented Dickey–Fuller test (ADF) is a test for a unit
root in a time series sample.
 It is an augmented version of the Dickey–Fuller test for a
larger and more complicated set of time series models.
 Intuition:
 if the series 𝑦𝑡 is stationary, then it has a tendency to return to a
constant mean. Therefore large values will tend to be followed by
smaller values, and small values by larger values. Accordingly, the
level of the series will be a significant predictor of next period's
change, and will have a negative coefficient.
 If, on the other hand, the series is integrated, then positive
changes and negative changes will occur with probabilities that
do not depend on the current level of the series.
 In a random walk, where you are now does not affect which way
you will go next.
29
ADF Math
 Δ𝑦𝑡 = 𝛼 + 𝛽𝛽 + 𝛾𝑦𝑡−1 + ∑ Δ𝑦𝑡−𝑖
𝑝−1
𝑖=1 + 𝜖 𝑡
 Null hypothesis 𝐻0: 𝛾 = 0. (𝑦𝑡 non-stationary)
 𝛼 = 0, 𝛽 = 0 models a random walk.
 𝛽 = 0 models a random walk with drift.
 Test statistics =
𝛾�
𝜎 𝛾�
, the more negative, the more
reason to reject 𝐻0 (hence 𝑦𝑡 stationary).
 SuanShu: AugmentedDickeyFuller.java
30
Engle-Granger Two Step Approach
 Estimate either
 𝑦𝑡 = 𝛽10 + 𝛽11 𝑧𝑡 + 𝑒1𝑡
 𝑧𝑡 = 𝛽20 + 𝛽21 𝑦𝑡 + 𝑒2𝑡
 As the sample size increase indefinitely, asymptotically a
test for a unit root in 𝑒1𝑡 and 𝑒2𝑡 are equivalent, but not
for small sample sizes.
 Test for unit root using ADF on either 𝑒1𝑡 and 𝑒2𝑡 .
 If 𝑦𝑡 and 𝑧𝑡 are cointegrated, 𝛽 super converges.
31
Engle-Granger Pros and Cons
 Pros:
 simple
 Cons:
 This approach is subject to twice the estimation errors. Any
errors introduced in the first step carry over to the second
step.
 Work only for two I(1) time series.
32
Testing for Cointegration
 Note that in the VECM, the rows in the coefficient, Π,
are NOT linearly independent.

Δ𝑦𝑡
Δ𝑧𝑡
=
−𝑎12 𝑎21
1−𝑎22
𝑎12
𝑎21 𝑎22 − 1
𝑦𝑡−1
𝑧𝑡−1
+
𝜀 𝑦𝑦
𝜀 𝑧𝑡

−𝑎12 𝑎21
1−𝑎22
𝑎12 ×
− 1−𝑎22
𝑎12
= 𝑎21 𝑎22 − 1
 The rank of Π determine whether the two assets
𝑦𝑡 and 𝑧𝑡 are cointegrated.
33
VAR & VECM
 In general, we can write convert a VAR to an VECM.
 VAR (from numerical estimation by, e.g., OLS):
 𝑋𝑡 = ∑ 𝐴𝑖 𝑋𝑡−𝑖 + 𝜀𝑡
𝑝
𝑖=1
 Transitory form of VECM (reduced form)
 Δ𝑋𝑡 = Π𝑋𝑡−1 + ∑ Γ𝑖Δ𝑋𝑡−𝑖 + 𝜀𝑡
𝑝−1
𝑖=1
 Long run form of VECM
 Δ𝑋𝑡 = ∑ Υ𝑖Δ𝑋𝑡−𝑖
𝑝−1
𝑖=1 + Π𝑋𝑡−𝑝 + 𝜀𝑡
34
The Π Matrix
 Rank(Π) = n, full rank
 The system is already stationary; a standard VAR model in
levels.
 Rank(Π) = 0
 There exists NO cointegrating relations among the time
series.
 0 < Rank(Π) < n
 Π = 𝛼𝛽′
 𝛽 is the cointegrating vector
 𝛼 is the speed of adjustment.
35
Rank Determination
 Determining the rank of Π is amount to determining
the number of non-zero eigenvalues of Π.
 Π is usually obtained from (numerical VAR) estimation.
 Eigenvalues are computed using a numerical procedure.
36
Trace Statistics
 Suppose the eigenvalues of Π are:𝜆1 > 𝜆2 > ⋯ > 𝜆 𝑛.
 For the 0 eigenvalues, ln 1 − 𝜆𝑖 = 0.
 For the (big) non-zero eigenvalues, ln 1 − 𝜆𝑖 is (very
negative).
 The likelihood ratio test statistics
 𝑄 𝐻 𝑟 |𝐻 𝑛 = −𝑇 ∑ log 1 − 𝜆𝑖
𝑝
𝑖=𝑟+1
 H0: rank ≤ r; there are at most r cointegrating β.
37
Test Procedure
 int r = 0;//rank
 for (; r <= n; ++r) {
 compute Q = 𝑄 𝐻 𝑟 |𝐻 𝑛 ;
 If (Q > c.v.) {//compare against a critical value
 break;//fail to reject the null hypothesis; rank found
 }
 }
 r is the rank found
38
Decomposing Π
 Suppose the rank of Π = 𝑟.
 Π = 𝛼𝛽′.
 Π is 𝑛 × 𝑛.
 𝛼 is 𝑛 × 𝑟.
 𝛽′is r × 𝑛.
39
Estimating 𝛽
 𝛽 can estimated by maximizing the log-likelihood
function in Chapter 6, Johansen.
 logL Ψ, 𝛼, 𝛽, Ω
 Theorem 6.1, Johansen: 𝛽 is found by solving the
following eigenvalue problem:
 𝜆𝑆11 − 𝑆10 𝑆00
−1
𝑆01 = 0
40
𝛽
 Each non-zero eigenvalue λ corresponds to a
cointegrating vector, which is its eigenvector.
 𝛽 = 𝑣1, 𝑣2, ⋯ , 𝑣𝑟
 𝛽 spans the cointegrating space.
 For two cointegrating asset, there are only one 𝛽 (𝑣1)
so it is unequivocal.
 When there are multiple 𝛽, we need to add economic
restrictions to identify 𝛽.
41
Trading the Pairs
 Given a space of (liquid) assets, we compute the
pairwise cointegrating relationships.
 For each pair, we validate stationarity by performing
the ADF test.
 For the strongly mean-reverting pairs, we can design
trading strategies around them.
42

More Related Content

What's hot

Intro to Quant Trading Strategies (Lecture 5 of 10)
Intro to Quant Trading Strategies (Lecture 5 of 10)Intro to Quant Trading Strategies (Lecture 5 of 10)
Intro to Quant Trading Strategies (Lecture 5 of 10)
Adrian Aley
 
Intro to Quantitative Investment (Lecture 6 of 6)
Intro to Quantitative Investment (Lecture 6 of 6)Intro to Quantitative Investment (Lecture 6 of 6)
Intro to Quantitative Investment (Lecture 6 of 6)
Adrian Aley
 
Intro to Quantitative Investment (Lecture 1 of 6)
Intro to Quantitative Investment (Lecture 1 of 6)Intro to Quantitative Investment (Lecture 1 of 6)
Intro to Quantitative Investment (Lecture 1 of 6)
Adrian Aley
 
Intro to Quantitative Investment (Lecture 3 of 6)
Intro to Quantitative Investment (Lecture 3 of 6)Intro to Quantitative Investment (Lecture 3 of 6)
Intro to Quantitative Investment (Lecture 3 of 6)
Adrian Aley
 
Quantitative Methods for Lawyers - Class #20 - Regression Analysis - Part 3
Quantitative Methods for Lawyers - Class #20 - Regression Analysis - Part 3Quantitative Methods for Lawyers - Class #20 - Regression Analysis - Part 3
Quantitative Methods for Lawyers - Class #20 - Regression Analysis - Part 3
Daniel Katz
 
Quantitative Methods for Lawyers - Class #6 - Basic Statistics + Probability ...
Quantitative Methods for Lawyers - Class #6 - Basic Statistics + Probability ...Quantitative Methods for Lawyers - Class #6 - Basic Statistics + Probability ...
Quantitative Methods for Lawyers - Class #6 - Basic Statistics + Probability ...
Daniel Katz
 
Quantitative Methods for Lawyers - Class #10 - Binomial Distributions, Normal...
Quantitative Methods for Lawyers - Class #10 - Binomial Distributions, Normal...Quantitative Methods for Lawyers - Class #10 - Binomial Distributions, Normal...
Quantitative Methods for Lawyers - Class #10 - Binomial Distributions, Normal...
Daniel Katz
 
Probability distributions
Probability distributionsProbability distributions
Probability distributions
mvskrishna
 
Stat lesson 5.1 probability distributions
Stat lesson 5.1 probability distributionsStat lesson 5.1 probability distributions
Stat lesson 5.1 probability distributions
pipamutuc
 
Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5
Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5
Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5
Daniel Katz
 
Probability Distribution
Probability DistributionProbability Distribution
Probability Distribution
Sarabjeet Kaur
 
Probability Distributions
Probability Distributions Probability Distributions
Probability Distributions
Anthony J. Evans
 
Probability distribution
Probability distributionProbability distribution
Probability distribution
Punit Raut
 
Quantitative Methods for Lawyers - Class #7 - Probability & Basic Statistics ...
Quantitative Methods for Lawyers - Class #7 - Probability & Basic Statistics ...Quantitative Methods for Lawyers - Class #7 - Probability & Basic Statistics ...
Quantitative Methods for Lawyers - Class #7 - Probability & Basic Statistics ...
Daniel Katz
 
Quantitative Methods for Lawyers - Class #21 - Regression Analysis - Part 4
Quantitative Methods for Lawyers - Class #21 - Regression Analysis - Part 4Quantitative Methods for Lawyers - Class #21 - Regression Analysis - Part 4
Quantitative Methods for Lawyers - Class #21 - Regression Analysis - Part 4
Daniel Katz
 
Statistical inference: Probability and Distribution
Statistical inference: Probability and DistributionStatistical inference: Probability and Distribution
Statistical inference: Probability and Distribution
Eugene Yan Ziyou
 
Chapter 07
Chapter 07Chapter 07
Chapter 07
bmcfad01
 
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Daniel Katz
 
Choosing the Right Regressors
Choosing the Right RegressorsChoosing the Right Regressors
Choosing the Right Regressors
Asad Zaman
 
Quantitative Methods for Lawyers - Class #15 - R Boot Camp - Part 2 - Profess...
Quantitative Methods for Lawyers - Class #15 - R Boot Camp - Part 2 - Profess...Quantitative Methods for Lawyers - Class #15 - R Boot Camp - Part 2 - Profess...
Quantitative Methods for Lawyers - Class #15 - R Boot Camp - Part 2 - Profess...
Daniel Katz
 

What's hot (20)

Intro to Quant Trading Strategies (Lecture 5 of 10)
Intro to Quant Trading Strategies (Lecture 5 of 10)Intro to Quant Trading Strategies (Lecture 5 of 10)
Intro to Quant Trading Strategies (Lecture 5 of 10)
 
Intro to Quantitative Investment (Lecture 6 of 6)
Intro to Quantitative Investment (Lecture 6 of 6)Intro to Quantitative Investment (Lecture 6 of 6)
Intro to Quantitative Investment (Lecture 6 of 6)
 
Intro to Quantitative Investment (Lecture 1 of 6)
Intro to Quantitative Investment (Lecture 1 of 6)Intro to Quantitative Investment (Lecture 1 of 6)
Intro to Quantitative Investment (Lecture 1 of 6)
 
Intro to Quantitative Investment (Lecture 3 of 6)
Intro to Quantitative Investment (Lecture 3 of 6)Intro to Quantitative Investment (Lecture 3 of 6)
Intro to Quantitative Investment (Lecture 3 of 6)
 
Quantitative Methods for Lawyers - Class #20 - Regression Analysis - Part 3
Quantitative Methods for Lawyers - Class #20 - Regression Analysis - Part 3Quantitative Methods for Lawyers - Class #20 - Regression Analysis - Part 3
Quantitative Methods for Lawyers - Class #20 - Regression Analysis - Part 3
 
Quantitative Methods for Lawyers - Class #6 - Basic Statistics + Probability ...
Quantitative Methods for Lawyers - Class #6 - Basic Statistics + Probability ...Quantitative Methods for Lawyers - Class #6 - Basic Statistics + Probability ...
Quantitative Methods for Lawyers - Class #6 - Basic Statistics + Probability ...
 
Quantitative Methods for Lawyers - Class #10 - Binomial Distributions, Normal...
Quantitative Methods for Lawyers - Class #10 - Binomial Distributions, Normal...Quantitative Methods for Lawyers - Class #10 - Binomial Distributions, Normal...
Quantitative Methods for Lawyers - Class #10 - Binomial Distributions, Normal...
 
Probability distributions
Probability distributionsProbability distributions
Probability distributions
 
Stat lesson 5.1 probability distributions
Stat lesson 5.1 probability distributionsStat lesson 5.1 probability distributions
Stat lesson 5.1 probability distributions
 
Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5
Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5
Quantitative Methods for Lawyers - Class #22 - Regression Analysis - Part 5
 
Probability Distribution
Probability DistributionProbability Distribution
Probability Distribution
 
Probability Distributions
Probability Distributions Probability Distributions
Probability Distributions
 
Probability distribution
Probability distributionProbability distribution
Probability distribution
 
Quantitative Methods for Lawyers - Class #7 - Probability & Basic Statistics ...
Quantitative Methods for Lawyers - Class #7 - Probability & Basic Statistics ...Quantitative Methods for Lawyers - Class #7 - Probability & Basic Statistics ...
Quantitative Methods for Lawyers - Class #7 - Probability & Basic Statistics ...
 
Quantitative Methods for Lawyers - Class #21 - Regression Analysis - Part 4
Quantitative Methods for Lawyers - Class #21 - Regression Analysis - Part 4Quantitative Methods for Lawyers - Class #21 - Regression Analysis - Part 4
Quantitative Methods for Lawyers - Class #21 - Regression Analysis - Part 4
 
Statistical inference: Probability and Distribution
Statistical inference: Probability and DistributionStatistical inference: Probability and Distribution
Statistical inference: Probability and Distribution
 
Chapter 07
Chapter 07Chapter 07
Chapter 07
 
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
 
Choosing the Right Regressors
Choosing the Right RegressorsChoosing the Right Regressors
Choosing the Right Regressors
 
Quantitative Methods for Lawyers - Class #15 - R Boot Camp - Part 2 - Profess...
Quantitative Methods for Lawyers - Class #15 - R Boot Camp - Part 2 - Profess...Quantitative Methods for Lawyers - Class #15 - R Boot Camp - Part 2 - Profess...
Quantitative Methods for Lawyers - Class #15 - R Boot Camp - Part 2 - Profess...
 

Similar to Intro to Quant Trading Strategies (Lecture 4 of 10)

Lecture 4
Lecture 4Lecture 4
2. diagnostics, collinearity, transformation, and missing data
2. diagnostics, collinearity, transformation, and missing data 2. diagnostics, collinearity, transformation, and missing data
2. diagnostics, collinearity, transformation, and missing data
Malik Hassan Qayyum 🕵🏻‍♂️
 
Heteroscedasticity Remedial Measures.pptx
Heteroscedasticity Remedial Measures.pptxHeteroscedasticity Remedial Measures.pptx
Heteroscedasticity Remedial Measures.pptx
PatilDevendra5
 
Heteroscedasticity Remedial Measures.pptx
Heteroscedasticity Remedial Measures.pptxHeteroscedasticity Remedial Measures.pptx
Heteroscedasticity Remedial Measures.pptx
DevendraRavindraPati
 
Machine learning introduction lecture notes
Machine learning introduction lecture notesMachine learning introduction lecture notes
Machine learning introduction lecture notes
UmeshJagga1
 
2- Introduction to Modeling.pdf
2- Introduction to Modeling.pdf2- Introduction to Modeling.pdf
2- Introduction to Modeling.pdf
MUHAMMADSAEED509568
 
MLU_DTE_Lecture_2.pptx
MLU_DTE_Lecture_2.pptxMLU_DTE_Lecture_2.pptx
MLU_DTE_Lecture_2.pptx
RahulChaudhry15
 
Stochastic Optimization
Stochastic OptimizationStochastic Optimization
Stochastic Optimization
Mohammad Reza Jabbari
 
1. linear model, inference, prediction
1. linear model, inference, prediction1. linear model, inference, prediction
1. linear model, inference, prediction
Malik Hassan Qayyum 🕵🏻‍♂️
 
Regression for class teaching
Regression for class teachingRegression for class teaching
Regression for class teaching
Pakistan Gum Industries Pvt. Ltd
 
Big Data Analysis
Big Data AnalysisBig Data Analysis
Big Data Analysis
NBER
 
Corrleation and regression
Corrleation and regressionCorrleation and regression
Corrleation and regression
Pakistan Gum Industries Pvt. Ltd
 
Measure of Dispersion, Range, Mean and Standard Deviation, Correlation and Re...
Measure of Dispersion, Range, Mean and Standard Deviation, Correlation and Re...Measure of Dispersion, Range, Mean and Standard Deviation, Correlation and Re...
Measure of Dispersion, Range, Mean and Standard Deviation, Correlation and Re...
Parth Chuahan
 
Introduction to correlation and regression analysis
Introduction to correlation and regression analysisIntroduction to correlation and regression analysis
Introduction to correlation and regression analysis
Farzad Javidanrad
 
Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...
Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...
Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...
Mengxi Jiang
 
PPT Antiderivatives and Indefinite Integration.pptx
PPT Antiderivatives and Indefinite Integration.pptxPPT Antiderivatives and Indefinite Integration.pptx
PPT Antiderivatives and Indefinite Integration.pptx
Kenneth Arlando
 
Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Data Science - Part XII - Ridge Regression, LASSO, and Elastic NetsData Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Derek Kane
 
Regression.pptx
Regression.pptxRegression.pptx
Regression.pptx
Shivakumar B N
 
dma_ppt.pdf
dma_ppt.pdfdma_ppt.pdf
dma_ppt.pdf
BatoolKhan15
 
A PROBABILISTIC ALGORITHM OF COMPUTING THE POLYNOMIAL GREATEST COMMON DIVISOR...
A PROBABILISTIC ALGORITHM OF COMPUTING THE POLYNOMIAL GREATEST COMMON DIVISOR...A PROBABILISTIC ALGORITHM OF COMPUTING THE POLYNOMIAL GREATEST COMMON DIVISOR...
A PROBABILISTIC ALGORITHM OF COMPUTING THE POLYNOMIAL GREATEST COMMON DIVISOR...
ijscmcj
 

Similar to Intro to Quant Trading Strategies (Lecture 4 of 10) (20)

Lecture 4
Lecture 4Lecture 4
Lecture 4
 
2. diagnostics, collinearity, transformation, and missing data
2. diagnostics, collinearity, transformation, and missing data 2. diagnostics, collinearity, transformation, and missing data
2. diagnostics, collinearity, transformation, and missing data
 
Heteroscedasticity Remedial Measures.pptx
Heteroscedasticity Remedial Measures.pptxHeteroscedasticity Remedial Measures.pptx
Heteroscedasticity Remedial Measures.pptx
 
Heteroscedasticity Remedial Measures.pptx
Heteroscedasticity Remedial Measures.pptxHeteroscedasticity Remedial Measures.pptx
Heteroscedasticity Remedial Measures.pptx
 
Machine learning introduction lecture notes
Machine learning introduction lecture notesMachine learning introduction lecture notes
Machine learning introduction lecture notes
 
2- Introduction to Modeling.pdf
2- Introduction to Modeling.pdf2- Introduction to Modeling.pdf
2- Introduction to Modeling.pdf
 
MLU_DTE_Lecture_2.pptx
MLU_DTE_Lecture_2.pptxMLU_DTE_Lecture_2.pptx
MLU_DTE_Lecture_2.pptx
 
Stochastic Optimization
Stochastic OptimizationStochastic Optimization
Stochastic Optimization
 
1. linear model, inference, prediction
1. linear model, inference, prediction1. linear model, inference, prediction
1. linear model, inference, prediction
 
Regression for class teaching
Regression for class teachingRegression for class teaching
Regression for class teaching
 
Big Data Analysis
Big Data AnalysisBig Data Analysis
Big Data Analysis
 
Corrleation and regression
Corrleation and regressionCorrleation and regression
Corrleation and regression
 
Measure of Dispersion, Range, Mean and Standard Deviation, Correlation and Re...
Measure of Dispersion, Range, Mean and Standard Deviation, Correlation and Re...Measure of Dispersion, Range, Mean and Standard Deviation, Correlation and Re...
Measure of Dispersion, Range, Mean and Standard Deviation, Correlation and Re...
 
Introduction to correlation and regression analysis
Introduction to correlation and regression analysisIntroduction to correlation and regression analysis
Introduction to correlation and regression analysis
 
Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...
Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...
Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...
 
PPT Antiderivatives and Indefinite Integration.pptx
PPT Antiderivatives and Indefinite Integration.pptxPPT Antiderivatives and Indefinite Integration.pptx
PPT Antiderivatives and Indefinite Integration.pptx
 
Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Data Science - Part XII - Ridge Regression, LASSO, and Elastic NetsData Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
 
Regression.pptx
Regression.pptxRegression.pptx
Regression.pptx
 
dma_ppt.pdf
dma_ppt.pdfdma_ppt.pdf
dma_ppt.pdf
 
A PROBABILISTIC ALGORITHM OF COMPUTING THE POLYNOMIAL GREATEST COMMON DIVISOR...
A PROBABILISTIC ALGORITHM OF COMPUTING THE POLYNOMIAL GREATEST COMMON DIVISOR...A PROBABILISTIC ALGORITHM OF COMPUTING THE POLYNOMIAL GREATEST COMMON DIVISOR...
A PROBABILISTIC ALGORITHM OF COMPUTING THE POLYNOMIAL GREATEST COMMON DIVISOR...
 

Recently uploaded

Accounting Information Systems (AIS).pptx
Accounting Information Systems (AIS).pptxAccounting Information Systems (AIS).pptx
Accounting Information Systems (AIS).pptx
TIZITAWMASRESHA
 
Ending stagnation: How to boost prosperity across Scotland
Ending stagnation: How to boost prosperity across ScotlandEnding stagnation: How to boost prosperity across Scotland
Ending stagnation: How to boost prosperity across Scotland
ResolutionFoundation
 
Money20/20 and EU Networking Event of 20/24!
Money20/20 and EU Networking Event of 20/24!Money20/20 and EU Networking Event of 20/24!
Money20/20 and EU Networking Event of 20/24!
FinTech Belgium
 
Independent Study - College of Wooster Research (2023-2024)
Independent Study - College of Wooster Research (2023-2024)Independent Study - College of Wooster Research (2023-2024)
Independent Study - College of Wooster Research (2023-2024)
AntoniaOwensDetwiler
 
Importance of community participation in development projects.pdf
Importance of community participation in development projects.pdfImportance of community participation in development projects.pdf
Importance of community participation in development projects.pdf
krisretro1
 
What's a worker’s market? Job quality and labour market tightness
What's a worker’s market? Job quality and labour market tightnessWhat's a worker’s market? Job quality and labour market tightness
What's a worker’s market? Job quality and labour market tightness
Labour Market Information Council | Conseil de l’information sur le marché du travail
 
International Sustainability Standards Board
International Sustainability Standards BoardInternational Sustainability Standards Board
International Sustainability Standards Board
Kumar Ramaiah
 
Discover the Future of Dogecoin with Our Comprehensive Guidance
Discover the Future of Dogecoin with Our Comprehensive GuidanceDiscover the Future of Dogecoin with Our Comprehensive Guidance
Discover the Future of Dogecoin with Our Comprehensive Guidance
36 Crypto
 
University of North Carolina at Charlotte degree offer diploma Transcript
University of North Carolina at Charlotte degree offer diploma TranscriptUniversity of North Carolina at Charlotte degree offer diploma Transcript
University of North Carolina at Charlotte degree offer diploma Transcript
tscdzuip
 
Initial Public Offering (IPO) Process.ppt
Initial Public Offering (IPO) Process.pptInitial Public Offering (IPO) Process.ppt
Initial Public Offering (IPO) Process.ppt
ribhi87
 
The Rise and Fall of Ponzi Schemes in America.pptx
The Rise and Fall of Ponzi Schemes in America.pptxThe Rise and Fall of Ponzi Schemes in America.pptx
The Rise and Fall of Ponzi Schemes in America.pptx
Diana Rose
 
13 Jun 24 ILC Retirement Income Summit - slides.pptx
13 Jun 24 ILC Retirement Income Summit - slides.pptx13 Jun 24 ILC Retirement Income Summit - slides.pptx
13 Jun 24 ILC Retirement Income Summit - slides.pptx
ILC- UK
 
Governor Olli Rehn: Inflation down and recovery supported by interest rate cu...
Governor Olli Rehn: Inflation down and recovery supported by interest rate cu...Governor Olli Rehn: Inflation down and recovery supported by interest rate cu...
Governor Olli Rehn: Inflation down and recovery supported by interest rate cu...
Suomen Pankki
 
一比一原版美国新罕布什尔大学(unh)毕业证学历认证真实可查
一比一原版美国新罕布什尔大学(unh)毕业证学历认证真实可查一比一原版美国新罕布什尔大学(unh)毕业证学历认证真实可查
一比一原版美国新罕布什尔大学(unh)毕业证学历认证真实可查
taqyea
 
Fabular Frames and the Four Ratio Problem
Fabular Frames and the Four Ratio ProblemFabular Frames and the Four Ratio Problem
Fabular Frames and the Four Ratio Problem
Majid Iqbal
 
Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...
Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...
Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...
bresciafarid233
 
Macroeconomic-digest-of-Ukraine-0624-Eng.pdf
Macroeconomic-digest-of-Ukraine-0624-Eng.pdfMacroeconomic-digest-of-Ukraine-0624-Eng.pdf
Macroeconomic-digest-of-Ukraine-0624-Eng.pdf
olaola5673
 
The state of welfare Resolution Foundation Event
The state of welfare Resolution Foundation EventThe state of welfare Resolution Foundation Event
The state of welfare Resolution Foundation Event
ResolutionFoundation
 
How to Invest in Cryptocurrency for Beginners: A Complete Guide
How to Invest in Cryptocurrency for Beginners: A Complete GuideHow to Invest in Cryptocurrency for Beginners: A Complete Guide
How to Invest in Cryptocurrency for Beginners: A Complete Guide
Daniel
 
欧洲杯投注-欧洲杯投注买球-欧洲杯投注买球网|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注买球-欧洲杯投注买球网|【​网址​🎉ac22.net🎉​】欧洲杯投注-欧洲杯投注买球-欧洲杯投注买球网|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注买球-欧洲杯投注买球网|【​网址​🎉ac22.net🎉​】
brunasordi905
 

Recently uploaded (20)

Accounting Information Systems (AIS).pptx
Accounting Information Systems (AIS).pptxAccounting Information Systems (AIS).pptx
Accounting Information Systems (AIS).pptx
 
Ending stagnation: How to boost prosperity across Scotland
Ending stagnation: How to boost prosperity across ScotlandEnding stagnation: How to boost prosperity across Scotland
Ending stagnation: How to boost prosperity across Scotland
 
Money20/20 and EU Networking Event of 20/24!
Money20/20 and EU Networking Event of 20/24!Money20/20 and EU Networking Event of 20/24!
Money20/20 and EU Networking Event of 20/24!
 
Independent Study - College of Wooster Research (2023-2024)
Independent Study - College of Wooster Research (2023-2024)Independent Study - College of Wooster Research (2023-2024)
Independent Study - College of Wooster Research (2023-2024)
 
Importance of community participation in development projects.pdf
Importance of community participation in development projects.pdfImportance of community participation in development projects.pdf
Importance of community participation in development projects.pdf
 
What's a worker’s market? Job quality and labour market tightness
What's a worker’s market? Job quality and labour market tightnessWhat's a worker’s market? Job quality and labour market tightness
What's a worker’s market? Job quality and labour market tightness
 
International Sustainability Standards Board
International Sustainability Standards BoardInternational Sustainability Standards Board
International Sustainability Standards Board
 
Discover the Future of Dogecoin with Our Comprehensive Guidance
Discover the Future of Dogecoin with Our Comprehensive GuidanceDiscover the Future of Dogecoin with Our Comprehensive Guidance
Discover the Future of Dogecoin with Our Comprehensive Guidance
 
University of North Carolina at Charlotte degree offer diploma Transcript
University of North Carolina at Charlotte degree offer diploma TranscriptUniversity of North Carolina at Charlotte degree offer diploma Transcript
University of North Carolina at Charlotte degree offer diploma Transcript
 
Initial Public Offering (IPO) Process.ppt
Initial Public Offering (IPO) Process.pptInitial Public Offering (IPO) Process.ppt
Initial Public Offering (IPO) Process.ppt
 
The Rise and Fall of Ponzi Schemes in America.pptx
The Rise and Fall of Ponzi Schemes in America.pptxThe Rise and Fall of Ponzi Schemes in America.pptx
The Rise and Fall of Ponzi Schemes in America.pptx
 
13 Jun 24 ILC Retirement Income Summit - slides.pptx
13 Jun 24 ILC Retirement Income Summit - slides.pptx13 Jun 24 ILC Retirement Income Summit - slides.pptx
13 Jun 24 ILC Retirement Income Summit - slides.pptx
 
Governor Olli Rehn: Inflation down and recovery supported by interest rate cu...
Governor Olli Rehn: Inflation down and recovery supported by interest rate cu...Governor Olli Rehn: Inflation down and recovery supported by interest rate cu...
Governor Olli Rehn: Inflation down and recovery supported by interest rate cu...
 
一比一原版美国新罕布什尔大学(unh)毕业证学历认证真实可查
一比一原版美国新罕布什尔大学(unh)毕业证学历认证真实可查一比一原版美国新罕布什尔大学(unh)毕业证学历认证真实可查
一比一原版美国新罕布什尔大学(unh)毕业证学历认证真实可查
 
Fabular Frames and the Four Ratio Problem
Fabular Frames and the Four Ratio ProblemFabular Frames and the Four Ratio Problem
Fabular Frames and the Four Ratio Problem
 
Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...
Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...
Tdasx: In-Depth Analysis of Cryptocurrency Giveaway Scams and Security Strate...
 
Macroeconomic-digest-of-Ukraine-0624-Eng.pdf
Macroeconomic-digest-of-Ukraine-0624-Eng.pdfMacroeconomic-digest-of-Ukraine-0624-Eng.pdf
Macroeconomic-digest-of-Ukraine-0624-Eng.pdf
 
The state of welfare Resolution Foundation Event
The state of welfare Resolution Foundation EventThe state of welfare Resolution Foundation Event
The state of welfare Resolution Foundation Event
 
How to Invest in Cryptocurrency for Beginners: A Complete Guide
How to Invest in Cryptocurrency for Beginners: A Complete GuideHow to Invest in Cryptocurrency for Beginners: A Complete Guide
How to Invest in Cryptocurrency for Beginners: A Complete Guide
 
欧洲杯投注-欧洲杯投注买球-欧洲杯投注买球网|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注买球-欧洲杯投注买球网|【​网址​🎉ac22.net🎉​】欧洲杯投注-欧洲杯投注买球-欧洲杯投注买球网|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注买球-欧洲杯投注买球网|【​网址​🎉ac22.net🎉​】
 

Intro to Quant Trading Strategies (Lecture 4 of 10)

  • 1. Introduction to Algorithmic Trading Strategies Lecture 4 Pairs Trading by Cointegration Haksun Li haksun.li@numericalmethod.com www.numericalmethod.com
  • 2. Outline  Distance method  Cointegration  Stationarity  Dickey–Fuller tests 2
  • 3. References  Pairs Trading: A Cointegration Approach. Arlen David Schmidt. University of Sydney. Finance Honours Thesis. November 2008.  Likelihood-Based Inference in Cointegrated Vector Autoregressive Models. Soren Johansen. Oxford University Press, USA. February 1, 1996. 3
  • 4. Pairs Trading  Definition: trade one asset (or basket) against another asset (or basket)  Long one and short the other  Intuition: For two closely related assets, they tend to “move together” (common trend). We want to buy the cheap one and sell the expensive one.  Exploit short term deviation from long term equilibrium.  Try to make money from “spread”. 4
  • 5. Spread  𝑍 = 𝑋 − 𝛽𝑌  𝛽  hedge ratio  cointegration coefficient 5
  • 6. Dollar Neutral Hedge  Suppose ES (S&P500 E-mini future) is at 1220 and each point worth $50, its dollar value is about $61,000. Suppose NQ (Nasdaq 100 E-mini future) is at 1634 and each point worth $20, its dollar value is $32,680.  𝛽 = 61000 32680 = 1.87.  𝑍 = 𝐸𝐸 − 1.87 × 𝑁𝑁  Buy Z = Buy 10 ES contracts and Sell 19 NQ contracts.  Sell Z = Sell 10 ES contracts and Buy 19 NQ contracts. 6
  • 7. Market Neutral Hedge  Suppose ES has a beta of 1.25, NQ 1.11.  We use 𝛽 = 1.25 1.11 = 1.13 7
  • 8. Dynamic Hedge  𝛽 changes with time, covariance, market conditions, etc.  Periodic recalibration. 8
  • 9. Distance  The distance between two time series:  𝑑 = ∑ 𝑥𝑖 − 𝑦𝑗 2  𝑥𝑖, 𝑦𝑗 are the normalized prices.  We choose a pair of stocks among a collection with the smallest distance, 𝑑. 9
  • 10. Distance Trading Strategy  Sell Z if Z is too expensive.  Buy Z if Z is too cheap.  How do we do the evaluation? 10
  • 11. Z Transform  We normalize Z.  The normalized value is called z-score.  𝑧 = 𝑥−𝑥̅ 𝜎 𝑥  Other forms:  𝑧 = 𝑥−𝑀×𝑥̅ 𝑆×𝜎 𝑥  M, S are proprietary functions for forecasting. 11
  • 12. A Very Simple Distance Pairs Trading  Sell Z when z > 2 (standard deviations).  Sell 10 ES contractsand Buy 19 NQ contracts.  Buy Z when z < -2 (standard deviations).  Buy 10 ES contractsand Sell 19 NQ contracts. 12
  • 13. Pros of the Distance Model  Model free.  No mis-specification.  No mis-estimation.  Distance measure intuitively captures the LOP idea. 13
  • 14. Cons of the Distance Model  Does not guarantee stationarity.  Cannot predict the convergence time (expected holding period).  Ignores the dynamic nature of the spread process, essentially treat the spread as i.i.d.  Using more strict criterions works for equity. In fixed income trading, we don’t have the luxury of throwing away many pairs. 14
  • 15. Risks in Pairs Trading  Long term equilibrium does not hold.  Systematic market risk.  Firm specific risk.  Liquidity. 15
  • 16. Stationarity  These ad-hoc 𝛽calibration does not guarantee the single most important statistical property in trading: stationarity.  Strong stationarity: the joint probability distribution of 𝑥𝑡 does not change over time.  Weak stationarity: the first and second moments do not change over time.  Covariance stationarity 16
  • 17. Cointegration  Cointegration: select a linear combination of assets to construct an (approximately) stationary portfolio.  A stationary stochastic process is mean-reverting.  Long when the spread/portfolio/basket falls sufficiently below a long term equilibrium.  Short when the spread/portfolio/basket rises sufficiently above a long term equilibrium. 17
  • 18. Objective  Given two I(1) price series, we want to find a linear combination such that:  𝑧𝑡 = 𝑥𝑡 − 𝛽𝑦𝑡 = 𝜇 + 𝜀𝑡  𝜀 𝑡 is I(0), a stationary residue.  𝜇 is the long term equilibrium.  Long when 𝑧𝑡 < 𝜇 − Δ.  Sell when 𝑧𝑡 > 𝜇 + Δ. 18
  • 19. Stocks from the Same Industry  Reduce market risk, esp., in bear market.  Stocks from the same industry are likely to be subject to the same systematic risk.  Give some theoretical unpinning to the pairs trading.  Stocks from the same industry are likely to be driven by the same fundamental factors (common trends). 19
  • 20. Cointegration Definition  𝑋𝑡~CI 𝑑, 𝑏 if  All components of 𝑋𝑡 are integrated of same order 𝑑.  There exists a 𝛽𝑡 such that the linear combination,𝛽𝑡 𝑋𝑡 = 𝛽1 𝑋1𝑡 + 𝛽2 𝑋2𝑡 + ⋯ + 𝛽 𝑛 𝑋 𝑛𝑡, is integrated of order 𝑑 − 𝑏 , 𝑏 > 0.  𝛽is the cointegrating vector, not unique. 20
  • 21. Illustration for Trading  Suppose we have two assets, both reasonably I(1), we want to find 𝛽 such that  𝑍 = 𝑋 + 𝛽𝑌 is I(0), i.e., stationary.  In this case, we have 𝑑 = 1, 𝑏 = 1. 21
  • 22. A Simple VAR Example  𝑦𝑡 = 𝑎11 𝑦𝑡−1 + 𝑎12 𝑧𝑡−1 + 𝜀 𝑦𝑦  𝑧𝑡 = 𝑎21 𝑦𝑡−1 + 𝑎22 𝑧𝑡−1 + 𝜀 𝑧𝑡  Theorem 4.2, Johansen, places certain restrictions on the coefficients for the VAR to be cointegrated.  The roots of the characteristics equation lie on or outside the unit disc. 22
  • 23. Coefficient Restrictions  𝑎11 = 1−𝑎22 −𝑎12 𝑎21 1−𝑎22  𝑎22 > −1  𝑎12 𝑎21 + 𝑎22 < 1 23
  • 24. VECM (1)  Taking differences  𝑦𝑡 − 𝑦𝑡−1 = 𝑎11 − 1 𝑦𝑡−1 + 𝑎12 𝑧𝑡−1 + 𝜀 𝑦𝑦  𝑧𝑡 − 𝑧𝑡−1 = 𝑎21 𝑦𝑡−1 + 𝑎22 − 1 𝑧𝑡−1 + 𝜀 𝑧𝑡  Δ𝑦𝑡 Δ𝑧𝑡 = 𝑎11 − 1 𝑎12 𝑎21 𝑎22 − 1 𝑦𝑡−1 𝑧𝑡−1 + 𝜀 𝑦𝑦 𝜀 𝑧𝑡  Substitution of 𝑎11  Δ𝑦𝑡 Δ𝑧𝑡 = −𝑎12 𝑎21 1−𝑎22 𝑎12 𝑎21 𝑎22 − 1 𝑦𝑡−1 𝑧𝑡−1 + 𝜀 𝑦𝑦 𝜀 𝑧𝑡 24
  • 25. VECM (2)  Δ𝑦𝑡 = 𝛼 𝑦 𝑦𝑡−1 − 𝛽𝑧𝑡−1 + 𝜖 𝑦𝑦  Δ𝑧𝑡 = 𝛼 𝑧 𝑦𝑡−1 − 𝛽𝑧𝑡−1 + 𝜖 𝑧𝑡  𝛼 𝑦 = −𝑎12 𝑎21 1−𝑎22  𝛼 𝑧 = 𝑎21  𝛽 = 1−𝑎22 𝑎21 , the cointegrating coefficient  𝑦𝑡−1 − 𝛽𝑧𝑡−1 is the long run equilibrium, I(0).  𝛼 𝑦, 𝛼 𝑧 are the speed of adjustment parameters. 25
  • 26. Interpretation  Suppose the long run equilibrium is 0,  Δ𝑦𝑡, Δ𝑧𝑡 responds only to shocks.  Suppose 𝛼 𝑦 < 0, 𝛼 𝑧 > 0,  𝑦𝑡 decreases in response to a +ve deviation.  𝑧𝑡 increases in response to a +ve deviation. 26
  • 27. Granger Representation Theorem  If 𝑋𝑡is cointegrated, an VECM form exists.  The increments can be expressed as a functions of the dis-equilibrium, and the lagged increments.  Δ𝑋𝑡 = 𝛼𝛽′ 𝑋𝑡−1 + ∑ 𝑐𝑡Δ𝑋𝑡−1 + 𝜀 𝑡  In our simple example, we have  Δ𝑦𝑡 Δ𝑧𝑡 = 𝛼 𝑦 𝛼 𝑧 1 −𝛽 𝑦𝑡−1 𝑧𝑡−1 + 𝜀 𝑦𝑦 𝜀 𝑧𝑡 27
  • 28. Granger Causality  𝑧𝑡 does not Granger Cause 𝑦𝑡 if lagged values of Δ𝑧𝑡−𝑖 do not enter the Δ𝑦𝑡 equation.  𝑦𝑡 does not Granger Cause 𝑧𝑡 if lagged values of Δ𝑦𝑡−𝑖 do not enter the Δ𝑧𝑡 equation. 28
  • 29. Test for Stationarity  An augmented Dickey–Fuller test (ADF) is a test for a unit root in a time series sample.  It is an augmented version of the Dickey–Fuller test for a larger and more complicated set of time series models.  Intuition:  if the series 𝑦𝑡 is stationary, then it has a tendency to return to a constant mean. Therefore large values will tend to be followed by smaller values, and small values by larger values. Accordingly, the level of the series will be a significant predictor of next period's change, and will have a negative coefficient.  If, on the other hand, the series is integrated, then positive changes and negative changes will occur with probabilities that do not depend on the current level of the series.  In a random walk, where you are now does not affect which way you will go next. 29
  • 30. ADF Math  Δ𝑦𝑡 = 𝛼 + 𝛽𝛽 + 𝛾𝑦𝑡−1 + ∑ Δ𝑦𝑡−𝑖 𝑝−1 𝑖=1 + 𝜖 𝑡  Null hypothesis 𝐻0: 𝛾 = 0. (𝑦𝑡 non-stationary)  𝛼 = 0, 𝛽 = 0 models a random walk.  𝛽 = 0 models a random walk with drift.  Test statistics = 𝛾� 𝜎 𝛾� , the more negative, the more reason to reject 𝐻0 (hence 𝑦𝑡 stationary).  SuanShu: AugmentedDickeyFuller.java 30
  • 31. Engle-Granger Two Step Approach  Estimate either  𝑦𝑡 = 𝛽10 + 𝛽11 𝑧𝑡 + 𝑒1𝑡  𝑧𝑡 = 𝛽20 + 𝛽21 𝑦𝑡 + 𝑒2𝑡  As the sample size increase indefinitely, asymptotically a test for a unit root in 𝑒1𝑡 and 𝑒2𝑡 are equivalent, but not for small sample sizes.  Test for unit root using ADF on either 𝑒1𝑡 and 𝑒2𝑡 .  If 𝑦𝑡 and 𝑧𝑡 are cointegrated, 𝛽 super converges. 31
  • 32. Engle-Granger Pros and Cons  Pros:  simple  Cons:  This approach is subject to twice the estimation errors. Any errors introduced in the first step carry over to the second step.  Work only for two I(1) time series. 32
  • 33. Testing for Cointegration  Note that in the VECM, the rows in the coefficient, Π, are NOT linearly independent.  Δ𝑦𝑡 Δ𝑧𝑡 = −𝑎12 𝑎21 1−𝑎22 𝑎12 𝑎21 𝑎22 − 1 𝑦𝑡−1 𝑧𝑡−1 + 𝜀 𝑦𝑦 𝜀 𝑧𝑡  −𝑎12 𝑎21 1−𝑎22 𝑎12 × − 1−𝑎22 𝑎12 = 𝑎21 𝑎22 − 1  The rank of Π determine whether the two assets 𝑦𝑡 and 𝑧𝑡 are cointegrated. 33
  • 34. VAR & VECM  In general, we can write convert a VAR to an VECM.  VAR (from numerical estimation by, e.g., OLS):  𝑋𝑡 = ∑ 𝐴𝑖 𝑋𝑡−𝑖 + 𝜀𝑡 𝑝 𝑖=1  Transitory form of VECM (reduced form)  Δ𝑋𝑡 = Π𝑋𝑡−1 + ∑ Γ𝑖Δ𝑋𝑡−𝑖 + 𝜀𝑡 𝑝−1 𝑖=1  Long run form of VECM  Δ𝑋𝑡 = ∑ Υ𝑖Δ𝑋𝑡−𝑖 𝑝−1 𝑖=1 + Π𝑋𝑡−𝑝 + 𝜀𝑡 34
  • 35. The Π Matrix  Rank(Π) = n, full rank  The system is already stationary; a standard VAR model in levels.  Rank(Π) = 0  There exists NO cointegrating relations among the time series.  0 < Rank(Π) < n  Π = 𝛼𝛽′  𝛽 is the cointegrating vector  𝛼 is the speed of adjustment. 35
  • 36. Rank Determination  Determining the rank of Π is amount to determining the number of non-zero eigenvalues of Π.  Π is usually obtained from (numerical VAR) estimation.  Eigenvalues are computed using a numerical procedure. 36
  • 37. Trace Statistics  Suppose the eigenvalues of Π are:𝜆1 > 𝜆2 > ⋯ > 𝜆 𝑛.  For the 0 eigenvalues, ln 1 − 𝜆𝑖 = 0.  For the (big) non-zero eigenvalues, ln 1 − 𝜆𝑖 is (very negative).  The likelihood ratio test statistics  𝑄 𝐻 𝑟 |𝐻 𝑛 = −𝑇 ∑ log 1 − 𝜆𝑖 𝑝 𝑖=𝑟+1  H0: rank ≤ r; there are at most r cointegrating β. 37
  • 38. Test Procedure  int r = 0;//rank  for (; r <= n; ++r) {  compute Q = 𝑄 𝐻 𝑟 |𝐻 𝑛 ;  If (Q > c.v.) {//compare against a critical value  break;//fail to reject the null hypothesis; rank found  }  }  r is the rank found 38
  • 39. Decomposing Π  Suppose the rank of Π = 𝑟.  Π = 𝛼𝛽′.  Π is 𝑛 × 𝑛.  𝛼 is 𝑛 × 𝑟.  𝛽′is r × 𝑛. 39
  • 40. Estimating 𝛽  𝛽 can estimated by maximizing the log-likelihood function in Chapter 6, Johansen.  logL Ψ, 𝛼, 𝛽, Ω  Theorem 6.1, Johansen: 𝛽 is found by solving the following eigenvalue problem:  𝜆𝑆11 − 𝑆10 𝑆00 −1 𝑆01 = 0 40
  • 41. 𝛽  Each non-zero eigenvalue λ corresponds to a cointegrating vector, which is its eigenvector.  𝛽 = 𝑣1, 𝑣2, ⋯ , 𝑣𝑟  𝛽 spans the cointegrating space.  For two cointegrating asset, there are only one 𝛽 (𝑣1) so it is unequivocal.  When there are multiple 𝛽, we need to add economic restrictions to identify 𝛽. 41
  • 42. Trading the Pairs  Given a space of (liquid) assets, we compute the pairwise cointegrating relationships.  For each pair, we validate stationarity by performing the ADF test.  For the strongly mean-reverting pairs, we can design trading strategies around them. 42