Emmanuel Fua, Yi-Wei Li, Chris Melgaard

Statistics 157

Spring 2008

Pairs Trading

Introduction

“Pairs trading” is a statistical arbitrage strategy which begins with a person identifying two stocks whose movements have coincided in the past. When the prices of these two stocks move in opposite directions from one another, the strategy suggests that we short-sell the stock whose price has increased, and take a long position in the stock whose price has decreased. By taking these contrarian positions, we will profit when the two stock prices converge, because the price of the stock we took the long position in will have increased, and the price of the stock we took the short position in will have decreased.

In this paper we apply 3 models for pairs trading: using normalized prices, using cointegration, and using AR(1) simulations. We pursue the normalization strategy because it is the traditional method used by academic literature we read, and it also seems to be the simplest. The cointegration method seems to be a refinement over normalization, while fitting an AR(1) model to the spread of the data seems appropriate after we found no cointegrated pairs.

Normalized Prices

We pick our pairs over a 1 year “formation period” by matching together stocks in the same sector with maximum correlation over this time. We find that in our sample, Exxon and Chevron are the most highly correlated stocks both by Pearson and Spearman’s correlation measures (Figure 2). In the formation period, we normalize the price paths, subtract them, and plot a spread. We then test trading thresholds in increments of different multiples of the formation period spread standard deviation, calculating our returns for each one and subtracting transaction costs. We calculate returns as done by Gatev et al. (2006) by going $1 long on the loser and $1 short on the winner when the spread crosses a given threshold, then closing the position when the spread returns to its mean. Repeating this for multiple thresholds gives us a “profit function” (x=threshold, y=profit), from which we choose the threshold that maximizes our profits.

We then enter our 6 month “trading period” immediately following our formation period. We normalize the two pairs’ price paths using the mean and sd from the formation period. Next, we apply the optimal threshold we picked from the formation period, open long-short positions when the threshold is crossed, and close these positions when the prices converge, i.e. the spread returns to 0. We then calculate our returns as before. Our top pair, Exxon and Chevron, earn as much as 15% returns (Figure 2).

Figure 1: Normalized Price Paths, Picking Pairs by Correlation

Formation Period / Trading Period
Pair / Dates / Corr. / Optimal Threshold* / #Trans / Returns / Corr.
Exxon, Chevron / Period 1 / 0.93 / 1 / 6 / 0.11 / 0.85
Period 2 / 0.85 / 1.75 / 6 / 0.05 / 0.69
Period 3 / 0.93 / 1.25 / 10 / 0.15 / 0.96
Nike, McDonald’s / Period 1 / 0.87 / 1.5 / 2 / -0.05 / 0.02
Period 2 / 0.10 / 1 / 6 / -0.02 / 0.29
Period 3 / 0.87 / 2 / 4 / 0.04 / 0.87
Electronic Arts, GAP / Period 1 / 0.12 / 1 / 0 / -0.04 / 0.56
Period 2 / 0.19 / 2 / 4 / -0.03 / -0.09
Period 3 / 0.31 / 1.75 / 4 / 0.06 / 0.10

Numbers rounded to nearest tenth.

Optimal Threshold, Number of Transaction, and Returns calculated for Transaction Cost= 0.2; Lower thresholdsMore TransactionsHigher Transaction CostsLower Returns (demonstrated, not shown)

*As multiple of sd of trading period spread

Figure 2: Period 3, Exxon & Chevron

We also test this strategy for pairs that are very weakly correlated in attempt to show that it matters for our returns that we choose stocks that move together. One example is Electronic Arts and GAP Inc. In the formation period, their correlation is 0.12. Applying the same strategy as before, we see that in the trading period, we open up a position and never close it (Figure 3).

Next, we test this strategy for pairs that are highly correlated in our “formation period” but are not from the same sector, or exposed to the same risks. We show the results for McDonald’s and Nike. Their correlation in our formation period equals 0.87. Applying our methodology, however, like in the Electronic Arts and GAP example, we open up a position in the “trading period” but never close it (Figure 4). To uncover why this is the case, we found the correlation for McDonald’s and Nike in the trading period. It was 0.02. Therefore, it appears to be risky to choose pairs simply based on their correlation in a formation period. Looking at fundamentals, stocks exposed to the same risks, and stocks that appear to be close substitutes for one another seems to be important as well. In the next section, we examine an alternative framework of cointegration to choose pairs and formulate our trading strategies.

Figure 3: Period 1, Electronic Arts & Gap, Inc.

Figure 4: Period 1, McDonald’s & Nike

Lastly, it is noteworthy that all of our shown pairs, even the ones that were not very correlated, had positive profits for Period 3, which included January 2008 in which the stock market was especially volatile compared to the rest of our data. It seems that high market volatility allows the possibility for positive profits for uncorrelated pairs which do not typically generate profits in low volatility periods. However, it seems clear that such outcomes can go either way, making pairs trading during volatile periods a risky strategy.

Cointegration

Another method to selecting a pair of stocks is by determining whether or not their price paths are cointegrated. Two time series {Yt, Xt} are said to be cointegrated if a linear combination of them is a stationary process, even if Yt and Xt are both nonstationary themselves. Previous research and our own empirical results demonstrate that no pair of stocks is ever truly cointegrated, as that requires their detrended price series to be consistent to a scalar multiple. Hence, in order to pursue this strategy, we must first determine how cointegrated a pair is by the magnitude of the Dickey-Fuller Test Statistic. The test goes as follows: first, we save the residuals from regressing Yt on Xt, u-hat, we then fit an AR (1) model to u-hat and run a t-test on the coefficient. Finally, we compare the statistic obtained to a list of CRDF test statistics.

Although none of the pairs were cointegrated, we took the pair that looked most promising and calculated the cointegration factor, so that we may test this strategy and compare its returns to a normalized price path returns. In order to obtain the cointegration factor estimate, we regress Yt on Xt, where Yt and Xt are the detrended price series. The coefficient (β-hat) on Xt is then our estimate for the cointegration factor. We then use this estimate to create a spread (Y-β X) to determine thresholds and calculate returns as we did with the normalized spreads.

For our example, the pair we chose for cointegration is LUV and PLL. Following the strategy used in normalization, we took three 18-month periods over which we had 1 year of formation and 6-months of actual trading. The only significant change made is that for every dollar we put into LUV, we must put in β-hat dollars into PLL. This procedural difference follows immediately from the manner with which we calculate the spreads. Consequently, our profit calculations were also adjusted to accommodate this change. For simplicity, we used a SD metric in trying to maximize profits with respect to transaction costs. We show in Figure 5 one 18-month period a comparison of what we would’ve done using a normalized spread and a cointegrated spread.

Figure 5: Normalized strategy VS Cointegrated strategy

LUV(Southwest Airlines) &
PLL (Pall Corporation) / Normalization / Cointegration
Correlation coef. /CRDF stat.
over Formation Period / 0.24 / -0.52*
Cointegration Factor / N/A / 0.43
Optimal SD Threshold over Formation Period / 1.25 SDs / 1.75 SDs
Optimal Returns
over Formation Period / ~0% / ~2%
Number of Transactions
over Trading Period / 4 / 4
Returns
over Trading Period / ~5% / ~13%

*CRDF statistic insignificant against the H0: The Time Series is not cointegrated (5% critical value = -3.39)

**Fixed transaction costs implicit in both models

Figure 6: Normalized LUV & PLL spread VS Cointegrated LUV & PLL spread

From Figure 6, the results from the normalization strategy once again demonstrate why correlation is an imperfect measure of how related two stocks are. While we were expecting to make almost no profit going into the trading period, we actually would have missed out on this opportunity had we not engaged in pairs trading here. The cointegrated spread looks a lot more mean-reverting than the normalized spread. Here, we see that our threshold optimization methods are far from perfect, as we could have improved returns much more by lowering the SD threshold for trading.

Autoregressive

Since the Dickey-Fuller hypothesis test was inconclusive, we thought to model the spread of the “cointegrated” price paths as an AR (1) model—mainly due to the fact that the Dickey-Fuller test failed to show that the AR (1) model of the spread did not have a unit root. We will attempt to find spreads that produce coefficients with a magnitude of less than one. Not only did Vidyamurthyrecommend this strategy as a possible approach, we also feel that the spreads should be a mean-reverting process that depends mostheavily on its recent past. We decided on the order of the AR by looking at the PACF of the lags and minimizing the AIC. In the interest oftime, we decided to only implement this strategy on the most cointegrated pair: LUV and PLL.

After fitting the AR (1) model to the spread of the pair prices,we obtained the sample estimate (μ-hat) on thecoefficient of the lag, as well as an estimate of the variance of each independent and identically distributed white noise variables. Using these parameters, we randomly generated 1,000 random AR series of the formation period and calculated the optimal threshold for trading for each.This optimal threshold, like before, is based on a standard-deviationmetric. We then took the average of all 1,000 thresholds and would then usethis value as our trading threshold in the trading period.

Figure 7: Comparison between an actual spread and an AR(1) simulation of a spread

As you can see from above, the AR (1) simulation has very similar characteristics to the actual spread. They both have heavy dependence upon the short-term price history and are not that volatile in the short run.

The performance of this method of picking the threshold actually preformed fairly well in comparison to the rest of the methods that we tested. The results are shown on the table below.

Figure 8: Trading Statistics for the LUV-PLL pair using the autoregressive method of choosing thresholds

AR(1) Coefficient estimate (μ-hat) / Optimal Threshold estimate / SD of Optimal Threshold / Number of Transactions / Returns over Trading Period
0.8605 / 1.0460000 / 0.2597142 / 12 / 17.7%

Conclusion

We find Pairs Trading to be a profitable strategy, with the returns robust to low to moderate transaction costs. We believe that out of the three strategies we have examined and tried, no single one is clearly the most profitable, although fitting time series models seem the most promising, and further research could be done by fitting ARMA or GARCH models on the spreads.

References

Gatev, Evan, William N. Goetzmann, and K. Geert Rouwenhorst, “Pairs Trading:

Performance of a Relative-Value Arbitrage Rule,” Review of Financial Studies (2006): 797-827.

Vidyamurthy, Ganapathy, Pairs Trading: Quantitative Methods and Analysis (New

Jersey: John Wiley & Sons, Inc., 2004).

Wooldridge, Jefferey M., Introductory Econometrics, A Modern Approach, Third Edition

(Ohio: Thomson South-Western, 2006).

1