  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.
