There is a document from the cryptographic community called NIST Special Publication 800-90B, Recommendation for the Entropy Sources Used for Random Bit Generation, which is available here. Look to §5 and §6 and just come with me for a bit ☺...
90B has a test to determine whether a sequence is IID or not. By definition if a sequence is non-IID, it's correlated. Correlation is proven by certain tests that include compression. I'm unimpressed by NIST's implementation, so I have my own take on it.
There are compressors out there (like CMIX) that can compress data to within 0.1% of it's theoretical Shannon entropy. Entropy ($H$) is measured in bytes. So my test would work like this:-
Compress sequence $x$, giving $H_x$.
Compress sequence $y$, giving $H_y$.
Interleave the values from both sequences as $\left[x_i, y_i, x_{i+1}, y_{i+1},x_{i+2}, y_{i+2}...\right]$.
Compress the new interleaved sequence, giving $H_{x|y}$.
I posit that the correlation between $x$ and $y$ is related to:-
$$ \frac{H_x + H_y}{H_{x|y}} -1 $$
with 0 as no correlation at all, and 1 if $x=y$. It works because correlation is a form of redundancy. As correlation and thus redundancy increase, and $y \rightarrow x$, the compression algorithm finds it easier and easier to encode the $x|y$ sequence.
Examples:-
Two totally IID sequences have absolutely no relationship between them. No matter how they're interleaved, at whatever lag, $H_{x|y} = H_x + H_y$. Test value = 0, no correlation.
Two sequences where $y = f(x)$ and $f$ is the relationship/correlation between them. Imagine if $y = \frac{x}{n}$ and $n$ is some constant suggesting a strict correlation within the data. This tight relationship will be detected by the compression algorithm simply using a broader window. Rather than using an alphabet based on a single value, it will create a slightly bigger alphabet based on two sequential values $ \therefore H_{x|y} \approx H_x$. Test value $\approx$ 1, full correlation.
I can't prove it any further, I just invented it. It seems to kinda work though, at least in simple cases.