A Bayesian Nonparametric Method for Clustering Imputation, and Forecasting in Multivariate Time Series

Feras A. Saad, Vikash K. Mansinghka

Abstract

This article proposes a Bayesian nonparametric method for forecasting, imputation, and clustering in sparsely observed, multivariate time series data. The method is appropriate for jointly modeling hundreds of time series with widely varying, non-stationary dynamics. Given a collection of $N$ time series, the Bayesian model first partitions them into independent clusters using a Chinese restaurant process prior. Within a cluster, all time series are modeled jointly using a novel "temporally-reweighted" extension of the Chinese restaurant process mixture. Markov chain Monte Carlo techniques are used to obtain samples from the posterior distribution, which are then used to form predictive inferences. We apply the technique to challenging forecasting and imputation tasks using seasonal flu data from the US Center for Disease Control and Prevention, demonstrating superior forecasting accuracy and competitive imputation accuracy as compared to multiple widely used baselines. We further show that the model discovers interpretable clusters in datasets with hundreds of time series, using macroeconomic data from the Gapminder Foundation.

Introduction

Analyzing multivariate time series presents significant challenges when dealing with hundreds of variables that are sparsely observed and non-stationary. Traditional parametric models, such as Vector Autoregression or State-Space models, often encounter numerical instability in high-dimensional settings. Furthermore, these models typically require manual tuning for seasonality, trends, and changepoints. This research introduces a "purely empirical" model designed to discover patterns directly from historical data, avoiding the need for pre-defined structural theories.

Methodology

The foundational innovation of this work is the Temporally-Reweighted Chinese Restaurant Process (TRCRP) mixture. While a standard Chinese Restaurant Process (CRP) assigns data points to clusters based on current cluster sizes, the TRCRP reweights these probabilities based on temporal history.

Graphical model representing the dependencies between temporal cluster assignments $z_t$, observations $x_t$, and parameters $\theta_k$.

In this framework, the probability of a time point joining a specific cluster is influenced by how well its recent history matches the patterns previously observed in that cluster. This is managed via a cohesion function ($G$), often implemented as a Student-T distribution, which measures the similarity between a current "lagged" window and a cluster's history.

The generative process of the TRCRP model alongside clustered multivariate time series data including flu incidence, Twitter activity, and temperature.

To manage hundreds of disparate time series, the model employs a hierarchical structure. An "outer" CRP groups similar series together, while an "inner" TRCRP allows these groups to share temporal regimes (e.g., simultaneous economic shifts) while maintaining individual parameters.

Key Results

The TRCRP model was evaluated against two primary datasets: CDC influenza-like-illness (ILI) rates and Gapminder macroeconomic data.

  • Forecasting: During the 2015 flu season, the Multivariate TRCRP achieved the lowest mean absolute error over 10-week horizons, outperforming Facebook Prophet, Seasonal ARIMA, and HDP-HMM. It demonstrated superior calibration at longer horizons where baseline models often failed.
  • Imputation: In tests with 5% data removal, TRCRP matched the accuracy of Amelia II, a gold standard for missing data. Notably, TRCRP successfully captured non-linear seasonal rebounds across long gaps where linear methods failed.
  • Clustering: On Gapminder data, the model automatically identified interpretable economic trajectories, such as the post-Soviet economic transitions and the rapid growth of "Asian Tiger" economies.

Discussion and Future Work

TRCRP acts as an intelligent interpolator, following historical patterns when they exist and reverting to a broad prior when they do not. While effective, the model currently requires manual selection of the lagged window size ($p$). Future research aims to automate this parameter selection and improve computational efficiency through variational inference or stick-breaking representations, facilitating even larger-scale deployments in probabilistic programming environments like BayesDB.

Summary updated

Abstract

This article proposes a Bayesian nonparametric method for forecasting, imputation, and clustering in sparsely observed, multivariate time series data. The method is appropriate for jointly modeling hundreds of time series with widely varying, non-stationary dynamics. Given a collection of $N$ time series, the Bayesian model first partitions them into independent clusters using a Chinese restaurant process prior. Within a cluster, all time series are modeled jointly using a novel "temporally-reweighted" extension of the Chinese restaurant process mixture. Markov chain Monte Carlo techniques are used to obtain samples from the posterior distribution, which are then used to form predictive inferences. We apply the technique to challenging forecasting and imputation tasks using seasonal flu data from the US Center for Disease Control and Prevention, demonstrating superior forecasting accuracy and competitive imputation accuracy as compared to multiple widely used baselines. We further show that the model discovers interpretable clusters in datasets with hundreds of time series, using macroeconomic data from the Gapminder Foundation.
BibTeX
@misc{saad2017bayesian,
  author = {Feras A. Saad and Vikash K. Mansinghka},
  title = {{A Bayesian Nonparametric Method for Clustering Imputation, and Forecasting in Multivariate Time Series}},
  year = {2017},
  eprint = {1710.06900},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1710.06900},
}
Figure