Learning Correlation Space for Time Series

Han Qiu, Hoang Thanh Lam, Francesco Fusco, Mathieu SinnarXiv 2018

Abstract: We propose an approximation algorithm for efficient correlation search in time series data. In our method, we use Fourier transform and neural network to embed time series into a low-dimensional Euclidean space. The given space is learned such that time series correlation can be effectively approximated from Euclidean distance between corresponding embedded vectors. Therefore, search for correlated time series can be done using an index in the embedding space for efficient nearest neighbor search. Our theoretical analysis illustrates that our method's accuracy can be guaranteed under certain regularity conditions. We further conduct experiments on real-world datasets and the results show that our method indeed outperforms the baseline solution. In particular, for approximation of correlation, our method reduces the approximation loss by a half in most test cases compared to the baseline solution. For top-$k$ highest correlation search, our method improves the precision from 5% to 20% while the query time is similar to the baseline approach query time.

Introduction

In our data-driven world, we are drowning in time series—from stock market fluctuations to sensor readings in wearable tech. A common task is finding "correlated" series (e.g., "Which other stocks move like Apple?"). The gold standard for this is the Pearson correlation coefficient, but calculating it across millions of pairs is computationally expensive.

To speed things up, engineers usually use Discrete Fourier Transform (DFT) to "compress" the data into a few coefficients. However, the standard DFT approach assumes that only low-frequency (slow-moving) patterns matter. If the important correlation signal is hidden in high-frequency "jitter," the standard method fails. This paper tackles the challenge of learning a better, data-specific way to compress time series while preserving their correlation relationships.

Methodology: The Chronos Framework

The authors propose a hybrid approach, named Chronos, that combines classical signal processing with deep learning to map complex time series data into a low-dimensional "correlation space."

The Chronos framework pipeline

The framework consists of several key steps:

  1. Frequency Domain Preprocessing: Instead of feeding raw time series into a neural network, they first apply a Scaled DFT. This moves the data into the frequency domain, making it more manageable for the model.
  2. Neural Embedding: A multi-layer fully connected neural network (MLP) takes these frequency components and maps them into a compact embedding vector.
  3. Task-Specific Loss Functions: The network is trained using specialized loss functions:
  4. Chronos Approximation: Minimizes the difference between the Euclidean distance of the embeddings and the actual correlation of the original series.
  5. Chronos Order: Designed for "top-$k$" searches, this loss trains the network to preserve the relative ranking of correlations.
  6. Symmetry Correction: A mathematical adjustment accounts for the symmetry in DFT outputs of real-valued signals, optimizing the network's capacity.

Experimental Setup

The method was evaluated on four diverse, real-world datasets with long sequences (400 to 1,000+ points):

  • Stock Indices: Daily price data for over 19,000 stocks from Yahoo Finance.
  • Yoga: Image-derived outlines of yoga poses (UCR Archive).
  • UWaveGesture: Accelerometer data from hand gestures (UCR Archive).
  • StarLightCurves: Astronomical brightness measurements (UCR Archive).

Key Results

The empirical evaluation demonstrates that Chronos significantly outperforms traditional methods.

Approximation loss comparison on Star Light Curve dataset
  • Error Reduction: In correlation approximation tasks, Chronos reduced the approximation loss by at least 50% compared to the DFT baseline across almost all test cases, as shown in the Star Light Curve results.
  • Search Precision: For top-$k$ highest correlation searches, the method improved precision by 5% to 20%.
  • Efficiency: Despite the neural network component, query times remained sub-millisecond and nearly identical to the baseline. Training is also efficient, taking approximately 15 minutes for 10,000 mini-batches on standard hardware.

Insights and Future Work

A key insight is that "blindly" taking the first few Fourier coefficients is often sub-optimal, especially when variability is stored in high frequencies. Furthermore, optimizing for the order of correlations rather than just their absolute values leads to significant gains in search precision.

While effective, the current model requires fixed-length time series. Future work will explore handling varying lengths and extending the framework to other similarity measures like Dynamic Time Warping (DTW), which can better account for time-shifted signals.

Summary updated

BibTeX
@misc{qiu2018learning,
  author = {Han Qiu and Hoang Thanh Lam and Francesco Fusco and Mathieu Sinn},
  title = {{Learning Correlation Space for Time Series}},
  year = {2018},
  eprint = {1802.03628},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1802.03628},
}
Figure