dCovTS: Distance Covariance and Correlation for Time Series Analysis

Michail Tsagris, Maria Pitsillou, Konstantinos FokianosOpenalex Unknown 2016 · DOI · OpenAlex

TL;DR

The dCovTS R package provides a comprehensive toolkit for detecting nonlinear dependencies in univariate and multivariate time series using distance covariance and correlation. By moving beyond traditional linear measures, it allows researchers to identify complex temporal relationships that standard autocorrelation functions often miss.

The Challenge of Nonlinearity in Time Series

Traditional time series analysis relies heavily on the Autocorrelation Function (ACF), which is based on Pearson’s correlation. While effective for linear relationships, Pearson’s correlation can fail to detect dependencies where the relationship is nonlinear or where the variables are dependent but uncorrelated (e.g., $Y = X^2$ where $X$ is symmetric around zero).

In many fields—such as finance, meteorology, and signal processing—data often exhibits "hidden" dependencies. The dCovTS package addresses this gap by implementing Distance Covariance (dCov) and Distance Correlation (dCor). These metrics have a powerful property: they are equal to zero if and only if the variables are truly independent, regardless of whether the relationship is linear or nonlinear. This makes them significantly more robust than traditional linear metrics for exploratory data analysis.

Methodology and Implementation

The package implements the "auto-distance" versions of these metrics, measuring the dependence between a time series $X_t$ and its lagged version $X_{t+j}$.

Function arguments for distance-based time series analysis in dCovTS.

Key features of the implementation include:

  • Estimators: It provides both biased estimators (based on V-statistics) and unbiased estimators (utilizing U-centered matrices). Unbiased estimators are particularly valuable for avoiding the systematic underestimation of correlation in smaller datasets, a common issue in time series analysis.
  • Multivariate Analysis: It extends these concepts to multivariate series, computing an "auto-distance correlation matrix" that captures dependencies across multiple variables over time.
  • Smoothing Kernels: For formal hypothesis testing of pairwise independence, the package includes several kernel functions (Bartlett, Daniell, Parzen, etc.) to smooth the generalized spectral density, ensuring consistent testing across different data structures.

Statistical Inference and Resampling

Because the null distribution of distance-based statistics is complex (technically, they are degenerate V-statistics), the package uses three bootstrap-based methods to calculate confidence intervals and p-values:

  1. Wild Bootstrap: Specifically designed to maintain the dependent structure of the time series data during resampling.
  2. Subsampling: Calculates critical values for each lag separately, allowing for more granular inference.
  3. Independent Bootstrap: A standard resampling approach for cases where independence is the baseline assumption.

Practical Application and Results

The core advantage of dCovTS is the ability to see structure in data that looks like white noise under a standard ACF plot. If the Auto-Distance Correlation Function (ADCF) shows significant peaks where ACF shows none, a nonlinear dependency is confirmed.

Key output components for auto-distance correlation functions.

The package includes two real-world datasets to demonstrate its utility:

  • ibmSp500: Monthly returns for IBM stock and the S&P 500 index from 1926 to 2011. This is a classic example for exploring lead-lag relationships and nonlinear dependencies in financial markets.
  • MortTempPart: A dataset containing daily cardiovascular mortality, temperature, and pollutant particulate matter in Los Angeles County (1970–1979), often used to study environmental impacts on health.

Functions like ADCFplot and mADCFplot generate intuitive visualizations of dependence across lags, complete with bootstrap-derived confidence thresholds. Furthermore, the UnivTest and mADCFtest functions provide rigorous p-values for the null hypothesis of independence, allowing for objective statistical conclusions.

Conclusion and Limitations

While dCovTS is a powerful tool, users should be aware of its computational intensity. Despite the use of optimized libraries like Rfast, distance correlation remains significantly slower than the Fast Fourier Transform (FFT) methods used for linear ACF. Very high-frequency or extremely long datasets may still pose a challenge. Additionally, while the package identifies that a dependency exists, it does not specify the mathematical form of that dependency, requiring further exploratory analysis to model the relationship fully.

Summary updated

Abstract

Computing and plotting the distance covariance and correlation function of a univariate or a multivariate time series. Both versions of biased and unbiased estimators of distance covariance and correlation are provided. Test statistics for testing pairwise independence are also implemented. Some data sets are also included. References include: a) Edelmann Dominic, Fokianos Konstantinos and Pitsillou Maria (2019). 'An Updated Literature Review of Distance Correlation and Its Applications to Time Series'. International Statistical Review, 87(2): 237&ndash;262. &lt;<a href="https://doi.org/10.1111%2Finsr.12294" target="_top">doi:10.1111/insr.12294</a>&gt;. b) Fokianos Konstantinos and Pitsillou Maria (2018). 'Testing independence for multivariate time series via the auto-distance correlation matrix'. Biometrika, 105(2): 337&ndash;352. &lt;<a href="https://doi.org/10.1093%2Fbiomet%2Fasx082" target="_top">doi:10.1093/biomet/asx082</a>&gt;. c) Fokianos Konstantinos and Pitsillou Maria (2017). 'Consistent testing for pairwise dependence in time series'. Technometrics, 59(2): 262&ndash;270. &lt;<a href="https://doi.org/10.1080%2F00401706.2016.1156024" target="_top">doi:10.1080/00401706.2016.1156024</a>&gt;. d) Pitsillou Maria and Fokianos Konstantinos (2016). 'dCovTS: Distance Covariance/Correlation for Time Series'. R Journal, 8(2):324-340. &lt;<a href="https://doi.org/10.32614%2FRJ-2016-049" target="_top">doi:10.32614/RJ-2016-049</a>&gt;.
BibTeX
@inproceedings{tsagris2016dcovts,
  author = {Michail Tsagris and Maria Pitsillou and Konstantinos Fokianos},
  title = {{dCovTS: Distance Covariance and Correlation for Time Series Analysis}},
  booktitle = {Openalex Unknown},
  year = {2016},
  doi = {10.32614/cran.package.dcovts},
}
Figure