Professional Documents
Culture Documents
20 ! 2555
#$%
Cointegration and Pair Trading
56# 56
G?D; .D
<;
9<;
Cointegration and
Pair Trading:Matlab
Appliacation
Asst. Prof. Dr. Sarayut Nathaphan
0
Discussed Topics
Simple steps in pair trading (Traditional Pair Trading)
Drawbacks of general strategy and suggested
solution.
What is pair trading?
Statistical Arbitrage (cointegration) pair trading
What/Why Stationarity?
Why is stationarity important?
Is correlation the same as cointegration?
What is cointegration?
Statistical Arbitrage
(cointegration
cointegration)) pair trading (1/3)
The presence of a cointegrating relationship
enables us to combine the two assets in a certain
linear combination so that the combined portfolio is
a stationary process.
The portfolio is formed by longing the relative undervalued asset and shorting the relative over-valued
asset.
If two cointegrated assets share a long-run
equilibrium relationship, then deviations from this
equilibrium are only short-term and are expected to
return to zero in future periods.
4
Statistical Arbitrage
(cointegration
cointegration)) pair trading (2/3)
To profit from this relative mis-pricing, a long position
in the portfolio is opened when its value falls
sufficiently below its long-run equilibrium and is
closed out once the value of the portfolio reverts to
its expected value.
Profits may be earned when the portfolio is trading
sufficiently above its equilibrium value by shorting
the portfolio until it reverts to its expected value.
Statistical Arbitrage
(cointegration
cointegration)) pair trading (3/3)
Typical questions which must be answered when
developing a pairs trading strategy include
1. How to identify trading pairs?
2. When is the combined portfolio sufficiently away
from its equilibrium value to open a trading
position?
3. When do we close the position?
10
12
13
What/Why Stationarity
Stationarity??
(1/3)
For simple terms, a stochastic process is stationary, if
its statistical properties do not change with time.
(Jan Grandell)
One of the characteristic features that distinguishes
time series data from other types of statistical data
is the fact that, the values of the series at different
time instants will be correlated. Hence a basic
problem in time series analysis is to study the pattern
of the correlation between values at different time
instants and try to construct statistical models which
explain the correlation structure of the series.
14
What/Why Stationarity
Stationarity??
(2/3)
Stationarity is a basic assumption in classical time
series analysis. It means, in effect, that the main
statistical properties of the series remain unchanged
over time.
That is for any set of time points t1, t2, , tn and
any integer c, the joint probability distribution of
[X(t1), X(t2), , X(tn)] is identical with that of [X(t1
+ c), X(t2 + c), , X(tn + c)]
15
What/Why Stationarity
Stationarity??
(3/3
(3/3)
A univariate time series yt is integrated if it can be
brought to stationarity through differencing. The
number of differences required to achieve
stationarity is called the order of integration. Time
series of order d are denoted I(d). Stationary series
are denoted I(0).
An n-dimensional time series yt is cointegrated if
some linear combination 1y1t + + nynt of the
component variables is stationary. The combination
is called a cointegrating relation, and the
coefficients = (1 , , n) form a cointegrating
vector.
16
Example
>> load Data_Canada;
>> Y = Data(:,3:end);
>> figure
>> Plot(dates,Y,LineWidth,2);
>> xlabel(Year);
>> ylabel(Percent);
What can be interpreted?
17
18
19
21
22
23
26
27
28
29
30
What is Cointegration
Cointegration??
Correlation VS Cointegration which one is more
appropriate?
Definition:
Cointegration is an analytic technique for testing for
common trends in multivariate time series and
modeling long-run and short-run dynamics. Two or
more predictive variables in a time-series model are
cointegrated when they share a common stochastic
drift. Variables are considered cointegrated if a linear
combination of them produces a stationary time
series.
31
What is Cointegration
Cointegration??
Cointegration is distinguished from traditional
economic equilibrium, in which a balance of forces
produces stable long-term levels in the variables.
Cointegrated variables are generally unstable in
their levels, but exhibit mean-reverting
"spreads" (generalized by the cointegrating
relation) that force the variables to move around
common stochastic trends.
The tendency of cointegrated variables to revert to
common stochastic trends is expressed in terms of
error-correction.
32
What is Cointegration
Cointegration??
In layman term, cointegration means two or more time
series share long-term behavior
Integrated variables are a specific class of nonstationary variables with important economic and
statistical properties.
Granger (1986) and Engle and Granger (1987) pointed
the differences between I(0) and I(1) as follows:
I(0) has finite variance which does not depend on time,
has limited memory of its past behavior, tend to
fluctuate around the mean (include deterministic trend),
has autocorrelations that decline rapidly as the lag
increases.
33
What is Cointegration
Cointegration??
I(1) series have the main features as
1) Variance depends upon time and goes to
infinity as time goes to infinity
2) The process has an infinitely long memory (an
innovation will permanently affect the process)
3) It wanders widely
4) The autocorrelations tend to one in
magnitude for all time separations
34