# Analysis of cross correlation between point-processes

I would like an advice on a analysis method I am using, to know if it it statistically sound.

I have measured two point processes $T^1 = t^1_1, t^1_2, ..., t^1_n$ and $T^2 = t^2_1, t^2_2, ..., t^2_m$ and I want to determine if the events in $T^1$ are somehow correlated to the events in $T^2$.

One of the methods that I have found in the literature is that of constructing a cross-correlation histogram: for each $t^1_n$ we find the delay to all the events of $T^2$ that fall in a given window of time (before and after $t^1_n$), and then we construct an histogram of all these delays.

If the two processes are not correlated I would expect a flat histogram, as the probability of having an event in $T^2$ after (or before) an event in $T^1$ is equal at all delays. On the other hand if there is a peak in the histogram, this suggests that the two point process are somehow influencing each other (or, at least, have some common input).

Now, this is nice and good, but how do I determine whether the histograms do have a peak (I have to say that for my particular set of data they're clearly flat, but still it would be nice to have a statistical way of confirming that)?

So, here what I've done: I've repeated the process of generating the histogram for several (1000) times keeping $T^1$ as it is and using a "shuffled" version of $T^2$. To shuffle $T^2$ I calculate the intervals between all the events, shuffle them and sum them to reconstitute a new point process. In R I simply do this with:

times2.swp <- cumsum(sample(diff(times2)))


So, I end up with 1000 new histogram, that show me the density of events in $T^{2*}$ compared to $T^1$.

For each bin of these histogram (they're all binned in the same way) I calculate the density of 95% of the histogram. In other words I'm saying, for instance: at time delay 5 ms, in 95% of the shuffled point processes there is a probability x of finding an event in $T^{2*}$ after an event in $T^1$.

I would then take this 95% value for all of the time delays and use it as some "confidence limit" (probably this is not the correct term) so that anything that goes over this limit in the original histogram can be considered a "true peak".

Question 1: is this method statistically correct? If not how would you tackle this problem?

Question 2: another thing that I want to see is whether there is a "longer" type of correlation of my data. For instance there may be similar changes in the rate of events in the two point processes (note that they may have quite different rates), but I'm not sure how to do that. I thought of creating an "envelope" of each point process using some sort of smoothing kernel and then performing a cross-correlation analysis of the two envelopes. Could you suggest any other possible type of analysis?

Thank you and sorry for this very long question.