Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

SSRN Id1404905

Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

Review of Statistical Arbitrage, Cointegration,

and Multivariate Ornstein-Uhlenbeck

Attilio Meucci1
attilio_meucci@symmys.com

this version: December 04, 2010


latest version available at http://ssrn.com/abstract=1404905

Abstract

We introduce the multivariate Ornstein-Uhlenbeck process, solve it analytically,


and discuss how it generalizes a vast class of continuous-time and discrete-
time multivariate processes. Relying on the simple geometrical interpretation
of the dynamics of the Ornstein-Uhlenbeck process we introduce cointegration
and its relationship to statistical arbitrage. We illustrate an application to
swap contract strategies. Fully documented code illustrating the theory and the
applications is available for download.

JEL Classification: C1, G11

Keywords: "alpha", z-score, signal, half-life, vector-autoregression (VAR),


moving average (MA), VARMA, stationary, unit-root, mean-reversion, Levy
processes

1 The author is grateful to Gianluca Fusai, Ali Nezamoddini and Roberto Violi for their

helpful feedback

Electronic
Electroniccopy
copyavailable
availableat:
at:https://ssrn.com/abstract=1404905
http://ssrn.com/abstract=1404905
The multivariate Ornstein-Uhlenbeck process is arguably the model most
utilized by academics and practitioners alike to describe the multivariate dy-
namics of financial variables. Indeed, the Ornstein-Uhlenbeck process is parsi-
monious, and yet general enough to cover a broad range of processes. Therefore,
by studying the multivariate Ornstein-Uhlenbeck process we gain insight into
the properties of the main multivariate features used daily by econometricians.

direc t coverage
indirect coverage continuous time

OU Levy
VAR(1) ⇔ VAR (n )

Levy
processes
Brow nian
m otion random
walk discrete
Brownian
OU unit root time

cointegration ⇔ stat-arb

stationary

Figure 1: Multivariate processes and coverage by OU

Indeed, the following relationships hold, refer to Figure 1 and see below for
a proof. The Ornstein-Uhlenbeck is a continuous time process. When sampled
in discrete time, the Ornstein-Uhlenbeck process gives rise to a vector autore-
gression of order one, commonly denoted by VAR(1). More general VAR(n)
processes can be represented in VAR(1) format, and therefore they are also cov-
ered by the Ornstein-Uhlenbeck process. VAR(n) processes include unit root
processes, which in turn include the random walk, the discrete-time counterpart
of Levy processes. VAR(n) processes also include cointegrated dynamics, which
are the foundation of statistical arbitrage. Finally, stationary processes are a
special case of cointegration.
In Section 1 we derive the analytical solution of the Ornstein-Uhlenbeck
process. In Section 2 we discuss the geometrical interpretation of the solution.
Building on the solution and its geometrical interpretation, in Section 3 we
introduce naturally the concept of cointegration and we study its properties.
In Section 4 we discuss a simple model-independent estimation technique for
cointegration and we apply this technique to the detection of mean-reverting
trades, which is the foundation of statistical arbitrage. Fully documented code

Electronic
Electroniccopy
copyavailable
availableat:
at:https://ssrn.com/abstract=1404905
http://ssrn.com/abstract=1404905
that illustrates the theory and the empirical aspects of the models in this article
is available at www.symmys.com ⇒ Teaching ⇒ MATLAB.

1 The multivariate Ornstein-Uhlenbeck process


The multivariate Ornstein-Uhlenbeck process is defined by the following sto-
chastic differential equation

dXt = −Θ (Xt − µ) dt + SdBt . (1)

In this expression Θ is the transition matrix, namely a fully generic square


matrix that steers the deterministic portion of the evolution of the process; µ is
a fully generic vector, which represents the unconditional expectation when this
is defined, see below; S is the scatter generator, namely a fully generic square
matrix that drives the dispersion of the process; Bt is typically assumed to be a
vector of independent Brownian motions, although more in general it is a vector
of independent Levy processes, see Barndorff-Nielsen and Shephard (2001) and
refer to Figure 1.
To integrate the process (1) we introduce the integrator

Yt ≡ eΘt (Xt − µ) . (2)

Using Ito’s lemma we obtain

dYt = eΘt SdBt . (3)

Integrating both sides and substituting the definition (2) we obtain


¡ ¢
Xt+τ = I − e−Θτ µ + e−Θτ Xt + ²t,τ , (4)

where the invariants are mixed integrals of the Brownian motion and are thus
normally distributed
Z t+τ
²t,τ ≡ eΘ(u−τ ) SdBu ∼ N (0, Στ ) . (5)
t

The solution (4) is a vector autoregressive process of order one VAR(1), which
reads
Xt+τ = c + CXt + ²t,τ , (6)
for a conformable vector and matrix c and C respectively. A comparison be-
tween the integral solution (4) and the generic VAR(1) formulation (6) provides
the relationship between the continuous-time coefficients and their discrete-time
counterparts.
The conditional distribution of the Ornstein-Uhlenbeck process (4) is normal
at all times
Xt+τ ∼ N (xt+τ , Στ ) . (7)

Electronic
Electroniccopy
copyavailable
availableat:
at:https://ssrn.com/abstract=1404905
http://ssrn.com/abstract=1404905
The deterministic drift reads
¡ ¢
xt+τ ≡ I − e−Θτ µ + e−Θτ xt (8)

and the covariance can be expressed as in Van der Werf (2007) in terms of the
stack operator vec and the Kronecker sum ⊕ as
³ ´
−1
vec (Στ ) ≡ (Θ ⊕ Θ) I − e−(Θ⊕Θ)τ vec (Σ) , (9)

where Σ ≡ SS0 , see the proof in Appendix A.2. Formulas (8)-(9) describe the
propagation law of risk associated with the Ornstein-Uhlenbeck process: the
location-dispersion ellipsoid defined by these parameters provides an indication
of the uncertainly in the realization of the next step in the process.
Notice that (8) and (9) are defined for any specification of the input para-
meters Θ, µ, and S in (1). For small values of τ , a Taylor expansion of these
formulas shows that
Xt+τ ≈ Xt + ²t,τ , (10)
where ²t,τ is a normal invariant:

²t,τ ∼ N (τ Θµ, τ Σ) . (11)

In other words, for small values of the time step τ the Ornstein-Uhlenbeck
process is indistinguishable from a Brownian motion, where the risk of the in-
variants (11), as represented by the standard deviation of any linear combination
of its entries, displays the classical "square-root of τ " propagation law.
As the step horizon τ grows to infinity, so do the expectation (8) and the
covariance (9), unless all the eigenvalues of Θ have positive real part. In that
case the distribution of the process stabilizes to a normal whose unconditional
expectation and covariance read

x∞ = µ (12)
−1
vec (Σ∞ ) = (Θ ⊕ Θ) vec (Σ) (13)

To illustrate, we consider the bivariate case of the two-year and the ten-year
par swap rates. The benchmark assumption among buy-side practitioners is
that par swap rates evolve as the random walk (10), see Figure 3.5 and related
discussion in Meucci (2005).
However, rates cannot diffuse indefinitely. Therefore, they cannot evolve as
a random walk for any size of the time step τ : for steps of the order of a month
or larger, mean-reverting effects must become apparent.
The Ornstein-Uhlenbeck process is suited to model this behavior. We fit this
process for different values of the time step τ and we display in Figure 2 the
location-dispersion ellipsoid defined by the expectation (8) and the covariance

Electronic copy available at: https://ssrn.com/abstract=1404905


τ =1y
5y swap rate
da ily rat es
observ ations
τ = 6m

τ = 1m
τ = 1w
τ = 2y
τ = 1d

τ = 10y

2y swap rate

Figure 2: Propagation law of risk for OU process fitted to swap rates

(9), refer to www.symmys.com ⇒ Teaching ⇒ MATLAB for the fully documented


code.
For values of τ of the order of a few days, the drift is linear in the step and
the size increases as the square root of the step, as in (11). As the step increases
and mean-reversion kicks in, the ellipsoid stabilizes to its unconditional values
(12)-(13).

2 The geometry of the Ornstein-Uhlenbeck dy-


namics
The integral (4) contains all the information on the joint dynamics of the
Ornstein-Uhlenbeck process (1). However, that solution does not provide any
intuition on the dynamics of this process. In order to understand this dynamics
we need to observe the Ornstein-Uhlenbeck process in a different set of coordi-
nates.
Consider the eigenvalues of the transition matrix Θ: since this matrix has
real entries, its eigenvalues are either real or complex conjugate: we denote them
respectively by (λ1 , . . . , λK ) and (γ 1 ± iω 1 ) , . . . , (γ J ± iω J ), where K + 2J =
N . Now consider the matrix B whose columns are the respective, possibly
complex, eigenvectors and define the real matrix A ≡ Re (B)−Im (B). Then the
transition matrix can be decomposed in terms of eigenvalues and eigenvectors

Electronic copy available at: https://ssrn.com/abstract=1404905


as follows
Θ ≡ AΓA−1 , (14)
where Γ is a block-diagonal matrix

Γ ≡ diag (λ1 , . . . , λK , Γ1 , . . . , ΓJ ) , (15)

and the generic j-th matrix Γj is defined as


µ ¶
γj ωj
Γj ≡ . (16)
−ω j γ j
With the eigenvector matrix A we can introduce a new set of coordinates

z ≡ A−1 (x − µ) . (17)

The original Ornstein-Uhlenbeck process (1) in these coordinates follows from


Ito’s lemma and reads
dZt = −ΓZt dt + VdBt , (18)
where V ≡ A−1 S. Since this is another Ornstein-Uhlenbeck process, its solution
is normal
Zt ∼ N (zt , Φt ) , (19)
for a suitable deterministic drift zt and covariance Φt . The deterministic drift
zt is the solution of the ordinary differential equation

dzt = −Γzt dt, (20)

Given the block-diagonal structure of (15), the deterministic drift splits into
separate sub-problems. Indeed, let us partition the N -dimensional vector zt
into K entries which correspond to the real eigenvalues in (15), and J pairs of
entries which correspond to the complex-conjugate eigenvalues summarized by
(16):
³ ´0
(1) (2) (1) (2)
zt ≡ z1,t , . . . , zK,t , z1,t , z1,t , . . . , zJ,t , zJ,t . (21)
For the variables corresponding to the real eigenvalues, (20) simplifies to:

dzk,t = −λk zk,t dt. (22)

For each real eigenvalue indexed by k = 1, . . . , K the solution reads

zk;t ≡ e−λk t zk,0 . (23)

This is an exponential shrinkage at the rate λk . Note that (23) is properly de-
fined also for negative values of λk , in which case the trajectory is an exponential
explosion. If λk > 0 we can compute the half-life of the deterministic trend,
namely the time required for the trajectory (23) to progress half way toward
the long term expectation, which is zero:

e ln 2
t≡ . (24)
λk

Electronic copy available at: https://ssrn.com/abstract=1404905


cointegrated
plane

0.5

z ( 2)0
-0.5 λ<0
γ >0
1
0.5 20

(10)
15 z
z -0 .5 10
5
-1

Figure 3: Deterministic drift of OU process

As for the variables among (21) corresponding to the complex eigenvalue


pairs (20) simplifies to
dzj,t = −Γj zj,t dt, j = 1, . . . , J. (25)
For each complex eigenvalue, the solution reads formally
zj,t ≡ e−Γj t zj,0 . (26)
This formal bivariate solution can be made more explicit component-wise. First,
we write the matrix (16) as follows
µ ¶ µ ¶
1 0 0 1
Γj = γ j + ωj . (27)
0 1 −1 0
As we show in Appendix A.1, the identity matrix on the right hand side gener-
ates an exponential explosion in the solution (26), where the scalar γ j determines
the rate of the explosion. On the other hand, the second matrix on the right
hand side in (27) generates a clockwise rotation, where the scalar ω j determines
the frequency of the rotation. Given the minus sign in the exponential in (26) we
obtain an exponential shrinkage at the rate γ j , coupled with a counterclockwise
rotation with frequency ω j
³ ´
(1) (1) (2)
zj;t ≡ e−γ j t zj,0 cos ω j t − zj,0 sin ω j t (28)
³ ´
(2) (1) (2)
zj;t ≡ e−γ j t zj,0 sin ω j t + zj,0 cos ω j t . (29)

Electronic copy available at: https://ssrn.com/abstract=1404905


Again, (28)-(29) are properly defined also for negative values of γ j , in which
case the trajectory is an exponential explosion.

To illustrate, we consider a tri-variate case with one real eigenvalue λ and


two conjugate eigenvalues γ + iω and γ − iω, where λ < 0 and γ > 0. In Figure
3 we display the ensuing
³ dynamics
´ for the deterministic drift (21), which in
(1) (2)
this context reads zt , zt , zt : the motion (23) escapes toward infinity at an
exponential rate, whereas the motion (28)-(29) whirls toward zero, shrinking at
an exponential rate. The animation that generates Figure 3 can be downloaded
from www.symmys.com ⇒ Teaching ⇒ MATLAB.

Once the deterministic drift in the special coordinates zt is known, the de-
terministic drift of the original Ornstein-Uhlenbeck process (4) is obtained by
inverting (17). This is an affine transformation, which maps lines in lines and
planes in planes
xt ≡ µ + Azt (30)
Therefore the qualitative behavior of the solutions (23) and (28)-(29) sketched
In Figure 3 is preserved.
Although the deterministic part of the process in diagonal coordinates (18)
splits into separate dynamics within each eigenspace, these dynamics are not
independent. In Appendix A.3 we derive the quite lengthy explicit formulas for
the evolution of all the entries of the covariance Φt in (19). For instance, the
covariances between entries relative to two real eigenvalues reads:
Φk,hk ³ ´
Φk,hk;t = 1 − e−(λk +λkh )t , (31)
λk + λhk

where Φ ≡ VV0 . More in general, the following observations apply. First, as


time evolves, the relative volatilities change: this is due both to the different
speed of divergence/shrinkage induced by the real parts λ’s and γ’s of the eigen-
values, and to different speed of rotation, induced by the imaginary parts ω’s
of the eigenvalues. Second, the correlations only vary if rotations occur: if the
imaginary parts ω’s are null, the correlations remain unvaried.
Once the covariance Φt in the diagonal coordinates is known, the covariance
of the original Ornstein-Uhlenbeck process (4) is obtained by inverting (17) and
using the affine equivariance of the covariance, which leads to Σt = AΦt A0 .

3 Cointegration
The solution (4) of the Ornstein-Uhlenbeck dynamics (1) holds for any choice
of the input parameters µ, Θ and S. However, from the formulas for the
covariances (31), and similar formulas in Appendix A.3, we verify that if some
λk ≤ 0, or some γ j ≤ 0, i.e. if any eigenvalues of the transition matrix Θ
are null or negative, then the overall covariance of the Ornstein-Uhlenbeck Xt

Electronic copy available at: https://ssrn.com/abstract=1404905


does not converge: therefore Xt is stationary only if the real parts of all the
eigenvalues of Θ are strictly positive.
Nevertheless, as long as some eigenvalues have strictly positive real part, the
covariances of the respective entries in the transformed process (18) stabilizes
in the long run. Therefore these processes and any linear combination thereof
are stationary. Such combinations are called cointegrated : since from (17) they
span a hyperplane, that hyperplane is called the cointegrated space, see Figure
3.
To better discuss cointegration, we write the Ornstein-Uhlenbeck process (4)
as
∆τ Xt = Ψτ (Xt − µ) + ²t,τ , (32)
where ∆τ is the difference operator ∆τ Xt ≡ Xt+τ − Xt and Ψτ is the transition
matrix
Ψτ ≡ e−Θτ − I. (33)
If some eigenvalues in Θ are null, the matrix e−Θτ has unit eigenvalues: this
follows from
e−Θτ = Ae−Γτ A−1 , (34)
which in turn follows from (14). Processes with this characteristic are known as
unit-root processes. A very special case arises when all the entries in Θ are null.
In this circumstance, e−Θτ is the identity matrix, the transition matrix Ψτ is
null and the Ornstein-Uhlenbeck process becomes a multivariate random walk.
More in general, suppose that L eigenvalues are null. Then Ψτ has rank
N − L and therefore it can be expressed as

Ψτ ≡ Φ0τ Υτ , (35)

where both matrices Φτ and Υτ are full-rank and have dimension (N − L) × N .


The representation (35), known as the error correction representation of the
e τ ≡ P0 Φτ and Υ
process (32), is not unique: indeed any pair Φ e τ ≡ P−1 Υτ gives
rise to the same transition matrix Ψτ for fully arbitrary invertible matrices P.
The L-dimensional hyperplane spanned by the rows of Υτ does not depend
on the horizon τ . This follows from (33) and (34) and the fact that since
Γ generates rotations (imaginary part of the eigenvalues) and/or contractions
(real part of the eigenvalues), the matrix e−Γτ maps the eigenspaces of Θ into
themselves. In particular, any eigenspace of Θ relative to a null eigenvalue is
mapped into itself at any horizon.
Assuming that the non-null eigenvalues of Θ have positive real part2 , the
rows of Υτ , or of any alternative representation, span the contraction hyper-
planes and the process Υτ Xt is stationary and would converge exponentially
fast to the the unconditional expectation Υτ µ, if it were not for the shocks ²t,τ
in (32).
2 One can take differences in the time series of X until the fitted transition matrix does
t
not display negative eigenvalues. However, the case of eigenvalues with pure imaginary part
is not accounted for.

Electronic copy available at: https://ssrn.com/abstract=1404905


4 Statistical arbitrage
Cointegration, along with its geometric interpretation, was introduced above,
building on the multivariate Ornstein-Uhlenbeck dynamics. However, cointegra-
tion is a model-independent concept. Consider a generic multivariate process
Xt .

4.1 Model-independent cointegration


This process is cointegrated if there exists a linear combination of its entries
which is stationary. Let us denote such combination as follows

Ytw ≡ X0t w, (36)

where w is normalized to have unit length for future convenience.


If w belongs to the cointegration space, i.e. Ytw is cointegrated, its variance
stabilizes as t → ∞. Otherwise, its variance diverges to infinity. Therefore,
the combination that minimizes the conditional variance among all the possible
combinations is the best candidate for cointegration:
w
e ≡ argmin [Var {Y∞
w |x0 }] . (37)
kwk=1

Based on this intuition, we consider formally the conditional covariance of


the process
Σ∞ ≡ Cov {X∞ |x0 } , (38)
although we understand that this might not be defined. Then we consider the
formal principal component factorization of the covariance

Σ∞ ≡ EΛE, (39)

where E is the orthogonal matrix whose columns are the eigenvectors


³ ´
E ≡ e(1) , . . . , e(N ) ; (40)

and Λ is the diagonal matrix of the respective eigenvalues, sorted in decreasing


order ³ ´
Λ ≡ diag λ(1) , . . . , λ(N ) . (41)
Note that some eigenvalues might be infinite.
The formal solution to (37) is w e ≡ e(N) , the eigenvector relative to the
(N ) (N)
(N )
smallest eigenvalue λ . If e gives rise to cointegration, the process Yte
(N )
is stationary and therefore the eigenvalue λ is not infinite, but rather it
(N )
represents the unconditional variance of Yte .
If cointegration is found with e(N ) , the next natural candidate for another
possible cointegrated relationship is e(N−1) . Again, if e(N−1) gives rise to coin-
(N −1)
tegration, the eigenvalue λt converges to the unconditional variance of
(N−1)
e
Yt .

10

Electronic copy available at: https://ssrn.com/abstract=1404905


In other words, the PCA decomposition (39) partitions the space into two
portions: the directions of infinite variance, namely the eigenvectors relative to
the infinite eigenvalues, which are not cointegrated, and the directions of finite
variance, namely the eigenvectors relative to the finite eigenvalues, which are
cointegrated.
The above approach assumes knowledge of the true covariance (38), which
in reality is not known. However, the sample covariance of the process Xt
along the cointegrated directions approximates the true asymptotic covariance.
Therefore, the above approach can be implemented in practice by replacing the
true, unknown covariance (38) with its sample counterpart.
To summarize, the above rationale yields a practical routine to detect the
cointegrated relationships in a vector autoregressive process (1). Without ana-
lyzing the eigenvalues of the transition matrix fitted to an autoregressive dynam-
ics, we consider the sample counterpart of the covariance (38); then we extract
the eigenvectors (40); finally we explore the stationarity of the combinations
(n)
Yte for n = N, . . . , 1.

To illustrate, we consider a trading strategy with swap contracts. First, we


note that the p&l generated by a swap contract is faithfully approximated by the
change in the respective swap rate times a constant, known among practitioners
as "dv01". Therefore, we analyze linear combinations of swap rates, which map
into portfolios p&l’s, hoping to detect cointegrated patterns.
In particular, we consider the time series of the 1y, 2y, 5y, 7y, 10y, 15y,
and 30y rates. We compute the sample covariance and we perform its PCA
decomposition. In Figure 4 we plot the time series corresponding with the first,
second, fourth and seventh eigenvectors, refer to www.symmys.com ⇒ Teaching
⇒ MATLAB for the fully documented code.

4.2 Z-score, alpha, horizon adjustments


To test for the stationarity of the potentially cointegrated series it is convenient
to fit to each of them a AR(1) process, i.e. the univariate version of (4), to the
cointegrated combinations:
¡ ¢
Yt+τ ≡ 1 − e−θτ µ + e−θτ Yt + t,τ . (42)
In the univariate case the transition matrix Θ becomes the scalar θ. Consistently
with (23) cointegration corresponds to the condition that the mean-reversion
parameter θ be larger than zero.
By specializing (12) and (13) to the one-dimensional case, we can compute
the expected long-term gain
αt,∞ ≡ |Yt − E {Y∞ }| = |Yt − µ| ;
the z-score
|Yt − E {Y∞ }| |Yt − µ|
zt,∞ ≡ =p ; (43)
Sd {Y∞ } σ 2 /2θ

11

Electronic copy available at: https://ssrn.com/abstract=1404905


eigendirection
e ig e n d i r e c tio n n . 1 ,
1, θ = 0.27
th e ta = 0 . 2 7 1 1 4
eigendirection
e i g e n d i re c ti o n n . 2 ,
2, θ = 1.41
th e ta = 1 . 4 0 5
80 0
-5 0 0

75 0

70 0

b a s i s ppoints
basis points
-1 0 0 0

o i n ts
b a s i s p o i n ts

65 0

60 0

basis
55 0
-1 5 0 0
50 0

45 0

-2 0 0 0 40 0
96 97 98 99 00 01 02 03 04 05 96 97 98 99 00 01 02 03 04 05
ye a r ye a r

eigendirection
e i g e n d i re c ti o n n . 4 ,
4, θ = 6.07
th e ta = 6 . 0 7 1 5
eigendirection
e i g e n d i r e c ti o n n . 7 ,
7, θ = 27.03
th e ta = 2 7 . 0 3 3 1
5 1 .5

1
0
0 .5

-5 0
b a s i s points

b a s i spoints
p o i n ts
p o i n ts

-0 . 5
-1 0
-1
basis

basis
-1 5
-1 . 5

-2 0 -2

-2 . 5
-2 5
-3

-3 0 -3 . 5
96 97 98 99 00 01 02 03 04 05 96 97 98 99 00 01 02 03 04 05
ye a r ye a r

current value 1 z-score bands long-term expectation

Figure 4: Cointegration search among swap rates

and the half-life (24) of the deterministic trend

ln 2
e
τ∝ . (44)
θ
The expected gain (4.2) is also known as the "alpha" of the trade. The z-score
represents the ex-ante Sharpe ratio of the trade and can be used to generate
signals: when the z-score is large we enter the trade; when the z-score has
narrowed we cash a profit; and if the z-score has widened further we take a loss.
The half-life represents the order of magnitude of the time required before we
can hope to cash in any profit: the higher the mean-reversion θ, i.e. the more
cointegrated the series, the lesser the wait.
In practice, traders cannot afford to wait until the half-life of the trade to
deliver the expected (half) alpha. The true horizon is typically one day and the
computations for the alpha and the z-score must be adjusted accordingly. The
horizon-adjusted z-score is defined as

|Yt − E {Yt+τ }| 1 − e−θτ


zt,τ ≡ = zt,∞ 1 . (45)
Sd {Yt+τ } (1 − e−2θτ ) 2

In practice θe
τ is close to zero. Therefore we can write the adjustment as
r
zt,τ ln 2 τ
≈ . (46)
zt,∞ 2 e τ

12

Electronic copy available at: https://ssrn.com/abstract=1404905


Notice that the relative adjustment for two cointegrated strategies rescales as
τ (1) and e
the square root of the ratio of their half-lives e τ (2) :
s
(1) (2)
zt,τ zt,τ τ (1)
e
(1)
/ (2)
≈ . (47)
zt,∞ zt,∞ τ (2)
e
To illustrate, for a horizon τ ≡ 1 day and a signal with a half-life e
τ ≈ 2 weeks
the adjustment (46) is ≈ 2; for a short signal e
τ j ≈ 1 day and a long signal e
τk ≈
1 month the relative adjustment (47) is ≈ 5.
A caveat is due at this point: based on the above recipe, one would be
tempted to set up trades that react to signals from the most mean-reverting
combinations. However, such combinations face two major problems. First, in-
sample cointegration does not necessarily correspond to out-of-sample results:
as a matter of fact, the eigenseries relative to the smallest eigenvalues, i.e.
those that allow to make quicker profits, are the least robust out-of-sample.
Second, the "alpha" (4.2) of a trade has the same order of magnitude as its
volatility. In the case of cointegrated eigenseries, the volatility is the square
root of the respective eigenvalue (41): this implies that the most mean-reverting
series correspond to a much lesser potential return, which is easily offset by the
transaction costs.

In the example in Figure 4 the AR(1) fit (42) confirms that cointegration
increases with the order of the eigenseries. In the first eigenseries the mean-
reversion parameter θ ≈ 0.27 is close to zero: indeed, its pattern is very similar
to a random walk. On the other hand, the last eigenseries displays a very high
mean-reversion parameter θ ≈ 27.
The current signal on the second eigenseries appears quite strong: one would
be tempted to set up a dv01-weighted trade that mimics this series and buy it.
However, the expected wait before cashing in on this trade is of the order of
e
τ ∝ 1/1.41 ≈ 0.7 years.
The current signal on the seventh eigenseries is not strong, but the mean-
reversion is very high, therefore, soon enough the series should hit the 1-z-score
bands: if the series first hits the lower 1-z-score band one should buy the series,
or sell it if the series first hits the upper 1-z-score band, hoping to cash in
in e
τ ∝ 252/27 ≈ 9 days. However, the "alpha" (43) on this trade would be
minuscule, of the order of the basis point: such "alpha" would not justify the
transaction costs incurred by setting up and unwinding a trade that involves
long-short positions in seven contracts.
The current signal on the fourth eigenseries appears strong enough to buy
it and the expected wait before cashing in is of the order of e τ ∝ 12/6.07 ≈ 2
months. The "alpha" is of the order of five basis points, too low for seven
contracts. However, the dv01-adjusted presence of the 15y contract is almost
null and the 5y, 7y, and 10y contracts appear with the same sign and can be
replicated with the 7y contract only without affecting the qualitative behavior
of the eigenseries. Consequently the trader might want to consider setting up
this trade.

13

Electronic copy available at: https://ssrn.com/abstract=1404905


References
Barndorff-Nielsen, O.E., and N. Shephard, 2001, Non-Gaussian Ornstein-
Uhlenbeck-based models and some of their uses in financial economics (with
discussion), J. Roy. Statist. Soc. Ser. B 63, 167—241.
Meucci, A., 2005, Risk and Asset Allocation (Springer).
Van der Werf, K. W., 2007, Covariance of the Ornstein-Uhlenbeck process,
Personal Communication.

14

Electronic copy available at: https://ssrn.com/abstract=1404905


A Appendix
In this appendix we present proofs, results and details that can be skipped at
first reading.

A.1 Deterministic linear dynamical system


Consider the dynamical system
µ ¶ µ ¶µ ¶
ż1 a −b z1
= . (48)
ż2 b a z2

To compute the solution, consider the auxiliary complex problem

ż = µz, (49)

where z ≡ z1 + iz2 and µ ≡ a + ib. By isolating the real and the imaginary parts
we realize that (48) and (49) coincide.
The solution of (49) is
z (t) = eµt z (0) . (50)
Isolating the real and the imaginary parts of this solution we obtain:
¡ ¢ ³ ´
z1 (t) = Re eµt z 0 = Re e(a+ib)t (z1 (0) + iz2 (0)) (51)
¡ ¢
= Re eat (cos bt + i sin bt) (z1 (0) + iz2 (0))
¡ ¢ ³ ´
z2 (t) = Im eµt z 0 = Im e(a+ib)t (z1 (0) + iz2 (0)) (52)
¡ ¢
= Im eat (cos bt + i sin bt) z1 (0) + iz2 (0)

or

z1 (t) = eat (z1 (0) cos bt − z2 (0) sin bt) (53)


z2 (t) = eat (z1 (0) sin bt + z2 (0) cos bt) (54)

The trajectories (53)-(54) depart from (shrink toward) the origin at the expo-
nential rate a and turn counterclockwise with frequency b.

A.2 Distribution of Ornstein-Uhlenbeck process


We recall that the Ornstein-Uhlenbeck process

dXt = −Θ (Xt − m) dt + SdBt . (55)

integrates as follows
Z t
Xt = m+e−Θt (x0 − m) + eΘ(u−t) SdBu . (56)
0

15

Electronic copy available at: https://ssrn.com/abstract=1404905


The distribution of Xt conditioned on the initial value x0 is normal

Xt |x0 ∼ N (µt , Σt ) . (57)

The expectation follows from (56) and reads

µt = m+e−Θt (x0 − m) . (58)

To compute the covariance we use Ito’s isometry:


Z t
0
Σt ≡ Cov {Xt |x0 } = eΘ(u−t) ΣeΘ (u−t) du, (59)
0

where Σ ≡ SS0 . We can simplify further this expression as in Van der Werf
(2007). Using the identity

vec (ABC) ≡ (C0 ⊗ A) vec (B) , (60)

where vec is the stack operator and ⊗ is the Kronecker product. Then
³ 0
´ ³ ´
vec eΘ(u−t) ΣeΘ (u−t) = eΘ(u−t) ⊗ eΘ(u−t) vec (Σ) . (61)

Now we can use the identity

eA⊕B = eA ⊗ eB , (62)

where ⊕ is the Kronecker sum

AM ×M ⊕ BN ×N ≡ AM×M ⊗ IN ×N + IM×M ⊗ BN ×N . (63)

Then we can rephrase the term in the integral (61) as


³ ´ ³ ´
vec eΘ(u−t) ΣeΘ(u−t) = e(Θ⊕Θ)(u−t) vec (Σ) . (64)

Substituting this in (59) we obtain


µZ t ³ ´ ¶
vec (Σt ) = e(Θ⊕Θ)(u−t) du vec (Σ) (65)
0
¯t
¯
= (Θ ⊕ Θ)−1 e(Θ⊕Θ)(u−t) ¯ vec (Σ)
0
³ ´
−1 −(Θ⊕Θ)t
= (Θ ⊕ Θ) I−e vec (Σ)

More in general, consider the process monitored at arbitrary times 0 ≤ t1 ≤


t2 ≤ . . . ⎛ ⎞
Xt1
⎜ ⎟
Xt1 ,t2 ,... ≡ ⎝ Xt2 ⎠ . (66)
..
.

16

Electronic copy available at: https://ssrn.com/abstract=1404905


The distribution of Xt1 ,t2 ,... conditioned on the initial value x0 is normal
¡ ¢
Xt1 ,t2 ,... |x0 ∼ N µt1 ,t2 ,... , Σt1 ,t2 ,... . (67)
The expectation follows from (56) and reads
⎛ ⎞
m+e−Θt1 (x0 − m)
⎜ −Θt2
(x0 − m) ⎟
µt1 ,t2 ,... ≡ ⎝ m+e ⎠ (68)
..
.
For the covariance, it suffices to consider two horizons. Applying Ito’s isometry
we obtain
Z t1
0
Σt1 ,t2 ≡ Cov {Xt1 , Xt2 |x0 } = eΘ(u−t1 ) ΣeΘ (u−t2 ) du
0
Z t1
0 0 0
= eΘ(u−t1 ) ΣeΘ (u−t1 )−Θ (t2 −t1 ) du = Σt1 e−Θ (t2 −t1 )
0

Therefore
⎛ 0 0 ⎞
Σt1 Σt1 e−Θ (t2 −t1 ) Σt1 e−Θ (t3 −t1 ) ···
⎜ e−Θ(t2 −t1 ) Σt Σt2
0
Σt2 e−Θ (t3 −t2 ) ··· ⎟
⎜ 1 ⎟
Σt1 ,t2 ,... =⎜
⎜ .. ⎟ , (69)

⎝ . e−Θ(t3 −t2 ) Σt2 Σt3 ⎠
.. ..
. .

This expression is simplified heavily by applying (65).

A.3 OU (auto)covariance: explicit solution


For t ≤ z the autocovariance is
© 0 ª
Cov {Zt , Zt+τ |Z0 } = E (Zt − E {Zt |Z0 }) (Zt+τ − E {Zt+τ |Z0 }) |Z0 (70)
(µZ ¶ µZ ¶ 0
)
t t+τ
0 0
= E eΓ(u−t) VdBu dBu V0 eΓ (u−t) e−Γ τ
0 0
(µZ ¶ µZ ¶0 )
t t
Γ(u−t) 0 Γ0 (u−t) 0
= E e VdBu dBu V e e−Γ τ
0 0
µZ t ¶
Γ(u−t) 0 Γ0 (u−t) 0
= e VV e du e−Γ τ
0
µZ t ¶
0 0
= e−Γs VV0 e−Γ s du e−Γ τ
0
µZ t ¶
0 0
= e−Γs Σe−Γ s ds e−Γ τ ,
0

where
Σ ≡ VV0 = A−1 SSA0−1 . (71)

17

Electronic copy available at: https://ssrn.com/abstract=1404905


In particular, the covariance reads
Z t
0
Σ (t) ≡ Cov {Zt |Z0 } = e−Γs Σe−Γ s ds. (72)
0

To simplify the notation, we introduce three auxiliary functions:


1 e−γt
Eγ (t) ≡ − (73)
γ γ
ω e−γt (ω cos ωt + γ sin ωt)
Dγ,ω (t) ≡ − (74)
γ 2 + ω2 γ 2 + ω2
−γt
γ e (γ cos ωt − ω sin ωt)
Cγ,ω (t) ≡ 2 2
− . (75)
γ +ω γ 2 + ω2
Using (73)-(73), the conditional covariances among the entries k = 1, . . . K
relative to the real eigenvalues read:
Z t
Σk,hk (t) = e−λk Σk,hk e−λkh s ds (76)
0
¡ ¢
= Σk,hk E t; λk + λhk .

Similarly, the conditional covariances (72) of the pairs of entries j = 1, . . . J


relative to the complex eigenvalues with the entries k = 1, . . . K relative to the
real eigenvalues read:
à ! Z t à !
(1) (1)
Σj,k (t) −Γj s Σj,k
(2) = e (1) e−λk s ds (77)
Σj,k (t) 0 Σ j,k
Z t à (1) (2)
!
−(γ j +λk )s Σj,k cos (ω j s) − Σj,k sin (ω j s)
= e (1) (2) ds,
0 Σj,k sin (ω j s) + Σj,k cos (ω j s)

which implies
Z t
e−(γ j +λk )s cos (ω j s) ds
(1) (1)
Σj,k (t) ≡ Σj,k (78)
0
Z t
e−(γ j +λk )s sin (ω j s) ds
(2)
−Σj,k
0
(1) ¡ ¢ (2) ¡ ¢
= Σj,k C t; γ j + λk , ω j − Σj,k S t; γ j + λk , ω j

and
Z t
e−(γ j +λk )s sin (ω j s) ds
(2) (1)
Σj,k (t) ≡ Σj,k (79)
0
Z t
e−(γ j +λk )s cos (ω j s) ds
(2)
+Σj,k
0
(1) ¡ ¢ (2) ¡ ¢
= Σj,k S t; γ j + λk , ω j + Σj,k C t; γ j + λk , ω j .

18

Electronic copy available at: https://ssrn.com/abstract=1404905


Finally, using again (73)-(73), the conditional covariances (72) among the pairs
of entries j = 1, . . . J relative to the complex eigenvalues read:
à (1,1) (1,2) ! Z t à (1,1) (1,2) !
Σj,hj (t) Σj,hj (t) −Γj s
Σj,hj Σj,hj −Γ0 s
(2,1) (2,2) = e (2,1) (2,2) e hj ds (80)
Σj,hj (t) Σj,hj (t) 0 Σj,hj Σj,hj
Z t µ ¶
−(γ j +γ hj )s cos ω j s − sin ω j s
= e
0 sin ω j s cos ω j s
à (1,1) (1,2) ! µ ¶
Σj,hj Σj,hj cos ωhj s sin ωhj s
(2,1) (2,2) ds
Σj,hj Σj,hj − sin ωhj s cos ωhj s

Using the identity


à ! µ ¶µ ¶µ ¶
e
a eb cos ω − sin ω a b cos α sin α
≡ , (81)
e
c de sin ω cos ω c d − sin α cos α

where
1 1
e
a ≡ (a + d) cos (α − ω) + (c − b) sin (α − ω) (82)
2 2
1 1
+ (a − d) cos (α + ω) − (b + c) sin (α + ω)
2 2
eb ≡ 1 (b − c) cos (α − ω) + 1 (a + d) sin (α − ω) (83)
2 2
1 1
+ (b + c) cos (α + ω) + (a − d) sin (α + ω)
2 2
1 1
e
c ≡ (c − b) cos (α − ω) − (a + d) sin (α − ω) (84)
2 2
1 1
+ (b + c) cos (α + ω) + (a − d) sin (α + ω)
2 2
e 1 1
d ≡ (a + d) cos (α − ω) + (c − b) sin (α − ω) (85)
2 2
1 1
+ (d − a) cos (α + ω) + (b + c) sin (α + ω)
2 2
we can simplify the matrix product in (80). Then, the conditional covariances
among the pairs of entries j = 1, . . . J relative to the complex eigenvalues read

(1,1) 1 ³ (1,1) (2,2)


´
Sj,hj;t = Sj,hj + Sj,hj Cγ j +γ hj ,ωhj −ωj (t) (86)
2
1 ³ ´
(2,1) (1,2)
+ Sj,hj − Sj,hj Dγ j +γ hj ,ωjh −ωj (t)
2
1 ³ ´
(1,1) (2,2)
+ Sj,hj − Sj,hj Cγ j +γ hj ,ωhj +ωj (t)
2
1 ³ ´
(1,2) (2,1)
− Sj,hj + Sj,hj Dγ j +γ hj ,ωjh +ωj (t) ;
2

19

Electronic copy available at: https://ssrn.com/abstract=1404905


(1,2) 1 ³ (1,2) (2,1)
´
Sj,hj;t ≡ Sj,hj − Sj,hj Cγ j +γ hj ,ωhj −ωj (t) (87)
2
1 ³ ´
(1,1) (2,2)
+ Sj,hj + Sj,hj Dγ j +γ hj ,ωjh −ωj (t)
2
1 ³ ´
(1,2) (2,1)
+ Sj,hj + Sj,hj Cγ j +γ hj ,ωhj +ωj (t)
2
1 ³ ´
(1,1) (2,2)
+ Sj,hj − Sj,hj Dγ j +γ hj ,ωjh +ωj (t) ;
2

(2,1) 1 ³ (2,1) (1,2)


´
Sj,hj;t ≡ Sj,hj − Sj,hj Cγ j +γ hj ,ωhj −ωj (t) (88)
2
1 ³ ´
(1,1) (2,2)
− Sj,hj + Sj,hj Dγ j +γ hj ,ωjh −ωj (t)
2
1 ³ ´
(1,2) (2,1)
+ Sj,hj + Sj,hj Cγ j +γ hj ,ωhj +ωj (t)
2
1 ³ ´
(1,1) (2,2)
+ Sj,hj − Sj,hj Dγ j +γ hj ,ωjh +ωj (t) ;
2

(2,2) 1 ³ (1,1) (2,2)


´
Sj,hj;t ≡ Sj,hj + Sj,hj Cγ j +γ hj ,ωhj −ωj (t) (89)
2
1 ³ (2,1) (1,2)
´
+ Sj,hj − Sj,hj Dγ j +γ hj ,ωjh −ωj (t)
2
1 ³ (2,2) (1,1)
´
+ Sj,hj − Sj,hj Cγ j +γ hj ,ωhj +ωj (t)
2
1 ³ (1,2) (2,1)
´
+ Sj,hj + Sj,hj Dγ j +γ hj ,ωjh +ωj (t) .
2
Similar steps lead to the expression of the autocovariance.

20

Electronic copy available at: https://ssrn.com/abstract=1404905

You might also like