• No results found

Cointegration-based pairs trading : an empirical evaluation of the protability.

N/A
N/A
Protected

Academic year: 2021

Share "Cointegration-based pairs trading : an empirical evaluation of the protability."

Copied!
57
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Master Thesis Financial Econometrics

Faculty of Economics and Business

Cointegration-based Pairs Trading

An Empirical Evaluation of the Protability

Author:

Casper Eimers

Student number:

5922097

Supervisor:

Prof. Dr. C.G.H. Diks

Second marker:

Dr. S.A. Broda

3rd February 2014

(2)

Contents

1 Introduction 2

2 Cointegration-based pairs trading 4

2.1 Pairs trading in relation to market neutrality . . . 4

2.2 Cointegration . . . 5

2.3 Pairs trading using the cointegration approach . . . 7

3 Methodology 11 3.1 A comparison of approaches . . . 12

3.1.1 The integral equation approach . . . 12

3.1.2 The Maximum Sharpe Ratio (MSR) approach . . . 19

3.1.3 A comparison of distributions . . . 21

3.2 Cointegration-based pairs trading using empirical data . . . 24

3.2.1 Pairs selection . . . 24

3.2.2 Training and trading periods . . . 26

3.2.3 Measurement criterion . . . 28

3.2.4 The trading evaluation . . . 29

4 Data 33 5 Results 35 5.1 Theoretical results . . . 35

5.2 Empirical results . . . 38

6 Summary and conclusion 45

A List of stocks 48

B Results pairs selection process 49

(3)

Chapter 1

Introduction

In light of the recent turbulence and volatility on nancial markets, a large set of trading strategies based on varying concepts have been developed, claiming to earn positive returns regardless of the mar-ket regime. One of these reliable trading strategies, as researchers have claimed, is pairs trading. This trading strategy aims to exploit short-term deviations from a long-run equilibrium pricing relationship between two (or more) assets (Vidyamurthy, 2004). In case of a temporary anomaly between prices of the two related assets, the idea is to simultaneously short the relatively overvalued asset and buy the relatively undervalued asset. Assuming that the two assets will again converge to their long-run equilibrium value, a prot can be made by unwinding the positions once this happens. Although the idea underlying pairs trading seems disarmingly simple, many question arise about how the strategy should be implemented and more importantly, whether pairs trading truly generates prots under dierent market conditions over time.

While a number of approaches can be used to implement pairs trading, this thesis focuses on the cointegration approach, as this approach is the most interesting to analyze from an econometric point of view. Moreover, the method is generally favored over other approaches, as it incorporates mean reversion into the trading framework, which is the single most important condition required for pairs trading to be successful (Schmidt, 2008). Previous studies concerned with implementation of the cointegration-based pairs trading strategy include Alexander and Dimitriu (2002), Vidyamurthy (2004), Lin et al. (2006), Galenko et al. (2007) and Puspaningrum (2012). However, the studies by Lin et al. (2006) and Puspaningrum (2012) are fundamentally dierent from the rest, because they employ a new method within the same method called the cointegration coecients weighted rule (CCW), introducing the denitions of upper and lower trades and boundaries.

Extending the study by Lin et al. (2006), Puspaningrum (2012) introduces the integral equation approach to determine the pre-set boundaries that maximize the prot of the pairs trading strategy. Based on this methodology, she nds, similar to other studies in the eld (Habak, 2002; Hong and

(4)

Susmel, 2003; Do and Fa, 2008), signicant positive returns from cointegration-based pairs trading. Yet, this thesis shows that there are some serious drawbacks to the method suggested by Puspaningrum (2012). Furthermore, the method is based on restrictive and unrealistic assumptions, calling into question the validity of the results presented in her study. In order to overcome these drawbacks, this thesis introduces the Maximum Sharpe Ratio (MSR) approach to determine the pre-set boundaries that maximize the protability of the cointegration-based pairs trading strategy developed by Lin et al. (2006). Hence, this thesis is mainly concerned with the question how protable the pairs trading strategy is based on the MSR approach. In addition, it is interesting to investigate whether this new method outperforms the integral equation approach proposed by Puspaningrum (2012). Finally, this study also analyzes the impact of dierent distributions of the cointegration error, the key variable within this pairs trading approach, on the values of the pre-set boundaries.

Comparing both methodologies based on historical data on the S&P 500, the ndings in this study demonstrate that use of the MSR method leads to a better performance of the pairs trading strategy in terms of protability for this particular dataset. In fact, the pairs trading strategy outperforms the market under dierent market regimes: both tranquil and volatile. Furthermore, it performed particularly well in the volatile market regime, which is line with claims made in the existing literature on pairs trading (Do et al., 2006; Gatev et al., 2006). Finally, it was found that the impact of dierent distributions of the cointegration error on the values of the pre-set boundaries becomes larger as uctuations in the error increase. Hence, assumptions regarding the distribution of the cointegration error become more relevant as its standard deviation becomes larger.

The structure of this thesis is as follows. Chapter 2 briey recalls the denition of cointegration and provides information on the concept of cointegration-based pairs trading, based on the study by Lin et al. (2006). Chapter 3 presents the methodology, introducing the integral equation and MSR approach together with an extensive discussion of their limitations and advantages. Furthermore, it shows how both approaches should be adapted in case the cointegration error follows a distribution other than the Gaussian. Chapter 4 elaborates on the data set used to evaluate the protability of the pairs trading strategy, while Chapter 5 presents an overview of the results of this evaluation. Chapter 6 provides a summary and concludes.

(5)

Chapter 2

Cointegration-based pairs trading

In recent years the concept of cointegration, introduced by Engle and Granger (1987), has started to play an increasingly prominent role in portfolio optimization and funds management. The statistical properties of cointegration make it a popular approach within the practice of pairs trading. Section 2.1 elaborates on pairs trading, relating it to market neutrality. In Section 2.2 the concept is briey introduced and some denitions are given. Finally, Section 2.3 further discusses how cointegration can be used for pairs trading strategies.

2.1 Pairs trading in relation to market neutrality

Since its introduction in the mid-1980s, pairs trading has been one of the most popular quantita-tive arbitrage strategies used by hedge fund managers. The strategy's aim is to exploit short term mispricing, by simultaneously buying relatively undervalued assets and shorting relatively overvalued assets1. Based on this description, Do et al. (2006) claim that pairs trading falls under the umbrella

of long/short investing strategies. According to them, this set of strategies can be decomposed into two categories: market neutral strategies and pairs trading strategies. Consequently, does this mean market neutrality and pairs trading strategies are mutually exclusive?

In order to answer this question, a denition of market neutrality is needed. Fund and Hsieh (1999) argue that a strategy satises the property of market neutrality if it generates returns which are fully independent of the market returns. Such a strategy exhibits zero systematic risk and is in-terpreted to possess a market beta equal to zero, meaning returns are purely derived from the assets' alphas. In their papers, Lin et al. (2006) and Nath (2003) implicitly assume that pairs trading satises market neutrality. They describe it as a riskless strategy, suggesting its riskless nature originates from simultaneously going long and short on certain assets, such that the combined long/short

po-1For the remainder of this thesis, the term 'relatively' will be left out, though the denition remains the same.

(6)

sition cancels out the systematic risk and protects the trading outcomes against market-wide price movements.

Although both authors have a reasonable argument, Alexander and Dimitriu (2002) argue that long/short investing strategies (including pairs trading) need not be market neutral by construction, unless they are specically designed to have a market beta equal to zero. However, according to Alexander and Dimitriu (2002), there is another explanation why such strategies can still be immunized against systematic risk, without requiring a market beta of zero: proven interdependencies within the assets in which positions are taken. These interdependencies ensure that over a given trading period the assets will converge to an assumed price equilibrium, for example, on the basis of a cointegration relationship. So Lin et al. (2006) and Nath (2003) were actually correct in describing pairs trading as a market neutral strategy, but weren't able to provide the right explanation. Market neutrality cannot be guaranteed by simply holding a long/short position, but proven interdependencies within the chosen assets (convergence) combined with a market beta equal to zero will lead to a market neutral strategy. However, as economists like to phrase it: There ain't no such thing as a free lunch. In other words, risk-free investment strategies generating excess returns do not exist. One of the fundamental risks that pairs trading faces, is the uncertainty whether the long-run equilibrium, mean reverting relationship, on which protability is based, will still hold in the near future. If this relationship ceases to exist, the pairs trading portfolio would face both systematic and rm-specic risks. In the worst case scenario, the prices of the assets in which positions are taken continue to diverge, which could possibly lead to substantial losses if these positions are not closed in time. Hence, it can be concluded that for pairs trading to be protable, the assumption of mean reversion is critical.

Disregarding any extensions, four main approaches may be used to implement pairs trading: the distance approach, the stochastic spread approach, the combined forecast approach, and the cointe-gration approach. In this thesis, the focus will mainly be on the last approach, primarily because the cointegration approach is the only method that can guarantee mean reversion, which is the single most important feature of a successful pairs trading strategy (Schmidt, 2008). Furthermore, using daily historical prices of stocks listed on the Amsterdam Stock Exchange (AEX), Yakop (2011) concludes that, based on the Sharpe Ratio (Sharpe, 1994), the cointegration approach outperforms all other pairs selection methods. Hence, it might prove fruitful to further investigate the protability of this trading strategy.

2.2 Cointegration

Within the practice of pairs trading, cointegration has become a popular approach to select trading pairs, mainly because of its desirable properties such as stationarity and mean reversion. Before introducing the concept of cointegration, consider a set of variables {yi,t}, i = 1, . . . , m, including a

(7)

long-run equilibrium:

β1y1,t+ β2y2,t+ · · · + βmym,t= µ + εt, (2.2.1)

where m is the number of variables in the cointegration equation, µ is the long-run equilibrium, and εt

is the cointegration error, which is stationary in case the set of variables {yi,t} is indeed cointegrated

with cointegrating vector β = (β1, β2, . . . , βm)

0

. In matrix form, Eq. (2.2.1) becomes:

β0yt= µ + εt, (2.2.2)

where yt= (y1,t, y2,t, . . . , ym,t)

0

. The cointegration error εtcan be expressed as the deviation from the

long-run equilibrium µ and is dened as follows in matrix form: εt= β

0

yt− µ. (2.2.3)

The denition of cointegration as stated in the paper of Engle and Granger (1987) is given as follows.

Denition of cointegration The components of vector yt in Eq. (2.2.2) are integrated of order

(d,b), denoted by yt∼ CI(d, b),if:

1. All components of ytare integrated of order d.2

2. There exists a vector β such that β0yt∼ I(d − b), b > 0.The vector β is called the cointegrating

vector.

Other important conditions or aspects of cointegration that require attention are:

• For a cointegration relationship to exist, all variables must be integrated of the same order. However, the inverse does not have to hold, meaning that similarly integrated variables do not imply that they are integrated.

• In case yt has m components, the maximum number of linearly cointegrating vectors equals

(m − 1).

• The linear combination of non-stationary variables is not unique. Using notations, if (β1, β2, . . . , βp)

0

is a cointegrating vector, then for a non-zero λ, (λβ1, λβ2, . . . , λβp)is a cointegrating vector as well.

It is common to normalize (β1, β2, . . . , βp)

0

with respect to y1,t by setting λ equal to 1/β1.

Ways to test for the presence of cointegration will be outlined in Chapter 3.

(8)

2.3 Pairs trading using the cointegration approach

This thesis is conned to the cointegration relationship between two variables only, namely the two stocks forming a pair. Consider two stocks S1 and S2, whose prices are both I(1) processes. Assuming the stock prices PS1,t and PS2,t are cointegrated, a cointegration relationship can be constructed as

follows:

PS1,t− βPS2,t= µ + εt, (2.3.1)

where εtis the cointegration error, which is a stationary time series in case the stock prices are indeed

cointegrated. Equation (2.3.1) shows that a portfolio that is long 1 unit of stock S1 and short β units of stock S2 has a long-run equilibrium equal to the value of µ and deviations from this value are equal to εt. Since εtis known to be a I(0) process, the property of mean reversion ensures that the portfolio

will revert to its long-run equilibrium value.

As Vidyamurthy (2004) points out, the basic idea of cointegration-based pairs trading is to go long the portfolio when the cointegration relation (PS1,t− βPS2,t)falls below a certain level relative to the

long-run equilibrium (µ − ∆) and short the portfolio when it reaches a certain level above the long-run equilibrium ( µ + ∆). Once the portfolio mean reverts to µ, positions are closed, which results in a prot equal to $∆ per trade. Note that the prot dened here does not take into account additional costs like transaction costs and/or the costs associated with illiquidity. The main challenge for this study, and the approach in general, is to nd the value of ∆ such that the protability is maximized. One way to approach this problem is given by Lin et al. (2006), who develop a pairs trading strategy based on the cointegration coecients weighted (CCW) rule. Basically, the CCW rule guarantees a specic minimum prot per trade, given the fundamental assumption that the existence of the observed dynamics of εtcontinues in the future and that the long/short positions are based on the cointegration

coecients. The strategy proposed by Lin et al. (2006) is briey introduced below. Before explaining the strategy, some important assumptions are given:

1. PS1,tand PS2,tin Eq. (2.3.1) are cointegrated over the trading period t = 1, . . . T.

2. New positions may not be opened until the positions from the last trade are closed. 3. Short sales are allowed and no interest is charged.

4. There are no transaction costs and/or other additional costs involved with trading. 5. β > 0 in Eq. (2.3.1)

The rst three assumption are fairly straightforward. Assumption 4 simplies the analysis, while the fth assumption allows the pairs trading strategy to be carried out.

Let NS1and NS2denote the amount of stocks S1 and S2 traded, respectively. Two types of trades

(9)

Upper-trades (U-trades)

• A position is opened at time to when the value of the cointegration error equals or exceeds the

pre-set threshold U (εto ≥ U ): stock S1 is overvalued while S2 is undervalued relative to their

long-run equilibrium relationship. An amount NS1is sold, while a number NS2 is bought at the

same time.

• Denote the time of closing a position by tc. When the cointegration error is less than or equal

to zero at time tc (εtc ≤ 0), S1 is undervalued while S2 is overvalued relative to their long-run

equilibrium relationship. Now the positions are closed by buying back NS1units of S1 and selling

NS2 units of S2.

Using the CCW rule and choosing NS1= 1and NS2= β according to the cointegration relationship

in Eq. (2.3.1), this leads to following prot P per U-trade3.

P = NS1[PS1,to− PS1,tc] + NS2[PS2,tc− PS2,to]

= [PS1,to− PS1,tc] + β[PS2,tc− PS2,to]

= [((εto+ µ) + βPS2,to) − ((εtc+ µ) + βPS2,tc)] + β[PS2,tc− PS2,to]

= (εto− εtc) ≥ U.

Hence, choosing the weights of the long/short positions according to the cointegration relationship, results in a prot per U-trade of at least U units of the currency the stocks are traded in.

Lower-trades (L-trades)

• For L-trades, the opposite happens. Positions are opened at to (long NS1 units S1, short NS2

units S2) when εto ≤ L (L < 0), because at this time stock S1 is undervalued while S2 is

overvalued relative to their equilibrium.

• Subsequently, the positions are closed at tc(short NS1units S1, long NS2units S2) when εtc≥ 0,

because S1 is now overvalued while S2 is undervalued relative to their equilibrium.

Let NS1 = 1 and NS2 = β. Based on the same derivation of the minimum prot per U-trade, the

minimum prot for an L-trade is as follows.

P = [PS1,tc− PS1,to] + β[PS2,to − PS2,tc] = (εtc− εto) ≥ −L, with L < 0.

Puspaningrum (2012), who bases her study on the CCW rule, assumes that the distribution of the cointegration error is perfectly symmetric, meaning deviations from the mean, µ, are identical for

(10)

the upper- and lower-threshold. Consequently, she sets L = −U, which results in a minimum prot of U per trade for L-trades as well. In contrast to Puspaningrum (2012), no assumptions are made regarding symmetry of the distribution of εtin this thesis. Hence, trading 1 unit of S1 and β units of

S2leads to a minimum prot per L-trade of −L instead of U, where L < 0.

Following the approaches by Lin et al. (2006) and Puspaningrum (2012), the optimal pre-set threshold values U and L can be found by maximizing the minimum total prot (MTP) over a specic trading period. Denoting the trading horizon by t = 1, 2, . . . T , MTP is given by:

MTP= P · NT, (2.3.2)

where P is the minimum prot per trade, equal to U or −L depending on the type of trade; NT denotes the number of trades within the interval [1, . . . , T ]. P is predetermined (by choosing a specic threshold), though NT is inuenced by several factors: the length of the trading interval [1, . . . , T ], but also the distance between the long-run equilibrium and the pre-set thresholds, ∆. In fact, P = ∆, but in order to make a clear distinction between their denitions depending on the context, dierent symbols are used. A higher value for the pre-set boundary leads to a higher minimum prot per trade, but the number of trades NT will decrease, since the bound is less frequently reached4. For a lower

pre-set boundary, NT will increase, but the minimum prot per trade decreases. The key question is how to nd the optimal trade-o, i.e., the optimal threshold.

Vidyamurthy (2004) estimates NT by calculating the rate of zero crossings and level crossings for dierent values of the pre-set thresholds, and thus dierent ∆. Assuming the cointegration error is described by an ARMA process, he uses Rice's formula (Rice, 1945) to calculate both rates, so that the total number of trades can be calculated for dierent values of ∆. The value of ∆ that maximizes MTP in Eq. (2.3.2) is then the optimal threshold. However, Puspaningrum (2012) criticizes this method. She claims that use of Rice's formula is not entirely correct, because it estimates the number of threshold crossings without any restrictions as to when the positions will be closed. She suggests to use the rst-passage time for stationary series, which calculates the time needed for the series to cross a certain threshold and then return to the mean of the series for the rst time. This method is based on the integral equation approach introduced by Basak and Ho (2004) and will be described in the next chapter.

Although each of these approaches will have its advantages and disadvantages, all of them are subject to the same criticism: if the relationship between PS1,tand PS2,t changes such that the series

are not cointegrated anymore, the cointegration relation in Eq. (2.3.1) results in spurious estimators (Lim and Martin, 1995). As a result, the assumption of mean reversion does not have to hold any longer and the analysis of the cointegration error becomes unreliable. Therefore, it must be emphasized that the pairs trading strategy evaluated in this thesis cannot guarantee the same protability when

(11)

applied in practice. Still, ndings from this study might provide additional insights in the protability of pairs trading under dierent kinds of market conditions.

(12)

Chapter 3

Methodology

The method used in this study can be divided into two main sections. Section 3.1 is concerned with nding the optimal threshold values for a cointegration-based pairs trading strategy from a theoretical perspective, where the optimality of the thresholds is determined by theoretical criteria, including the MTP criterion dened in Eq. (2.3.2)1. In contrast to Puspaningrum (2012) who assumes a normally

distributed cointegration error, this study looks at a variety of assumptions regarding the distribution of εt, including asymmetric distributions. The impact of these dierent assumptions on the optimal

threshold values is analyzed using two approaches: the integral equation (IE) approach (Basak and Ho, 2004), and the Maximum Sharpe Ratio (MSR) approach. First, Subsections 3.1.1 and 3.1.2 introduce both approaches, directly followed by a discussion regarding their advantages and limitations. An overview of the characteristics of the IE and MSR method is also provided. In order to determine the impact of a dierent distribution for εton the optimal threshold value, Subsection 3.1.3 analyzes how

the approaches should be adapted.

Section 3.2 is concerned with the same problem, but from an empirical point of view. Using data on the Standard & Poor (S&P) 500, the protability of the pairs trading strategy developed by Lin et al. (2006) is evaluated using the threshold values which are found by maximizing the Sharpe Ratio (Sharpe, 1994) as the MSR method implies. The integral equation method, however, still uses the MTP criterion to determine the optimal threshold values. First, Subsection 3.2.1 discusses the pairs selection method, followed by an explanation regarding the selection of the 'training' and 'trading' periods in Subsection 3.2.2. Next, Subsection 3.2.3 elaborates on the denition of optimal, introducing an appropriate measurement criterion for the protability of the pairs trading strategy. Finally, Subsection 3.2.4 explains the procedure of the trading evaluation.

1Optimal, in terms of maximizing the minimum total prot as dened in (2.3.2).

(13)

3.1 A comparison of approaches

Assuming the cointegration error is characterized by an ARMA process, Vidyamurthy (2004) uses Rice's formula (Rice, 1945) to calculate the rate of threshold crossings for dierent values of the thresholds, in order to obtain the value that maximizes the prot function. This function is dened as P = ∆ × N T,where 4 denotes the threshold value and NT is determined as a function of 4. However, Puspaningrum (2012) stresses that the use of Rice's forumula is incorrect, because it does not take into account when the trade will be closed (when εt≤ 0for U-trades and εt≥ 0for L-trades). She suggests

to use the integral equation approach, based on the paper of Basak and Ho (2004). However, Subsection 3.1.1 points out some serious drawbacks of this method, which may be crucial for the determination of the optimal threshold values and hence the protability of the pairs trading strategy. Therefore, this thesis introduces the MSR approach, which uses a simulation in the theoretical framework. In this way, both approaches can be compared and their validity can be evaluated. The comparison is done using historical data on the S&P 500 and explained in Section 3.2.

3.1.1 The integral equation approach

This subsection provides steps to obtain an estimate of the number of trades for a specic trading period, followed by a numerical algorithm to determine the optimal threshold values. First, a number of denitions concerned with the integral equation is given. Second, assuming an AR(1) process for the dependent variable, the concept of mean rst-passage time is introduced, which forms the basis of the integral equation method. Third, a numerical procedure is provided to calculate the average trade duration, the inter-trade interval, and the number of trades within a specic trading period. Fourth, the numerical algorithm proposed by Puspaningrum (2012) is summarized, which is used to calculate the optimal threshold values. Finally, the benets and drawbacks of this approach are discussed. It should be emphasized, however, that the derivations in this section are very brief. For more detailed derivations, one is referred to the papers of Basak and Ho (2004) and Puspaningrum (2012).

First, a number of denitions concerned with the integral equation and pairs trading is introduced: • Trade duration: The time between opening and closing a U- or L-trade. Or in other words, the

time needed for εtto revert back to the mean, after having crossed the threshold.

• Inter-trade interval: The time between closing the last U-trade (L-trade) and opening a new U-trade (L-trade). In other words, the time needed for εt to cross the threshold (again) after

having returned to the mean.

• Period: The sum of the trade duration and the inter-trade interval.

To further illustrate the meaning of these terms, Fig. 3.1.1 shows an example of two cointegrated stocks.

(14)

Figure 3.1.1: Two cointegrated stocks (S1 and S2) with E[εt] = 0and threshold value U = 0.5.

Looking at Fig. 3.1.1, εtcrosses the upper-bound U for the rst time at t = 14, meaning a trade is

opened by simultaneously selling S1 and buying S2. At t = 97, εt≤ 0, so the trade is closed by taking

the opposite positions. The next trade is opened when the value εt= 0.5is crossed again at t = 149.

In this example the trade duration (T D) equals 83 days, the inter-trade interval (IT ) is 52 days and the period sums up to 135 days.

Mean rst-passage time

Using the background material from Basak and Ho (2004), the mean rst-passage time for an AR(1) process is now introduced. First, consider the following stationary AR(1) process:

yt= φyt−1+ ξt, (3.1.1)

where {ξt} ∼NID(0, σ2ξ)and −1 < φ < 1. Then, the rst-passage time Ia,b(y0)is dened as follows:

Ia,b(y0) = min{t : yt> bor yt< a | a ≤ y0≤ b}.

Moreover,

Ia(y0) =Ia,∞(y0) = min{t : Yt< a | y0≥ a}

and

Ib(y0) =I−∞,b(y0) = min{t : Yt> b | y0≤ b}.

(15)

Dene a discrete-time Markov process {Yt} ∈ R on a probability space {Ω, F , P} with stationary

and continuous transition density f(y x), which denotes the density of reaching y at the next time step, given that the present state is x. Setting Y0 = y0 ∈ [a, b], the mean rst-passage time over the

interval [a.b] of the AR(1) process in Eq. (3.1.1), starting at inital state y0, is given by:

E [Ia,b(y0)] =

ˆ b a

E [Ia,b(u)] f (u | y0)du + 1.

Based on the specication in Eq. (3.1.1) with {ξt} ∼NID(0, σξ2), f(u | y0)is the normal density with

mean φy0and variance σξ2. Hence,2

E [Ia,b(y0)] = 1 √ 2πσξ ˆ b a E [Ia,b(u)] e  −(u−φy0)2 2σ2ξ  du + 1. (3.1.2) The integral equation in Eq. (3.1.2) is a Fredholm type of the second kind, which can be solved numerically using the Nystrom method (Atkinson, 1997) as shown in the next paragraph.

Consider E [Ia,b(y0)]as in Eq. (3.1.2) and dene h = (b−a)/n, where n is the number of partitions

in [a, b] and h is the length of each partition. Using the trapezoid integration rule (Atkinson, 1997), Eq. (3.1.2) can be approximated by

ˆ b a E [Ia,b(u)] e  −(u−φy0)2 2σ2ξ  du ≈ h 2 n X j=0 wjE [Ia,b(uj)] e  −(uj −φy0)2 2σ2ξ  , (3.1.3) where wj =    1, for j = 0 and j = n, 2, for j 6= 0 and j 6= n.

Let En[Ia,b(y0)]denote the approximation of E [Ia,b(y0)]using n partitions. Substituting Eq. 3.1.3

in Eq. 3.1.2 gives the following expectation: En[Ia,b(y0)] ≈ h 2√2πσξ n X j=0 wjEn[Ia,b(uj)] e  −(uj −φy0)2 2σ2 ξ  + 1. (3.1.4)

Setting y0 equal to ui for i = 0, 1, . . . n, Eq. (3.1.4) can be reformulated as

En[Ia,b(ui)] − n X j=0 h 2√2πσξ wjEn[Ia,b(uj)] e  −(uj −φy0) 2 2σ2ξ  = 1.

(16)

Based on the derivations by Puspangingrum (2012), an approximation of En[Ia,b(uj)] can then be

obtained by solving the following linear equations:      

1 − Z(u0, u0) −Z(u0, u1) · · · −Z(u0, un)

−Z(u1, u0) 1 − Z(u1, u1) · · · −Z(u1, un)

... ... ... ... −Z(un, u0) −Z(un, u1) · · · 1 − Z(un, un)

            En[Ia,b(u0)] En[Ia,b(u1)] ... En[Ia,b(un)]       =       1 1 ... 1       (3.1.5) where Z(ui, uj) = h 2√2πσξ wje  −(uj −φy0)2 2σ2 ξ  for i, j = 1, . . . n. Trade duration and inter-trade interval

Now that the basics of the integral equation method have been introduced, the trade duration and inter-trade interval can be calculated using the analytical expressions given above. Consider the cointegration error εt in Eq. (2.2.1), which is assumed to be described by an AR(1) process, i.e.

εt= φεt−1+ ηt, (3.1.6)

where {ηt} ∼ NID(0, σ2η). As dened in the beginning of this subsection, the trade duration is the

time between opening and closing a trade. In case of a U-trade, the trade is opened when εt≥ U and

closed when εt ≤ 0.Given that εt equals U (a trade is opened), the expected trade duration equals

the time needed on average for εt to pass 0 for the rst time. Hence, calculating the expected trade

duration for a U-trade is essentially the same as calculating the mean rst-passage time for εtto cross

the value 0 for the rst time, given that the initial value is U. Denote T DU as the expected trade

duration corresponding to the upper-bound U. Using Eq. (3.1.2), the trade duration for a U-trade can be dened as T DU = E [I0,∞(U )] = lim b→∞ 1 √ 2πση ˆ b 0 E [I0,b(s)] e  −(s−φU )22σ2 η  ds + 1. (3.1.7) For an L-trade, this becomes:

T DL= E [I−∞,0(L)] = lim b→−∞ 1 √ 2πση ˆ 0 b E [Ib,0(s)] e  −(s−φL)22σ2 η  ds + 1. (3.1.8) The inter-trade interval is the time between closing the last U-trade (L-trade) and opening a new U-trade (L-trade). Therefore, calculating the expected inter-trade interval is equal to calculating the mean rst-passage time for εt to pass U (or L) given that the initial value is 0. Now, let ITU denote

(17)

the expected inter-trade interval for the upper-threshold U. Then ITU can be dened as: ITU = E [I−∞,U(0)] = lim −b→−∞ 1 √ 2πση ˆ U −b E [I−b,U(s)] e  − s2 2σ2η  ds + 1. (3.1.9) In a similar way, ITL is given by

ITL= E [IL,∞(0)] = lim b→∞ 1 √ 2πση ˆ b L E [IL,b(s)] e  − s2 2σ2η  ds + 1, (3.1.10) where L < 0. Number of trades

The next step is to derive the expected number of U-trades E[NU] over a specic trading horizon

[1 . . . T ]. The derivation for the expected number of L-trades E[NL] is left out, as it would be a

replication of the derivation of E[NU]with T DU and ITU replaced by T DL and ITL. The evaluation

of the exact value of E[NU] is rather complex, so a possible range of values of E[NU] is provided.

First, the expected number of periods corresponding to U-trades, E[NU P], will be evaluated in the

trading period [1 . . . T ] as it is linked to the concepts of trade duration and inter-trade interval. Next, the relationship between NU and NU P will be used to obtain a range of values of E[NU].

Denote PeriodUi as the length of the period corresponding to the ith trade with threshold value U,

then T ≥ E "NU P X i=1 (PeriodUi) # = ∞ X k=1 " k X i=1 E[PeriodUi] # P (NU P = k). (3.1.11)

Because the period is dependent on the distribution of εt, which is a stationary variable, it holds that

E[PeriodUi] = E[PeriodU]. Consequently, Eq. (3.1.11) becomes

T ≥ E [PeriodU] ∞

X

k=1

kP (NU P = k) = E [PeriodU] E [NU P] .

Hence, the upper-bound is dened as follows: E [NU P] ≤ T E [PeriodU] = T T DU + ITU .

The lower-bound follows from: T < E "NU P+1 X i=0 (PeriodUi) # = E [PeriodU] E [NU P+ 1] , resulting in

(18)

E [NU P] < T E [PeriodU] − 1 = T T DU + ITU − 1. Thus, T T DU+ ITU ≥ E [NU P] > T T DU+ ITU − 1.

However, the relationship NU = NU P only holds when the nal upper-trade is not closed before

T. In case the nal upper-trade is closed before T , the relationship becomes NU = NU P + 1. So the

range of values for E[NU]equals:

T T DU+ ITU + 1 ≥ E [NU P] + 1 ≥ E [NU] ≥ T T DU+ ITU − 1.

Relying on the same derivation of E[NU], the range of values for the expected number of L-trades,

E[NL], can be shown to equal

T T DL+ ITL + 1 ≥ E [NLP] + 1 ≥ E [NL] ≥ T T DL+ ITL − 1.

Assuming an AR(1)-process and using the integral equation approach to calculate T DU and ITU,

Puspaningrum (2009) approximates the number of upper-trades within the interval [1 . . . T ] bydNU = T

T DU+ITU−1.Comparing these results with a simulation independently repeated 40 times, she concludes

that small dierences exist, due to a slight dierence in the framework underpinning the theory of integral equations.

Optimal pre-set threshold

In Section 2.3, the denition of the minimum total prot has been introduced: MTP= P ·NT , where P is the minimum prot per trade and NT denotes the number of trades within the trade interval [1 . . . T ]. Restricting ourselves to U-trades, while using the analytical expression derived above, it follows that:

N T = E [NU] ≥

T T DU+ ITU

− 1. (3.1.12)

As shown in Section 2.3, the prot per U-trade is equal to or larger than U. Combined with Eq. (3.1.12), the minimum total prot within trading period [1, . . . , T ] can be redened as:

MTPU = U  T T DU + ITU − 1  . (3.1.13) Similarly, MTPL= −L  T T DL+ ITL − 1  . (3.1.14)

(19)

3.1.13. Maximization is carried out using the following algorithm proposed by Puspaningrum (2012): 1. Consider all U ∈ [0, b] where b is chosen as 5σε, because εtis a stationary process so the probability

that εt exceeds 5σεis close to zero.

2. Form a sequence of pre-set threshold values Uk, where Uk= k × 0.01, and k = 0, . . . , b/0.01.

3. For each Uk,

(a) calculate E [I0,b(Uk)]as the trade duration T DUkusing 3.1.7.

(b) calculate E [I−b,Uk(0)]as the inter-trade interval ITUk using 3.1.10.

(c) calculate MTPU =  T T DUk+ITUk − 1  Uk.

4. Find Uo∈ {Uk}such that MTPU(Uo)is the maximum.

Advantages and limitations of integral equation

Although the theory underlying the integral equation method might not be straightforward (Basak and Ho, 2004), the numerical algorithm proposed by Puspaningrum (2012) is relatively easy to use. Furthermore, it guarantees fast calculation of the optimal threshold values for the cointegration-based pairs trading strategy developed by Lin et al. (2006). What should be emphasized, however, is that Puspaningrum's (2012) research involving the integral equation is based on the assumption of a normally distributed cointegration error εt, which may be described by either an AR(1) or AR(2)

process. So the analytical expressions given in Subsection 3.1.1 only hold for these specic assumptions, i.e. {ηt} ∼ N (0, ση)and {εt} follows an AR(1) process. As a result, the algorithm dened above is

only valid under these restrictive assumptions. Besides, Puspaningrum (2012, p. 67) herself argues that it is dicult to generalize the integral equation approach for processes other than AR(1) and AR(2):

The methodology can be extended for AR(p) processes, p > 2. However, there is a challenge in numerical scheme for AR(p) processes, p < 2, in calculating trade duration and inter-trade interval as it involves more than two integrals. For p > 2 the numerical scheme will become more and more complex.

Also, extending the analysis to distributions other than the Gaussian distribution becomes a complex matter under the integral equation framework. As a result, important properties like asymmetry cannot be examined when evaluating the protability of the pairs trading strategy. Extending the analysis by Puspaningrum (2012), this thesis will examine asymmetric cointegration errors as well. The Student's t-distribution, often used for the modelling of asset returns, forms an exception within the integral equation framework. Subsection 3.1.3 shows how the integral equation approach should be adapted when εtfollows this (more realistic) distribution.

(20)

Another issue is the denition of optimal. The research regarding optimal bounds discussed so far, focusses on optimality in terms of Minimum Total Prot (MTP). This, however, is not an appropriate criterion to determine the protability of a trading strategy, as it does not take into account one of the major factors within trading strategies, risk. For the remainder of this thesis, optimal refers to the highest prot/risk ratio. Details about the measure of risk are discussed in Section 3.2. Within the theoretical framework, one possible way to incorporate risk into the criterion, is adjusting the prot by dividing it by its standard deviation, as is done in the MSR method. Within the integral equation framework, however, no standard deviation of the prot or any other possible measure of risk is available. As a result, the approach is tied to one (inappropriate) criterion: the Minimum Total Prot (MTP) dened in (2.3.2). This also holds true for the empirical framework: while the MSR approach determines the optimal thresholds by maximizing the Sharpe Ratio, the analytical expressions of the integral equation method are tied to the MTP criterion, such that the approach can only optimize the thresholds based on this criterion.

The nal drawback of the integral equation approach is the limited utilization of information available to determine the optimal threshold value and evaluate the protability of the pairs trading strategy. When using historical data on the S&P 500, an empirical estimate of the cointegration error εtis readily available after having identied the related pair and regressed the corresponding stocks.

It should be mentioned that the process of selecting pairs, testing for cointegration and running the corresponding regression is extensively discussed in Section 3.2. Based on this data, the optimal threshold values can be calculated and the protability of the trading strategy can be accurately determined using these optimal thresholds, which is done in the trading process dened in 3.2.4. Instead, the integral equation approach only uses the empirical estimate of the standard deviation, ˜ση

from Eq. (3.1.6) together with ˜φ to calculate the optimal bounds which are based on a criterion that does not take risk into account (MTP), leaving valuable data unused.

3.1.2 The Maximum Sharpe Ratio (MSR) approach

As becomes clear from the previous subsection, the integral equation approach has, despite its ease of use, a few serious drawbacks. Fortunately, another way of determining the optimal bounds of a cointegration-based pairs trading strategy is the MSR method, which uses a simulation within the theoretical framework. Principally, this approach is, just like the integral equation method, based on the numerical algorithm proposed by Puspaningrum (2012). Focusing on upper trades, the simulation can be briey described by the following steps:

1. Generate the cointegration error εt according to a specic distribution and specication.

2. Form a sequence of pre-set threshold values Uk, where Uk= k × 0.01.

(21)

(a) Form a sequence i ∈ [1, . . . , T ]. Open a trade when εi > Uk and close that trade when

εj < 0, where i < j and j ∈ [1, . . . , T ]. For each trade made, calculate T Dn and ITn, with

nthe index for the number of the trade.

(b) Calculate the average trade duration and inter-trade interval within [1, . . . , T ]: AT DU = 1 NU PNU n=1T Dn and AITU = 1 NU−1 PNU n=1ITn.

(c) Repeat steps (a) and (b) R times, with R the number of replications. (d) Calculate the mean of the R average trade durations 1

R

PR

r=1AT DU,r as E [T DUk].

Calcu-late the mean of the R average inter-trade intervals 1 R

PR

r=1AITU,r as E [ITUk], with r the

index for the number of replications. (e) Calculate MTPU =  T E[T DUk]+E[ITUk]− 1  Uk.

4. Find Uo∈ {Uk}such that MTPU(Uo)is the maximum.

Advantages and limitations of MSR (simulation)

In contrast to the numerical algorithm used by Puspaningrum (2012), the algorithm used for the simu-lation looks more complicated and its calcusimu-lation requires more time. On the other hand, it oers more exibility since it allows εtto be characterized by any distribution and specication. Naturally, within

the framework of nancial returns, only a small number of distributions and specications remain realistic and relevant to examine. Distributions examined in Subsection 3.1.3 include the Gaussian distribution, the Student's t-distribution and the skew normal distribution. Relevant specications for the cointegration error include AR(1) and GARCH(1,1) processes.

Within the integral equation framework, there is no analytical expression for risk measures available, meaning it is tied to an inappropriate criterion: the Minimum Total Prot dened in (2.3.2). Using a simulation, this issue can be avoided by repeating the trading simulation for an arbitrary number of times (step 3(c) in the algorithm). The R replications ensure a standard deviation of the prot can be obtained, which serves as the risk measure. To clarify this, step 3 and 4 in the algorithm should be modied as follows, where apostrophes are used to indicate the modications:

3. For each Uk,

(a) Form a sequence i ∈ [1, . . . , T ]. Open a trade when εi > Uk and close that trade when

εj< 0, where i < j and j ∈ [1, . . . , T ]. For each trade made, calculateT Dnand ITn, with n

the index for the number of the trade.

(b) Calculate the average trade duration and inter-trade interval within [1, . . . , T ]: AT DU = N1U P

NU

n=1T Dn and AITU = NU1−1P NU

n=1ITn.

(b') Based on AT DU and AITU, calculate the minimum total prot in [1, . . . , T ]: MT PU =



T

AT DU+AITU − 1

 Uk.

(22)

(c) Repeat steps (a) - (c) R times, with R the number of replications. (d) Calculate the mean of the R average trade durations from (b), E [T DUk] =

1 R

PR

r=1AT DU,r.

Calculate the mean of the R average inter-trade intervals from (b), E [ITUk] =

1 R

PR

r=1AITU,r,

with r the index for the number of replications.

(d') Calculate the mean of the R minimum total prots from (c),E[MTPU] = R1P R

r=1MTPU,r,

where MTPU,r reects the minimum total prot corresponding to replication r. Then,

de-termine the standard deviation of the prot: σM T PU =

q 1 R PR r=1(MTPU,r− E [MTPU]) 2 .

(e) Calculate the Risk Adjusted Minimum Total Prot, RAMTPU =

   T E[T DUk]+E[ITUk]−1 ! σM T PU   Uk.

4. Find Uo∈ {Uk}such that RAMTPU(Uo)is the maximum.

Accounting for the variation in the total prot, the RAMTPU is a more adequate criterion for the

determination of the optimal threshold values.

Table 3.1 below presents an overview of the two approaches together with their characteristics within each framework.

Table 3.1: Overview of the characteristics of the integral equation and Maximum Sharpe Ratio ap-proach for the theoretical and empirical framework.

Integral equation Maximum Sharpe Ratio Theoretical

framework Input: Parameters σ((3.1.6))η and φ R simulated cointegrationerrors, with pre-specied distribution and specication Criterion: MTP ((2.3.2)) MTP or RAMTP Empirical

framework Input: Parameters ˜σbased on empiricalη and ˜φ estimate of εt

Empirical estimate of εt

Criterion: MTP Sharpe Ratio ((3.2.6))

3.1.3 A comparison of distributions

As Puspaningrum (2012) argues, the cointegrated stocks may, in practice, not follow all of the assump-tions made in her research. The cointegration error may not be symmetric or may not be described by an AR(1) process. Indeed, the assumption of a purely symmetric and normally distributed cointegra-tion error seems unrealistic. Therefore, apart from the normal distribucointegra-tion, this thesis examines two other, more realistic distributions: the non-standardized Student's t-distribution and the skew normal distribution. While the t-distribution allows for fat tails, the skewed normal distribution can ensure asymmetries, which are typical properties for series related to nancial returns.

(23)

To analyzes the impact of distributions other than the Gaussian distribution on the optimal thresh-old value, both the approaches described in Subsections 3.1.1 and 3.1.2 should be adapted. While the simulation can incorporate dierent distributions and specications by simply generating εt

accord-ing to these assumptions (step (1) in the algorithm dened above), the modication of the integral equation method is not as straightforward. In fact, the latter approach cannot be used to examine the skewed normal distribution, as nding analytical expressions for this distribution in the integral equa-tion framework is infeasible. Still, the impact of the non-standardized t-distribuequa-tion on the optimal threshold values can be analyzed, using the steps described in the next paragraph.

The non-standardized t-distribution

Recall the integral equation in Eq. (3.1.2) for a normally distributed cointegration error which follows the AR(1) process dened in Eq. (3.1.6):

E [Ia,b(ε0)] = 1 √ 2πση ˆ b a E [Ia,b(u)] e  −(u−φε0)2 2σ2η  du + 1, (3.1.15) where {ηt} ∼NID(0, σ2η)is the error term in Eq. (3.1.6) and ε0 takes the value of U or L depending

on the type of trade. The probability density function is given by: f (u | ε0) = 1 √ 2πση e−  (u−φε0)2 2σ2η  .

The t-distribution can be generalized to a three parameter location-scale distribution, using a location parameter µ and a scale parameter σ:

X = µ + σT ,

where T follows the t-distribution. The resulting non-standardized t-distribution has the following probability density function:

f (t) = Γ v+1 2  √ vπσΓ v 2  1 + 1 v  t − µ σ 2!− v+1 2 ,

where v denotes the number of degrees of freedom and Γ represents the gamma function. Note that σ does not correspond to a standard deviation, it simply sets the overall scaling of the distribution.

Assuming the error term in Eq. 3.1.6 follows a non-standardized t-distribution, i.e. {ηt} ∼ t(v),

the integral equation in Eq. 3.1.15 becomes: E [Ia,b(ε0)] = Γ v+12  √ vπσΓ v 2  ˆ b a E [Ia,b(u)] 1 + 1 v  u − φε0 σ 2!− v+1 2 du + 1. (3.1.16)

(24)

Following the approach in Subsection 3.1.1, Eq. 3.1.16 can be approximated using the trapezoid integration rule (Atkinson, 1997), which results in:

En[Ia,b(ui)] ≈ hΓ v+1 2  2√vπσΓ v2 n X j=0 wjEn[Ia,b(uj)] 1 + 1 v  uj− φui σ 2!− v+1 2 du + 1.

Note that ε0 has been set equal to ui for i = 0, 1, . . . n. Similar to the approach in 3.1.1, an

approxi-mation of En[Ia,b(uj)]can be obtained by solving the linear equations in Eq. 3.1.5.

Furthermore, the trade duration and inter-trade interval for a U-trade are given by:

T DU = E [I0,∞(U )] = lim b→∞ Γ v+12  √ vπσΓ v2 ˆ b 0 E [I0,b(s)] 1 + 1 v  s − φU σ 2!− v+1 2 ds + 1. ITU = E [I−∞,U(0)] = lim −b→−∞ Γ v+12  √ vπσΓ v2 ˆ U −b E [I−b,U(s)]  1 + 1 v s σ 2− v+1 2 ds + 1.

Consequently, the number of trades and the minimum total prot can be calculated, which are required to determine the optimal threshold values based on the numerical algorithm proposed by Puspaningrum (2012) in Subsection 3.1.1.

The skew normal distribution

Another potential feature of nancial returns worth analyzing is asymmetry. One distribution that al-lows the cointegration error to be (slightly) asymmetrically distributed is the skew normal distribution. Its probability density function is given by

f (t) = 2 ωφ  x − ξ ω  Φ  α x − ξ ω  ,

where ξ,ω and α denote the location, scale and skewness parameters respectively. Φ (· · · ) represents the cumulative distribution function given by

Φ(x) = ˆ x −∞ φ(t)dt, with φ(x) = 1 2πe −x2

2 .The distribution is right skewed for α > 0 and left skewed for α < 0. Note that

the standard normal distribution can be recovered by setting α = 0.

Unfortunately, the integral equation method cannot be used to evaluate the protability of a pairs trading strategy where the cointegration error follows a skew normal distribution. Deriving analytical expressions similar to those in Subsection 3.1.1 become infeasible in this case. However, the MSR

(25)

approach allows the cointegration error to be generated according to a skew normal distribution, using the MATLAB program provided by Azzalini (2005). Results of the impact of both these distribu-tions on the optimal threshold value (and therefore the protability of the pairs trading strategy) are presented in Chapter 5.

3.2 Cointegration-based pairs trading using empirical data

Using data on the S&P 500, the protability of the pairs trading strategy developed by Lin et al. (2006) is evaluated using the optimal threshold values found by either of the two approaches discussed in Section 3.1. As Table 3.1 shows, the MSR method determines the optimal threshold values through maximization of the Sharpe Ratio (Sharpe, 1994), while the integral equation approach maximizes the MTP. Before analyzing the protability of the trading strategy, however, a number of steps is required. First, the relevant pairs must be selected using one or more cointegration tests discussed in Subsection 3.2.1. Second, the training and trading periods are determined in Subsection 3.2.2. In the training period, the pairs are selected based on their cointegration relationship during that period. Then, assuming the relationship still holds in the adjacent period, the protability of the pair is evaluated: the trading period. Third, the measurement criterion that is used to determine the protability of the pairs trading strategy, is dened in Subsection 3.2.3, while Subsection 3.2.4 discusses the actual procedure regarding the trading evaluation.

3.2.1 Pairs selection

One of the crucial elements of a protable pairs trading strategy is pairs selection. In the case of cointegration-based strategies, cointegration tests are the key to selecting trading pairs. Whether the cointegration relationship in Eq. (2.3.1) exists can be tested by two generally used techniques: the Engle-Granger two-step method developed by Engle and Granger (1987), and the technique developed by Johansen (1988). The rst step of the Engle-Granger approach is to test whether both time series are integrated of the rst order. One possibility is the ADF (augmented Dickey-Fuller) test, which is used to test for the presence of a unit-root and hence whether a series is stationary or not. In case both time series are integrated of the same order, a cointegration relationship may be present. The second step is estimating the relationship in Eq. (2.3.1) using OLS (Ordinary Least Squares). Then, the ADF test can be used to check whether the residual series is stationary or not, where stationarity implies that the two series are indeed cointegrated.

While the Engle-Granger approach is easily implemented in practice, the method contains signif-icant drawbacks. The two-step cointegration procedure is sensitive to the way variables are ordered, such that the residuals may have dierent sets of properties depending on the specic ordering. Fur-thermore, it could be that the bivariate series are not cointegrated, resulting in spurious estimators

(26)

that mislead the practitioner to use a particular pair for his (her) trading strategy while he (she) should actually not (Lim and Martin, 1995). To overcome these drawbacks, Johansen's approach uses a vector error-correction model (VECM), which has the advantage of analyzing the cointegration relationship between variables simultaneously in one system.

Based on the theory in Heij et al. (2004), consider a vector autoregressive (VAR) process of order pfor ytas follows: yt= p X j=1 Φjyt−j+ εt, (3.2.1)

where ytis a m-dimensional vector of variables integrated of the same order and Φjreect the (m×m)

coecient matrices; εtdenotes the m-dimensional cointegration error. Following the derivations in Heij

et al. (2004), Eq. (3.2.1) can be transformed into the following VECM specication: ∆yt= Πyt−1+ p−1 X j=1 Γj∆yt−j+ εt, (3.2.2) where Γj =P j−1 i=1Φi− I and Π = P p

j=1Φj− I. The matrix Π can be decomposed into two (m × r)

matrices such that Π = αβ0,where β represents the cointegrating vectors. The matrix α contains

the adjustment coecients, which measures the rate at which each variable adjusts to the long-run equilibrium.

The existence of cointegration and the number of stochastic trends for the m series in yt depends

on the rank of the matrix Π. One can consider three cases of interest, namely:

1. Rank(Π) = m. There are no stochastic trends in this case, meaning all m series are stationary. 2. Rank(Π) = 0, hence Π = 0. The VAR polynomial Φ(z) contains m unit roots and the variables

are not integrated.

3. 0 < Rank(Π) = r < m. Hence, yt contains r linearly independent cointegrating vectors and

m − rstochastic trends (or unit roots).

To determine the number of cointegration relations, Johansen (1988) developed a likelihood ratio test known as the Johansen trace test. The LR-test for the null hypothesis that rank(Π) = r versus the alternative that rank(Π) ≥ r + 1 is given by:

LR(r) = 2 (log (Lmax(m)) − log (Lmax(r))) = − (T − p) m

X

j=r+1

log(1 − ˆλj). (3.2.3)

where ˆλj denote the squared canonical correlations between the residuals of ∆ytand yt. In case the

(27)

the LR-test does not have the usual χ2-distribution, because the regressors y

t−1in Eq. (3.2.2) contain

stochastic trends under the null hypothesis. Instead, the test follows a Dickey-Fuller-type distribution which depends on m − r and the presence of deterministic components in the VECM test equations (Dickey and Fuller, 1979).

In line with the method employed by Puspaningrum (2012), rst, Johansen's trace test is carried out to ensure that the selected stock pairs have a long-run equilibrium relationship. A signicance level of α = 0.05 is used to select the cointegrated pairs. Second, the Engle-Granger approach is used to obtain the cointegration error and double-check that a cointegration relation exists. Due to practical reasons, the residual series from the OLS regression of the Engle-Granger approach are used instead of the cointegration error obtained from the Johansen method. Moreover, to check for robustness of the estimates for the cointegrating vector and cointegration error, the cointegration equations are also estimated using a VECM specication.

Both methods are applied to daily data on the S&P 500. Further details regarding the data are discussed in Chapter 4. For the Johansen method, however, the identied pairs are re-tested using weekly data. This re-test is used as a test of robustness, following the approach by Schmidt (2008). Although the choice on what day to base this test is not critical, this thesis uses Wednesday as in Schmidt (2008). This choice is based on the presumption that Wednesday is most insulated from specic market irregularities like thin-trading at the start and end of the week, which might lead to potentially biased pricing patterns. The main motivation for using this secondary test for cointegration based on weekly data, is to further reduce the probability that particular pairs are selected for trading, while they are actually not cointegrated. After all, every pairs trading strategy should only base trades on pairs of stocks which exhibit a robust cointegration relationship.

3.2.2 Training and trading periods

The next step is to determine the periods in which the protability of the pairs trading strategy is evaluated. Although earlier literature (Gatev et al., 2006; Yakop, 2011; Puspaningrum ,2012) tends to set the trading period (out-sample data) equal to half of the formation/training period (in-sample data), no standard rules apply for the determination of these periods. However, as Puspaningrum (2012) argues, the training period needs to be suciently long, so that it is possible to determine whether a cointegration relationship exists or not. Regarding the trading period, it needs to be suciently long to have opportunities to open and close trades, so that the protability of pairs trading can be properly evaluated. On the other hand, it cannot be too long, because there is a possibility that the cointegration relationship between the stocks in an identied pair (in the training period) may change or even disappear.

In line with previous works (Gillespie and Ulph, 2001; Habak, 2002; Do and Fa, 2008) a 6-month trading period is used for evaluation of the protability. However, contrary to studies by Yakop (2011)

(28)

and Huurman (2012), this thesis follows the method employed by Puspaningrum (2012) and sets the training period equal to 3 years instead of 12 months. An overview of all training and trading periods analyzed in this thesis is shown below in Table 3.2:

Table 3.2: Training and trading periods for two dierent market regimes Training period Trading period Bull January 2003 - December 2005 January 2006 - June 2006 Bear July 2005 - June 2008 July 2008 - December 2008

Before explaining the choice of these particular periods, Fig. 3.2.1 shows the historical prices of the S&P 500 index between January 2003 and December 2009.

Figure 3.2.1: Historical price of the S&P 500 index January 2003 - January 2010

Apart from the historical prices of the index, the Fig. 3.2.1 also indicates the dierent training and trading periods analyzed in this thesis. A dotted line marks the end of a training period, while a solid line marks the end of a trading period. Consequently, the trading periods lie between the dotted and solid lines. The starting points of the training periods are not indicated in the gure, but they are simply 3 years prior to the corresponding dotted line. The terms formation period and training period are used interchangeably throughout this thesis.

The motivation for choosing these two specic trading periods is based on the presence of a bull market in one of the periods and a bear market in the other, as is reected in Fig.3.2.1. From January 2003 until June 2007 there is a clear upward trend in the price of the S&P 500, signifying a bull market (tranquil market regime). Starting from January 2008, however, the price of the index shows a clear downward trend, eventually resulting in a stock market crash in September 2008, which is the beginning of the credit crisis (volatile market regime). For convenience, the 2003-2007 period is referred to as the bull period, while the 2005-2009 period is referred to as the bear period for the remainder of this

(29)

thesis. Analyzing the protability of a pairs trading strategy using optimal threshold values in both these periods gives insights how well the strategy performs under dierent market regimes. Moreover, by making a distinction between periods with high (bear) and low (bull) volatility, it can be checked whether pairs trading indeed performs particularly well during times of highly volatile markets when the mispricing of securities is most likely to occur, as earlier studies suggest (Do et al., 2006; Gatev et al., 2006).

3.2.3 Measurement criterion

As the end of Subsection 3.1.1 already emphasized, risk plays a major role within trading strategies. Hence, it must be taken into account when evaluating the protability of the pairs trading strategy introduced by Lin et al. (2006). In the theoretical framework, the minimum total prot is adjusted by dividing it by its standard deviation to obtain the risk-adjusted minimum total prot, which can be achieved through use of a simulation. The integral equation method, however, does not oer any alternative to incorporate risk.

A similar method is used in the empirical framework. Based on historical prices of the selected pairs contained in the S&P 500 index, the actual returns from employing a pairs trading strategy based on a specic pair can be obtained. These returns replace the former (theoretical) minimum total prot. The estimated expected return is given by ˆµ = 1

T

PT

t=1rt, where T denotes the number of trading

days. Furthermore, the standard deviation of the return series {rt}Tt=1, which replaces the theoretical

σM T PU in Subsection 3.1.2 as a risk measure, is dened as:

ˆ σ = v u u t 1 T T X t=1 (rt− ˆµ)2. (3.2.4)

A possible concern is that ˆσ does not account for any underlying serial correlation of the nancial return series, rt, which is often the case. One solution to avoid this potential problem is to

esti-mate the long-run standard deviation of the return series by the Newey-West (1987) heteroskedastic autocorrelation consistent estimator, also referred to as the HAC-estimator:

ˆ σ2= ˆγ0+ 2 K X k=1 wkˆγk, (3.2.5)

where ˆγ0 is the estimated sample variance of the return series {rt}Tt=1; ˆγk denotes the lag-k sample

covariance of the series, and wk are the Bartlett weights given by wk = 1 −K+1k ,where k = 1, . . . , K.

The number of lags K must be chosen in such a way that it captures all lags at which there exists signicant autocorrelation within the return series. In this thesis the choice for K is based on an approach by Greene (2002), who suggests to use the theoretical rule of thumb for choosing K, which species that K ≈ T1

(30)

An appropriate criterion that combines the expected return and the risk measure in Eq. (3.2.5) is the Sharpe (1966, 1994) Ratio, which is dened as the excess expected return of an investment to its return volatility:

SR = E [rt] − rf

σ , (3.2.6)

where rf denotes the risk-free return earnable in t ∈ (1, . . . , T ). Using empirical data, the estimator of

the Sharpe Ratio,SR, is found by replacing E [rc t]and σ by their empirical estimators ˆµ = T1

PT

t=1rt

and ˆσ = qˆγ0+ 2P K

k=1wkγˆk, respectively. Despite certain shortcomings, the SR has become the

market standard to measure the performance of investment and trading strategies. Therefore, it can be regarded as an appropriate criterion to evaluate the protability of the cointegration-based pairs trading strategy using optimal thresholds.

However, the Sharpe Ratio implicitly assumes that the risk-free rate is the adequate benchmark to compare the return series with. Here, in order for the comparison to be fair, an adequate benchmark should be an appropriate substitute to pairs trading. Since this study is purely based on stocks contained in the S&P 500 index, the composite index itself is more relevant than the standard risk-free rate, making it the most appropriate benchmark. In other words, in order to check whether the pairs trading strategy outperforms the market, the SR of the strategy is compared with the SR of the S&P 500. Hence, the risk-free return in Eq. (3.2.6) is set equal to zero when calculating the SRs of all pair trading combinations.

3.2.4 The trading evaluation

Before being able to evaluate the protability of the pairs trading strategy using the criterion introduced in Subsection 3.2.3, a number of steps must rst be applied. A part of these steps takes place in the training period and therefore belongs to the training process. The remaining steps are carried out in the trading period and belong to the trading process. The training process covers the following steps: 1. For each pair, the Johansen and Engle-Granger cointegration tests are performed to determine

whether there exists a cointegration relationship (see Subsection 3.2.1).

2. In case of a cointegration relationship, estimates of the cointegration error, ˆεt, and

cointegrat-ing vector, ˆβ, for each pair are obtained from the Engle-Granger cointegration equation. The correlogram of ˆεtis analyzed to check whether an AR(1) specication is appropriate.

3. If this is the case, the AR(1) model is used to obtain estimates of phi, ˆφ, and the standard deviation ˆση, where ηtis the error term in the AR(1) model in Eq. (3.1.6). The AR(1) coecients

are checked for signicance and the residuals are checked for autocorrelation.

4. Using the empirical estimate of the cointegration error together with the Sharpe Ratio in Eq. (3.2.6), the optimal threshold values (upper and lower) can be determined for the pairs trading

(31)

strategy, which is the MSR method. However, in case of the integral equation approach, the optimal threshold values are determined based on the MTP criterion. Details about how these threshold values are obtained are discussed below, under the heading Training Process. Subsequently, the trading process, in which the protability of the trading strategy is evaluated, can be described by the following steps:

5. Combining the empirical cointegration error in the trading period with the threshold values from Step 4, the realized Sharpe Ratio, SR, can be calculated . The protability of the pairs trading strategy is analyzed by comparing the strategy's SR to the SR of the S&P 500 in the same period. Details about how the SRs are obtained follow under the heading Training Process.

6. Moreover, assuming an AR(1) specication and either a Gaussian distribution or t-distribution, the residual series {εt}Tt=1 for the trading period is forecasted using the parameter estimates ˆφ

and ˆση from the model in the formation period (Step 3). Based on this forecasted cointegration

error, an expected Sharpe Ratio, E[SR], is calculated.

This procedure can be repeated for dierent pairs, and dierent training and trading periods. Training process

In order to get an easier understanding of the material discussed below, recall the cointegration rela-tionship in Eq. (2.3.1):

PS1,t− βPS2,t= µ + εt, (3.2.7)

where β denotes the cointegrating vector as before. Considering U-trades, which are relevant when εt>

0,the equation shows that stock S1 is relatively overvalued, while stock S2 is relatively undervalued. Implementation of pairs trading involves shorting S1 and buying βS2 simultaneously. For L-trades, the opposite holds.

The method used to nd the optimal threshold values in the case of historical data, is somewhat similar to the algorithm described in Subsection 3.1.2. One important dierence is that, when using historical data, an estimate of the cointegration error is obtained from the Engle-Granger cointegration equation. Hence, the step of generating εt according to some distribution and specication, can be

skipped. Another key dierence is the way protability is measured. While the theoretical simulation in 3.1.2 uses the concepts of trade duration, inter-trade interval and minimum total prot to evaluate the strategy's protability and determine the optimal bounds, the MSR method uses the criterion in Eq. (3.2.6). However, as Hong and Susmel (2003) noted, measuring the returns for pairs trading strategies might be complicated, as opening a trade usually involves selling the overvalued stock and buying the undervalued stock, which results in a negative net investment. To overcome this problem, Hong and Susmel (2003) use the concept of margin accounts, which require a collateral deposit for

(32)

a given short position. In the United States, a margin account generally requires a 50% collateral deposit, which is also the percentage used in this thesis. Hence, the initial investment in case of a U-trade equals: βPS2,t+ 0.5PS1,t,where β is the cointegrating vector as in Eq. (3.2.7).

In order to calculate the returns for the pairs trading strategy within the interval [1, . . . , T ], where T denotes the number of trading days within the training period, the variable W is introduced, which denotes the wealth (or capital) purely used for trading purposes. Restricting ourselves to U-trades and assuming a specic amount of initial wealth, W0, the wealth at time t, with t ∈ [1, . . . , T ], is

determined based on the following state-dependent scheme: 1. εt< Uk and closed positions:

• For t prior the rst trade: Wt= W0.

• For t after the rst trade: Wt= Wt−1.

2. εt> Uk and closed positions:

• A trade is opened, where the total amount of positions (POS) taken equals last period's wealth divided by the initial investment per position taken, P OSt=

Wt−1

(βPS2,t+0.5PS1,t). P OSt

is rounded down to the nearest integer. The initial cash inow from opening the trade, CIt,

is given by: CIt= P OSt(PS1,t− βPS2,t).

3. εt> 0 and open positions:

• Trade opened at time τ is not closed yet. Wtis determined by ctionally closing the current

positions at time t. In case of a U-trade, this means buying PS1,t and selling βPS2,t. The

cash outow when closing positions, COt,is then given by: COt= P OSτ(βPS2,t− PS1,t) .

Hence, Wt= Wτ+ P OSτ(PS1,τ− PS1,t+ β (PS2,t− PS2,τ)) = Wτ+ (CIτ− COt) .

• In case t = T, the open positions are forced to be closed (possibly with a loss). WT =

Wτ+ (CIτ− COT).

4. εt< 0 and open positions:

• Trade opened at time τ gets closed: Wt= Wτ+ (CIτ− COt) .

Varying the upper bound Uk, where Uk = k × 0.01, will result in dierent amounts of wealth at the

end of the training period. Therefore, introduce the wealth at time t using threshold Uk: Wt,k.

Now that the wealth can be calculated for each point in time within the training period, the returns belonging to each threshold at time t are given by:

rt,k=

Wt,k− Wt−1,k

Wt−1,k

Referenties

GERELATEERDE DOCUMENTEN

For two state-of-the-art inexact TSP solvers, LKH and EAX, we compare the scaling of their running time for finding an optimal solution to a given instance; we also compare

[r]

Despite negative results, overall trends persist, increase of the distance between opening and closing criteria enhances returns with transaction costs and ADF constraint shows

Mathcmatically, thc mcidcncc latc (mcidcncc dcnsity 01 hazaid lalc) is Ihc instantancous piobability ot an cvcnt occuncncc Thc avciagc mcidcncc latc is thc numbci of cvcnts dividcd

Proudman, January 2008 1 Background to the research method used for the Stimulating the Population of Repositories research project.. Stimulating the Population of Repositories was

Comparison of quenching efficiencies of various dye-quencher pairs for the design of an optimal ‘’activatable’’ nanoprobe for optical imaging.. van Veggel 3 and Abedelnasser

gebruikswaarde voor de praktijk onderzocht, geleverd door Custers en door Aerts Electra.. Beide systemen zijn in een mestafdeling (80

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of