Tell me more ×
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

Suppose I have two time series $X$ and $Y$ of stock prices. How do I measure the "similarity" of $X$ and $Y$?

(I'm being deliberately vague as I don't have a particular application, and I'm curious about different approaches in general. But I guess you can imagine that there's some stock x that I don't want to trade directly, for whatever reason, so I want to find a similar stock y to trade in its place.)

One method is to take a Pearson or Spearman correlation. To avoid problems of spurious correlation (since the price series likely contain trends), I should take these correlations on the differenced or returns series (which should be more stationary).

What are other similarity methods and their pros/cons?

share|improve this question

3 Answers

I assume you're using returns (or log returns) instead of actual stock prices. In practice, you may also want to smooth the data by using a moving average.

There are several correlation coefficients:

\begin{equation} r = \frac{\sigma_{x,y}}{\sigma_x \sigma_y} \end{equation}

  • Spearman's $\rho$ - uses the rank of each data set (array index if data had been sorted); less sensitive to outliers in the sample as it's non-parametric:

\begin{equation} d_i = x_i - y_i \end{equation}

\begin{equation} \rho = 1 - \frac{6\Sigma d_{i}^{2}}{n(n^{2}-1)} \end{equation}

  • Kendall's $\tau$ - also based on ranking, but represents the probability that the two data sets are in the same order vs. the probability that they are in different orders:

\begin{equation} \tau = \frac{C - D}{\frac{1}{2} n(n - 1)} \end{equation}

\begin{equation} \Gamma = \frac{C - D}{C + D} \end{equation}


$C$ is the number of concordant pairs and $D$ is the number of discordant pairs.

share|improve this answer

You can look at cointegration.

share|improve this answer
I suppose this would only work for long-term investments. – Owe Jessen Mar 30 '11 at 9:01
So do I but I'm not completly sure of that. I would like to here if people think this could work for short term investement if cointegration is found on high frequency data. – Zarbouzou Mar 30 '11 at 9:16
1  
@owe jessen - curious what you mean when you say futures and OI are cointegrated since although related, one measures price and the other measures quantity. – Joshua Chance Mar 30 '11 at 15:55
1  
That takes me back some time - I took the levels of the SP500, Volume SP 500 and OI of SP500-Futures, tested for cointegration and couldn't dismiss two relationships. Dito for the time-dependent (GARCH) Volatility of the SP500. I'm not shure why the different units should pose a problem. – Owe Jessen Apr 1 '11 at 15:53
1  
No, there was no correctorion of this kind. I didn't develop a trading simulation, so i can't say if it is really tradeable, but I also found a significant (negative) influence of first differences of open interest on the level of the SP500 when used as additional variable in the mean equation of a GARCH model. Sadly I can't publish the results in detail because this was propriatory research. I generally used the method of Floros, Christos (2007): Price and Open Interest in Greek Stock Index Futures Market. In: Journal of Emerging Market Finance, p. 191–202. – Owe Jessen Apr 2 '11 at 11:46
show 2 more comments

If you use a Box-Jenkins model, look at this research which uses an ARIMA framework to define clusters, and then measures the similarity of the time series via a cepstral coefficient based upon the autoregressive parameters.

http://www.csee.umbc.edu/~kalpakis/homepage/papers/ICDM01.pdf

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.