# How to calculate correlation between time periods

What would be the best way to calculate some sort of correlation or similarity factor between two lists of time intervals :

List1 :
1. 2010-06-06 to 2010-12-12
2. 2010-05-04 to 2010-11-02
3. 2010-02-04 to 2010-10-08
4. 2010-04-01 to 2010-08-02
5. 2010-01-03 to 2010-02-02

and List2 :
1. 2010-06-08 to 2010-12-14
2. 2010-04-04 to 2010-10-10
3. 2010-02-02 to 2010-12-16

Thanks!

This question was previously asked at StackExchange and the answer provided was a link to this article about Feature-List Cross-Correlation in the field of medical imaging. While it is plenty of useful information, it is a bit daunting for me so it was suggested to try and find a more simple intro to Vector Cross Correlation.

Anyone could provide some help on this please?

-
Please clarify what is your data. Since the time intervals overlap, I assume that you are observing 8 different random variables, but why do you separate them into lists? – mpiktas Dec 17 '10 at 7:51
@mpiktas Thanks for your comment. I am observing 2 random variables (hence 2 lists) that each generate time intervals. This is for representing 2 trading strategies that generate trades (dateOpen, dateClose). I would like to know how much correlated are their trades timings. The example I provided here could represent the trades each strategy made in 2010. Kind regards – ibiza Dec 17 '10 at 13:38
so you have two random variables with 5 observations on the first one and three on the second one? – mpiktas Dec 20 '10 at 9:22

Here's something off the top of my head.

1) Pick a statistic for your data which might measure how correlated they are (traditional notions of correlation don't apply here, because you don't have any observations -- you only have trade times). For example, you might calculate the average difference between each point in series A and its closest point in series B.

2) Generate some new data from a known distribution. In your example, you might generate series A' as five random draws from a uniform distribution and series B' as three random draws from a uniform distribution.

3) Compute your chosen statistic on your artificial data. The idea is to work out how the statistic behaves on 'random' data with no correlation.

4) Repeat steps 2 and 3 until you have a good idea what the distribution of your statistic is.

5) Compare your result to the generated distribution. If it's lying way out in the tails, you can be relatively certain that there is significant correlation between your two strategies. If it lies near the center of the distribution, then you can't reject the hypothesis that there is no correlation.

-