this chapter, we focus on defining, justifying, and interpreting thescore/distance measure. It is therefore a bit theoretical in nature. To help motivate the choice of the score/distance measure, the nexus between cointegration and arbitrage pricing theory (APT) is explored. We draw parallelsbetween the common trends model for cointegration and the ideas of APT.Conditions to be satisfied for cointegration in the common trends model aretranslated into APT constructs. This makes it possible to evaluate thescore/distance measure in the APT framework. Moreover, if the multifactorimplementation of APT is composed of fundamental variables, then the distance measure calculated relates to the fundamentals of the firm. We willthen have an easy evaluation procedure for the distance measure that isfirmly based on the fundamentals of the firm, thus satisfying the requirements of the score/distance measure.In addition, we bridge the gap between theoretical expectations andpractical observations. Assumptions, caveats, and loopholes that are encountered in the process are stated explicitly. Insights gained in the exercisewill help us understand what can go wrong and the things to beware ofwhile trading. Sources of risk are identified and quantified with a view to enhance the understanding of the dynamics involved in pairs trading and thekinds of pairs to avoid. Let us start with the common trends model.
COMMON TRENDS COINTEGRATION MODELLet us recall the common trends model from Chapter 5. We are given twoseries yt and zt, as shown in Equation 6.1.yt = nyt + ε yt
(6.1)
z t = n zt + ε ztnyt and n zt represent the so-called common trends or random walk components of the two time series; ε yt , ε zt are the stationary and specific components of the time series. If the two series are cointegrated, then their commontrends must be identical up to a scalar,nyt = γ n zt
(6.2)
where g is the cointegration coefficient. Let us examine some of the implications of the common trends model.
STATISTICAL ARBITRAGE PAIRS
88
Inference 1: In a cointegrated system with two time series, the innovationssequences derived from the common trend components must be perfectlycorrelated. (Correlation value must be +1 or –1).Let us denote the innovation sequences derived from the common trends ofthe two series as ryt and rzt. Recall from Chapter 2 that the innovation sequence for a random walk is obtained by differencing it. The innovation sequences shown here are therefore the result of differencing nyt and nzt ,respectively. In equation form, we havenyt +1 − nyt = ryt +1
(6.3)
n zt +1 − n zt = rzt +1According to the common trends model, the common trends must be identical up to a scalar.nyt = γ n zt
(6.4)
nyt +1 = γ n zt +1
(6.5)
Now, if we require
it follows from simple algebra on Equations 6.4 and 6.5 thatryt +1 = γ rzt +1
(6.6)
This means that the innovations derived from the common trends must alsobe identical up to a scalar. Incidentally, the scalar also happens to be thecointegration coefficient g. Now, if two variables are identical up to a scalar(in this case the cointegration coefficient), they must be perfectly correlated.If the cointegration coefficient is positive, then the correlation value is +1. Ifit is negative, then the correlation value is –1.Thus, in a cointegrated system the innovation sequences derived fromthe common trends must be perfectly correlated.Inference 2: The cointegration coefficient may be obtained by a regressionof the innovation sequences of the common trends against each other.Based on the preceding discussion we have a linear relationship between theinnovation sequences given asryt = γ rzt
(6.7)
Pairs Selection in Equity Markets
89
It therefore follows that the cointegration coefficient may be obtained byperforming a simple regression of one innovation sequence against the other.The cointegration coefficient is therefore given as
γ =
(
cov ry , rz
( )
var rz
)
(6.8)
DiscussionIn this section we looked at conditions necessary for cointegration. We established that the innovation sequences derived from the common trendterms must be perfectly correlated. We urge the reader to take special noteof this fact. The idea resonates throughout the chapter and forms the basisfor the scoring function.A subtle point to highlight at this juncture is that there are in effect twocorrelation measures. One correlation measure pertains to the innovation sequences of the common trend alone. This correlation value is either +1 or –1.Another correlation may be calculated on the innovation sequences of thewhole series, taking into account both the common trend and the stationarycomponents. This measure can take on a whole range of values dependingon the variance of the stationary components. The two correlation measuresare very different, and it important not to confuse one for the other.Our next point pertains to the stationarity of the common trend andspecific components of the two time series. As far as common trends go,there is no restriction on them. They can be stationary or nonstationary, andthis is neither critical nor material for cointegration. The same cannot besaid for the specific components. The definition of the common trends modelrelies on their being stationary time series. Therefore, for cointegrationto exist, it is absolutely necessary for the specific components to be stationary. By implication, the first difference of the specific component must notbe white noise, because if the differenced series were white noise, then thespecific series would be a random walk, a nonstationary series. This violatesthe stationarity condition for the specific component. Therefore, the first difference of the specific component cannot be white noise.In summary, there are two conditions that need to be satisfied for cointegration in a common trends model. First, the innovation sequences derived from the common trends of the two series must be identical up to ascalar. Next, the specific components of the two series must be stationary.Having now established an understanding of the common trends model,we turn to the issue of applying this to stock data. Application is possibleonly if we separate the time series into nonstationary/common trends andstationary/specific components. To do that, we look to arbitrage pricing
STATISTICAL ARBITRAGE PAIRS
90
theory (APT) and establish a link between APT and the common trendsmodel. This will be the focus of the discussion in the following section, oncommon trends.
COMMON TRENDS MODEL AND APTEarlier, in Chapter 2, the logarithm of stock price was modeled as a randomwalk. To accommodate the common trends model, let us modify that a little and consider the logarithm of the stock price to be a sum of a randomwalk and a stationary serieslog(pricet) = nt + et
(6.9)
where nt is the random walk, and et is the stationary component. Differencing the logarithm of stock price yields the sequence of returns. Therefore,based on Equation 6.9, the return rt at time t may also be separated into twopartslog(pricet) – log(pricet–1) = nt – nt–1 + (et – et–1)
(6.10)
rt = rtc + rts
(6.11)
where rtc is the return due to the nonstationary trend component, and rts isthe return due to the stationary component.Notice that the return due to trend component is the same as the innovation derived from the trend component. Therefore, the cointegration criterion pertaining to the innovations of the common trend may be rephrasedas follows: If two stocks are cointegrated, the returns from their commontrends must be identical up to a scalar. But why in the world should stocksever have common returns? Is there a financial rationale for these to existamong stocks? The answer to that is a resounding yes, and APT comes inhandy in providing a comprehensive explanation for this. Recalling the earlier discussions on APT, stock returns may be separated into common factorreturns (returns based on the exposure of stocks to different risk factors) andspecific returns (returns specific to the stock). If two stocks share the samerisk factor exposure profile, then the common factor returns for both thestocks must be the same. This provides us with a rationale for when wemight expect stocks to have a common return component.We are now ready to draw parallels between the common trends modeland APT. According to APT, stock returns for a time period may be separated into two types: common factor returns and specific returns. Let thesecorrespond to the common trend innovation and the first difference of the
Pairs Selection in Equity Markets
91
specific component in the common trends model. For the correspondenceto be valid, the integration of the specific returns must be a stationary timeseries.Alternately, as discussed in the previous section, the specific returnsmust not be white noise. But APT is a single time frame model and cannotprovide us with any guarantees on the time series of specific returns.We would therefore have to make that leap of faith and assume that thespecific return series is not white noise. Nevertheless, it is reassuring toknow that the validity of this assumption is tested when running the cointegration tests and pairs where the specific component is nonstationary areeliminated.Let us go ahead and make the assumption that the specific return is notwhite noise. We can now interpret the inferences from the common trendsmodel in APT terms. The correlation of the innovation sequence is the common factor correlation. Also, the cointegration coefficient may be calculated using APT constructs to evaluate the common factor variance andcovariance in its formula. Let us now formally put all of the preceding discussions into an observation.Observation 1: A pair of stocks with the same risk factor exposure profilesatisfies the necessary conditions for cointegration.Condition 1Now let us consider two stocks A and B with risk factor exposure vectors gxand x, respectively. The factor exposure vectors in this case are identical upto a scalar. We denote the factor exposures asStock A:
gx = (gx1,gx2,gx3,...,gxn)
Stock B:
x = (x1, x2, x3,..., xn)
Geometrically, it may be interpreted that the factor exposure vectors of thetwo stocks point in the same direction; that is, the angle between them iszero.If b = (b1,b2,b3,...,bn) is the factor returns vector, and rAspec and rBspec arethe specific returns for stocks A and B, then the returns for the stocks rA andrB are given as
(
)r = ( x b + x b + x b +, … , + x b ) + r
rA = γ x1b1 + x2b2 + x3b3 +, … , +bn + rAspecB
1 1
2 2
3 3
n n
specB
STATISTICAL ARBITRAGE PAIRS
92
The common factor returns for the stocks are therefore
(
rAcf = γ x1b1 + x2b2 + x3b3 +, … , + xnbnrBcf
)
= x1b1 + x2b2 + x3b3 +, … , + xnbn
Thus, rAcf = γ rBcf. The innovation sequences of the common trend are identical up to a scalar. This satisfies the first condition for cointegration as perthe common trends model.Condition 2Now consider the linear combination of the returns.
(
) (
rA − γ rB = rAcf − γ rBcf + rAspec − γ rBspec
)
The left-hand side of the equation represents the return of a portfolio longone share of A and short g shares of B. The right-hand side shows that thisreturn is separable into common factor returns and specific returns of theportfolio. Thereforecfspecrport = rport+ rport
wherecfrport= rAcf − γ rBcfspecrport= rAspec − γ rBspec
Notice that if the stocks A and B are cointegrated, then the common factorcfreturn rportbecomes zero.Additionally, the return on the long–short portfolio may also be viewedas the output from differencing the spread time series. Based on the separationof the return series, the spread series may also be represented as the sum oftwo components. One is the integrated common factor return, which we shallcall the common factor spread. The other is the integrated specific return,which we shall call the specific spread. Writing this in equation form, we havecfspreadtcf − spreadtcf−1 = rportspecspreadtspec − spreadtspec−1 = rport
spreadtport = spreadtcf + spreadtspec
Pairs Selection in Equity Markets
93
Again notice that if the stocks are cointegrated, then spreadtcf becomescfzero, because rportis zero. Therefore, when the stocks are cointegrated, thespread of the portfolio is the same as the spread due to the specificcomponents.Additionally, the spread series must be stationary for cointegration. Thiswill be true if the spread due to specific spread is stationary. The specificspread will be stationary if the integration of the specific returns of the individual specific returns of the stocks is stationary. This is indeed the assumption that we make when relating APT with cointegration. Therefore, if thisassumption bears out, we will have satisfied all the necessary conditions forcointegration.
SummaryThe driving idea in the common trends model has been to view a given timeseries as a sum of stationary and nonstationary components. The idea ofviewing a time series as a sum of component series for ease of analysis is infact a common practice. Notably, in the practical analysis of time series, theconvention is to make an implicit assumption that the series is composed oftrend, seasonal, and stochastic components. Arbitrage pricing theory declares this idea of composition rather explicitly and takes on a constructionist approach to modeling stock returns. Every risk factor in the APTmodel is associated with a time series of returns. The weighted sum of theseseries, with the factor exposures as weights, is the expected returns series fora stock. To get the actual returns, we need to add the specific return seriesto the expected returns.Two stocks with identical risk factor exposures would therefore havethe same common factor returns. In other words, the common factor returnof a long–short portfolio of the two stocks is zero. The common factor contribution to risk in this case is the least it can ever be, zero. Furthermore, ifthe integration of the specific returns of the stocks is stationary, then the twostocks are cointegrated. Thus, a key area to look for a measure of cointegration is the risk factor exposure profiles of the stocks and how closelyaligned they are.
THE DISTANCE MEASUREWe are now ready to define the distance measure. Recall from the discussions on the common trends model that the necessary condition for cointegration is that the innovation sequences derived from the common trends
STATISTICAL ARBITRAGE PAIRS
94
must be perfectly correlated. We also established that the common factor return of the APT model might be interpreted as the innovations derived fromthe common trends. The correlation between the innovation sequences istherefore the correlation between the common factor returns. The closer theabsolute value of this measure is to unity, the greater will be the degree of comovement. The distance measure we propose is therefore exactly that: theabsolute value of the correlation of the common factor returns.The formula for the distance measure is therefore given asd(A, B) = ρ =
(
)var(r ) var(r )cov rA , rBA
(6.12)
B
In APT terms, if xA and xB are the factor exposure vectors of the two stocksA and B, and F is the covariance matrix, the distance measure may be calculated as
ρ =
x A F xB
(x F x )(x F x )A
B
B
(6.13)
B
Note that in Equation 6.13 we have used only common factor terms. Thespecific variance contribution is not used.
INTERPRETING THE DISTANCE MEASUREIn previous discussions we hinted that the perfect alignment of the factorexposure vectors, that is, a zero angle between them, is indicative of cointegration. In this section we will show that the correlation measure as calculated in Equation 6.13 could actually be interpreted as the cosine of theangle between transformed versions of the factor exposure vectors corresponding to the two stocks.But why do we need to transform the factor exposure vectors? Can wenot directly measure the angle between them? We could do that but for thefact that all factors in the multifactor model are not created equal. Returnsare more sensitive to changes in some factors versus the others. We thereforeneed to transform from the space of factor exposure to the space of returnsand then measure the angle between the transformed vectors. We will discuss the exact nature of this transformation and show that correlation canindeed be interpreted as the cosine of the angle.
Pairs Selection in Equity Markets
95
Calculating the Cosine of the Angle betweenTwo VectorsIt is useful at this point to define the inner product of two vectors. Given twovectors eA and eB as follows:
()e = (e , e , … , e )Ae A = e1A , e2A , … , e NB
B1
B2
(6.14)
BN
The inner product between the two vectors is given by the formulaA Be AeB = e1Ae1B + e2Ae2B + … + e NeN
(6.15)
In matrix notation, the inner product may be represented as e AeBT, where eBTis the transpose of the vector. The length of a vector is the square root of itsinner product. Therefore, we have
( )
length e A =
e Ae TA
(6.16)
With the preceding equations, we are now ready to calculate the angle between two vectors. The steps involved in calculating the angle between twovectors are as follows.Step 1. We first evaluate the unit vectors (vectors of length one) pointingin the direction of the two vectors. We do this by scaling eachelement of the vector by its length.Step 2. The cosine of the angle between the two vectors is now the innerproduct of the unit vectors pointing in their directions.We will leave it to the reader to work out that the two stepsmay be condensed into a single formula as given in Equation 6.17.cos θ =
(
e AeBT
)(
e Ae TA eBeBT
)
(6.17)
ExampleLet us say we are required to calculate the cosine of the angle between thevectors A = (0, 2) and B = (3, 0). Calculating the lengths of these vectors, wehave
STATISTICAL ARBITRAGE PAIRS
96
length(A) =
02 + 22 = 2
length(B) =
32 + 02 = 3
We now scale each vector by dividing every element in the vector by thelength of the vector. Denoting the unit vectors in small letters, we havea = (0, 1)b = (1, 0)The cosine of the angle between the vectors is given by the inner product ofthe unit vectors.cosq = ab = 0.1 + 1.0 = 0The value of the cosine is zero, indicating that the angle between the twovectors is 90 degrees. The two vectors are indeed orthogonal to each other.
Geometric InterpretationKey to doing the geometric interpretation is the idea of eigenvalue decomposition of the covariance matrix F. A brief discussion on eigenvalue decomposition is provided in the appendix. Let the eigenvalue decompositionof F be given as UDUT. If xA and xB are the factor exposure vectors of thetwo stocks, let us consider a transformation of the two vectors as shown inEquations 6.18.eA = xAUD1/2
(6.18)
eB = xBUD1/2This is the transformation from the factor exposure space to the factorreturn space. Now, using simple matrix manipulations it is easy to verify that
( )
xA F xTA =
var rA
( )
(6.19)
( )
xBF xBT =
var rB
( )
(6.20)
)
(6.21)
length e A =length eB =
(
e AeBT = xA F xBT = cov rA , rB
Using Equations 6.19, 6.18, and 6.19, the cosine of the angle between thevectors eA and eB works out as follows:
Pairs Selection in Equity Markets
97
e AeBT
cos θ =
( )
( )
=
length e A length eB=
(
) =ρvar(r ) var(r )
xA F xBT
(x F x )(x F x )A
TA
B
=
(6.22)
TB
cov rA , rBA
B
This completes the geometric interpretation.
RECONCILING THEORY AND PRACTICESo far we have established the basis for the distance measure in theory. Wehave shown that the absolute value of the common factor correlation is agood way to measure the degree of comovement in stock prices. Let us nowexamine the practical issues surrounding it. There may be issues and sourcesof error that we may not be able to mitigate entirely. However, being awareof them and the risks they pose can provide insights into what can go wrongduring trading.
Stationarity of Integrated Specific ReturnsWe discussed earlier that the necessary condition for cointegration is that theintegration of the specific returns time series must be stationary. To verifythis directly means that we must evaluate the common factor and specific returns for each time period. Alternately, this could be verified when performing the cointegration tests.Cointegration testing involves the estimation of the cointegration coefficient and ensuring that the spread series of the long–short portfolio constructed with this ratio is indeed stationary. If the integration of the spreadseries is nonstationary, this would show up in the spread series being nonstationary. Readers can convince themselves of this by examining the observation made in the section Common Trends Model and APT. Thus, testingfor stationarity of the spread is sufficient to ensure that stationarity of the integrated specific returns, and the assumption that we make here is verified indue course.
Deviations from Ideal ConditionsFrom an APT point of view we established that two stocks will be cointegrated if their factor exposure vectors are perfectly aligned. More precisely,the common factor correlation between them must be +1 or –1. This is a
STATISTICAL ARBITRAGE PAIRS
98
rather tall order and is seldom satisfied in practice. Unless the stocks areclass A and class B shares of the same firm, it is unlikely that the stocks’ factor exposures will be perfectly aligned.If two stocks do not have their factor exposures perfectly aligned, thenany long–short portfolio composed of the two stocks will have a nonzerocomponent for the common factor returns. Our model for cointegration relies on a zero value for the common factor returns, and the violation of thisrepresents deviation from ideal conditions for cointegration. Stating theabove in formula form, we have
(
) (
rA − γ rB = rAcf − γ rBcf + rAspec − γ rBspeccfcfrportf = rport+ rport
)
(6.23)(6.24)
cfThe value of rportin Equation 6.24 is nonzero. Consequently, following thelogic from the observation in the section Common Trends and APT, thecommon factor spread is also a nonzero quantity. It is helpful to write thisin equation form.
spreadt = spreadtcf + spreadtspec
(6.25)
The common factor spread may very well be nonstationary, violating thecointegration condition of spread stationarity. But can we still make do withless than perfect conditions of cointegration? How do we quantify the deviation? Let us say that the spread series is composed of a stationary component (typically the specific spread) and a nonstationary component (typicallythe common factor spread). Let the variances of the two components be22and σ nonstationary,T. Note that the variance of the nonstationary comσ stationaryponent is specified for a time horizon T. Also, let t be the trading horizon. Ifthe change in the nonstationary component of the spread is small, we couldtreat it more or less as a constant and say that we have a cointegrated pair.A measure of the deviation from cointegration is captured in the signal-tonoise ratio as given in Equation 6.26.SNR =
σ stationaryσ nonstationary,t
(6.26)
The ideal is to have the nonstationary component as close to zero as possible. If it is exactly zero, then the signal-to-noise ratio would be infinity. Inpractice, a very large number for the ratio would make our assumption ofcointegration reasonable. Given that the variance of the nonstationary com-
Pairs Selection in Equity Markets
99
ponent increases linearly with the trading horizon, then, all things beingequal, having a shorter trading horizon is definitely closer to the ideal condition of cointegration. This is of course determined by the dynamics of thespread and the rate at which the spread oscillates about the mean.Based on Equation 6.25, the overall spread may also be interpreted asthe specific return spread with a varying mean that is dictated by the common factor spread. If the common factor spread is a nonstationary time series, then the overall spread is equal to the specific spread with a stochasticdrift to its mean value. Thus, deviation from ideal cointegration conditionsresults in what we shall call mean drift. The fallout from mean drift is thattrading with symmetric bands may not be optimal because the movement ofthe spread series may be skewed. The worse part is that it could skew eitherway depending on the movement of the common factor spread, and it is notpossible to know in advance. Also, if the common factor spread is nonstationary, then the variance of the skew scales linearly with time. An important insight to be gleaned in the process is that the mere passage of timerepresents an increase in risk in pairs trading and must be taken into accountto design time-based stop orders.
Model ErrorModel error occurs when our model specification is way off the mark. Letus say that there is dramatic news that could potentially result in a drasticchange in fundamentals of a firm. The market immediately begins theprocess of adjustment to the news, predicting in some sense where the factor exposures of the firm would be under the new circumstances.In such cases where the expectation is for a dramatic change in the factor exposure, the common factor correlation evaluated before becomesdated, and the correlation structure between the two stocks breaks down. Itis important to be aware of this and be constantly on the lookout for suchevents when trading pairs.
Numerical ExampleConsider three stocks A, B, and C with factor exposures in a two factormodel as follows:xA = [1 1]xB = [0.75 1]xC = [1 0.75].0625 .0225Let the factor covariance matrix F = .0225 .1024
STATISTICAL ARBITRAGE PAIRS
100
Step 1: Calculate the common factor variance and covariance..0625 .0225 11   = .2099.0225 .1024 1(sqrt(.2099) is the volatility, 45.8%
[
]
[
.0625 .0225 0.751 = .171 (volatility of 41.3%).0225 .1024  1 
[
.0625 .0225  1 .75    = .1539 (volatility of 39.2%).0225 .1024 .75
var(A) = 1
]
var(B) = .75
]
var(C) = 1
cov(A, B) = 1
[
.0625 .0225 .751   = .1887.0225 .1024  1 
[
.0625 .0225  1 1   = .1787.0225 .1024 .75
cov(A, C) = 1
]
]
Step 2: Calculate the correlation (absolute value of correlation is the distancemeasure).
(
)
) = 0.1887 = 0.9957.2099 × .171var( A) var(B)
(
)
) =0.1787= 0.9431.2099 × .171539var( A) var(C )
corr A, B =
corr A, C =
(
cov A, B
(
cov A, C
If we have to choose one pair for purposes of trading, based on the distancemeasure, our choice would therefore be the pair (A, B).Step 3: Calculate the cointegration coefficient. A detailed discussion on thereasoning for the formula is provided in the next chapter.
λ AB =
cov(AB) .1887== 1.1032var(B).171
λ AC =
cov(AC) .1787== 1.1613var(C).1539
Step 4: Calculate the residual common factor exposure in the paired portfolio. This is the exposure that causes mean drift.
Pairs Selection in Equity Markets
101
expAB = [1
1] – 1.1032 × [0.75
expAC = [1
1] – 1.1613 × [1
1] = [.1726
.75] = [–.1613
–.1032].129]
Step 5. Calculate the common factor portfolio variance/variance of residualexposure.
( ) [
.0625 .0225  .1726 − .1032  = .0221.0225 .1024 −.1032
]
cfvar rAB= .1726
cfσ AB=
.0021 = .046
( ) [
cfvar rAC= −.1613
cfσ AC=
.0625 .0225 −.1613.129  = .0024.0225 .1024  .129 
]
.0024 = .049
Step 6. Calculate the specific variance of the portfolio.To simplify our illustration, let us assume the specific variance for all of thestocks to be 0.0016.
( )
( )
( )
spec2var rAB= var rAspec + γ ABvar rBspec
= .0016 + 1.10322 × .0016 = .0035specσ AB=
( )
.00035 = .059
( )
( )
spec2var rAC= var rAspec + γ ACvar rCspec
= .0016 + 1.16132 × .0016 = .0037specσ AB=
.0037 = .061
Step 7. Calculate the SNR ratio with white noise assumptions for residualstock return.SNRAB =
SNRAC =
specσ ABcfσ ABspecσ ACcfσ AC
=
.059= 1.282.046
=
.061= 1.245.049
STATISTICAL ARBITRAGE PAIRS
102
Therefore, even on a signal-to-noise ratio basis the stock pair (A B) does better than stock pair (A C). Notice that having a high value for the specificrisk/variance (provided it is stationary) is highly desirable as it improves theSNR. A higher specific variance means higher stock volatility, indicating thata high volatility environment is conducive for pairs trading.
SUMMARYThe candidate list of potentially cointegr