Independence Testing for Temporal Data

Cencheng Shen, Jaewon Chung, Ronak Mehta, Ting Xu, Joshua T Vogelstein

Abstract

Temporal data are increasingly prevalent in modern data science. A fundamental question is whether two time series are related or not. Existing approaches often have limitations, such as relying on parametric assumptions, detecting only linear associations, and requiring multiple tests and corrections. While many non-parametric and universally consistent dependence measures have recently been proposed, directly applying them to temporal data can inflate the p-value and result in an invalid test. To address these challenges, this paper introduces the temporal dependence statistic with block permutation to test independence between temporal data. Under proper assumptions, the proposed procedure is asymptotically valid and universally consistent for testing independence between stationary time series, and capable of estimating the optimal dependence lag that maximizes the dependence. Moreover, it is compatible with a rich family of distance and kernel based dependence measures, eliminates the need for multiple testing, and exhibits excellent testing power in various simulation settings.

Introduction

In modern data science, determining if two signals—such as fMRI brain scans or stock market indices—are related is a fundamental task. Standard independence tests typically assume that data points are independent and identically distributed (i.i.d.). However, time series are inherently "sticky," meaning observations at one time point are correlated with previous ones. Applying standard i.i.d. tests to such data often leads to inflated p-values and excessive false positives. Existing temporal solutions frequently fall into two traps: they either focus solely on linear correlations (like the Ljung-Box test) or require multiple testing corrections across various lags, which significantly reduces statistical power.

Methods

The authors propose a robust framework to create a Temporal Dependence Statistic that functions as a "plug-and-play" wrapper for modern dependence measures like Distance Correlation (DCorr), Hilbert-Schmidt Independence Criterion (HSIC), or Multiscale Graph Correlation (MGC). The framework follows a four-step process:

  1. Cross-Lag Computation: Dependence statistics are calculated for a range of lags to capture delayed relationships.
  2. Optimal Lag Estimation: The method identifies the lag ($\hat{L}^*$) that maximizes dependence, providing critical metadata about the relationship.
  3. Aggregation: Statistics from all lags are combined into a single weighted sum ($T_n$), eliminating the need for multiple testing corrections.
  4. Block Permutation: To calculate p-values while preserving temporal structure, the series is broken into contiguous blocks which are then shuffled. This maintains the internal "stickiness" of the series while breaking the global relationship between them.

Results

The framework was evaluated using synthetic simulations, human fMRI data, and financial market returns.

Validity and Power

A critical requirement for any independence test is maintaining the nominal false positive rate (Type I error). In simulations with independent series, the proposed temporalized tests correctly maintained a 5% rejection rate, even as the internal autocorrelation of the series increased.

Rejection probability under independence for AR(1) processes.

On nonlinear data, the proposed method using MGC or HSIC significantly outperformed the industry-standard Ljung-Box test, which failed to detect non-linear dependencies entirely.

Real-World Applications

  • Finance: Analyzing the S&P 500 revealed that while many stocks lack a linear relationship with the market at a 1-week lag, they often exhibit strong nonlinear dependence. This suggests that market volatility in one week influences stock volatility in the next, even if price directions are unpredictable.
  • Neuroscience: The fMRI analysis successfully identified strong, low-lag dependencies within functional brain regions (e.g., the Default Mode Network) and weaker, longer-lag dependencies between disparate regions.

Discussion and Limitations

While the framework is non-parametric and universally consistent, it relies on the assumption of stationarity. For non-stationary data with heavy trends, pre-processing techniques like differencing are recommended. Additionally, the computational complexity of $O(n^2 RL)$ (where $n$ is sample size, $R$ is permutations, and $L$ is max lag) may be a bottleneck for high-frequency data. Future research aims to integrate faster correlation measures to improve scalability and extend the framework toward causal inference in time series.

Summary updated

BibTeX
@article{shen2024independence,
  author = {Cencheng Shen and Jaewon Chung and Ronak Mehta and Ting Xu and Joshua T Vogelstein},
  title = {{Independence Testing for Temporal Data}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=jv1aPQINc4},
}
Figure