# Causality between multiple time series

I have 1000 financial time series (closing prices), I am using Toda-Yamamoto test. It is impossible to calculate the causality manually as there are $C_{1000}^{2-1000}$ cases.

Is there a way in which I could calculate the causality mutually?

• The original question is (with a minor tweak) okay, the update places it more clearly off topic. I have edited to remove that addition. The updated question would belong elsewhere but the original question was asked-and-answered and should not have been changed after it was answered.. – Glen_b May 6 '17 at 7:49

If you want to test for Granger causality of each pair, both ways ($x \rightarrow y$ and $y \rightarrow x$), you can do it in a nested loop. Let a pair of series be indexed $(i,j)$. The outer loop would be over $i$ from 1 to 1000; the inner loop would be over $j$ from 1 to 1000; and you would skip cases where $i=j$. That would exhaust all pairs $(i,j)$ and would test the causality both ways.