Recurrent Neural Goodness-of-Fit Test for Time Series

Aoran Zhang, Wenbin Zhou, Liyan Xie, Shixiang Zhu

Abstract

Time series data are crucial across diverse domains such as finance and healthcare, where accurate forecasting and decision-making rely on advanced modeling techniques. While generative models have shown great promise in capturing the intricate dynamics inherent in time series, evaluating their performance remains a major challenge. Traditional evaluation metrics fall short due to the temporal dependencies and potential high dimensionality of the features. In this paper, we propose the REcurrent NeurAL (RENAL) Goodness-of-Fit test, a novel and statistically rigorous framework for evaluating generative time series models. By leveraging recurrent neural networks, we transform the time series into conditionally independent data pairs, enabling the application of a chi-square-based goodness-of-fit test to the temporal dependencies within the data. This approach offers a robust, theoretically grounded solution for assessing the quality of generative models, particularly in settings with limited time sequences. We demonstrate the efficacy of our method across both synthetic and real-world datasets, outperforming existing methods in terms of reliability and accuracy. Our method fills a critical gap in the evaluation of time series generative models, offering a tool that is both practical and adaptable to high-stakes applications.

Introduction

Generative models for time series—ranging from financial forecasting to healthcare simulations—are increasingly prevalent. However, evaluating these models remains a significant hurdle. Unlike static data (e.g., images), time series are characterized by complex temporal dependencies that violate the independent and identically distributed (i.i.d.) assumptions required by traditional statistical tests. Existing metrics like Maximum Mean Discrepancy (MMD) often fail to capture the underlying dynamics—how a system transitions between states—focusing instead on average distributional properties.

The RENAL Framework

The REcurrent NeurAL (RENAL) framework introduces statistical rigor to time series evaluation by transforming complex sequences into a format amenable to classical testing. The core innovation is a two-step "transform and test" approach:

  1. Recurrent History Embeddings: An RNN (e.g., LSTM or Neural Hawkes Process) encodes the time series into a low-dimensional latent space. These "history embeddings" are proven to possess the Markov property, effectively compressing the sequence's history into a single point that predicts the next state.
  2. Chi-Square Discrepancy Test: By partitioning this Markovian embedding space into bins, the framework calculates transition probability matrices for both real and generated data.
  3. Adaptive Binning: An optimization strategy determines the ideal number of bins to balance granularity with statistical smoothness.
Overview of the RENAL framework workflow, from event sequences to the final chi-square transition discrepancy test.

By comparing these transition matrices using a chi-square statistic ($W_m$), RENAL determines if generated sequences are statistically indistinguishable from real observations.

Experimental Evaluation

The authors validated RENAL across synthetic datasets (ARMA, GARCH), Temporal Point Processes (Hawkes), and Spatial-Temporal Point Processes. Real-world applications included daily temperature records (Weather) and seismic activity catalogs (Earthquake).

A key insight of RENAL is its ability to turn "black box" neural representations into interpretable Markov chains. This allows the application of established statistical theories to modern deep learning models. Unlike global distribution metrics, RENAL is sensitive to subtle structural differences in dynamics, such as distinguishing between ARMA(2,1) and ARMA(2,2) models.

Results and Discussion

In comparative studies, RENAL consistently outperformed established baselines in both accuracy and reliability. On synthetic data, RENAL achieved an average accuracy of 0.72, surpassing MMD (0.62). In real-world scenarios, RENAL maintained a superior balance between Type-I and Type-II accuracy.

Performance comparison of RENAL vs. MMD across real-world weather and earthquake datasets.

As shown in the table above, RENAL achieved an overall accuracy of 0.66 on weather data and 0.57-0.62 on earthquake datasets, consistently outperforming MMD. Its robustness to limited data makes it highly practical for high-stakes domains where data acquisition is costly or rare.

Conclusion

RENAL addresses a critical gap in time series modeling by providing a theoretically grounded goodness-of-fit test. While it relies on the consistency of the underlying RNN to capture historical information, its performance across diverse datasets demonstrates its utility. Future work includes extending the framework to higher-dimensional data and exploring its use as a loss function to directly train better generative models.

Summary updated

BibTeX
@inproceedings{zhang2025recurrent,
  author = {Aoran Zhang and Wenbin Zhou and Liyan Xie and Shixiang Zhu},
  title = {{Recurrent Neural Goodness-of-Fit Test for Time Series}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2025},
  url = {https://openreview.net/forum?id=kuxXSg08nb},
}
Figure