Stochastic Gradient MCMC for Nonlinear State Space Models

Christopher Aicher, Srshti Putcha, Christopher Nemeth, Paul Fearnhead, Emily B. Fox

Abstract

State Space Models (SSMs) are essential for time-series analysis but face significant scalability challenges in Bayesian inference. This paper presents a scalable framework using Stochastic Gradient MCMC (SGMCMC) combined with a novel buffering technique. By incorporating a small buffer around data minibatches, the proposed gradient estimator corrects for broken temporal dependencies, enabling efficient and accurate inference on datasets with millions of observations.

Introduction

State Space Models (SSMs) are fundamental to time-series analysis, providing a framework to model latent states that evolve over time and generate observed data. Applications range from financial forecasting to neural signal processing. However, traditional Bayesian inference methods like Markov Chain Monte Carlo (MCMC) struggle with scalability, requiring a full pass over the entire dataset at each iteration. For a time series with millions of points, this becomes computationally prohibitive.

While Stochastic Gradient MCMC (SGMCMC) has revolutionized big-data inference for independent and identically distributed (i.i.d.) data through minibatches, its application to SSMs is non-trivial. Randomly sampling chunks of a time series breaks temporal dependencies, introducing significant bias into gradient estimates and leading to incorrect convergence or algorithmic failure.

The Buffered Stochastic Gradient Estimator

To address the bias caused by broken temporal links, the authors propose a buffered stochastic gradient estimator. The core idea is to expand the calculation window beyond the target subsequence to "warm up" the state estimates.

  1. The Buffer Trick: Instead of computing the gradient solely on a small subsequence $S$, the estimator includes a buffer of $B$ data points on both sides (denoted as $S^*$). Message-passing algorithms (e.g., Kalman filter or Forward-Backward) are run through this larger window to provide accurate estimates for the latent states in the central subsequence.
  2. Fisher’s Identity: The authors leverage Fisher’s identity to express the gradient of the marginal likelihood in terms of the complete-data likelihood. This formulation naturally accommodates the buffered approach and simplifies the analysis of the estimator.
  3. Preconditioning (SGRLD): To accelerate convergence, the method employs preconditioning matrices based on the model's Fisher information. This Riemannian approach (SGRLD) accounts for the parameter space's geometry, significantly improving mixing rates compared to standard Langevin dynamics.

Theoretical Insights

A key theoretical contribution is the discovery that the bias introduced by sub-sampling decays geometrically with the buffer size $B$. This implies that even for extremely long sequences, a relatively small buffer (e.g., 10–20 points) is sufficient to achieve nearly unbiased gradients. The authors utilize Wasserstein distance to establish these bounds for models with continuous states, providing a robust foundation for the method's effectiveness across various SSM architectures.

Experimental Evaluation

The framework was tested on synthetic benchmarks (ARHMMs, LGSSMs, SLDSs) and large-scale real-world datasets, including a 10-million-point ion channel recording and canine seizure iEEG data.

Key Results

  • Massive Speedups: On a million-point synthetic ARHMM, buffered SGRLD outperformed traditional batch MCMC by a factor of 24, reaching better results in 6 hours than the batch method did in 6 days.
  • Scalability: The method successfully processed the 10-million-point ion channel dataset, a task where traditional Gibbs sampling failed due to memory and time constraints.
  • Accuracy: In weather and seizure data applications, the buffered approach consistently found higher held-out likelihoods than subset-based Gibbs sampling, which often converged to suboptimal local optima.

Conclusion and Future Work

This work provides a scalable path for Bayesian inference in complex time-series models. While highly effective, challenges remain in automated hyperparameter tuning, specifically for the step size. Future research may extend these techniques to non-linear SSMs using particle filtering within the buffered estimator and further explore theoretical bounds for Switching Linear Dynamical Systems (SLDS).

Summary updated

BibTeX
@inproceedings{aicher2019stochastic,
  author = {Christopher Aicher and Srshti Putcha and Christopher Nemeth and Paul Fearnhead and Emily B. Fox},
  title = {{Stochastic Gradient MCMC for Nonlinear State Space Models}},
  booktitle = {Bayesian},
  year = {2019},
  doi = {10.1214/23-ba1395},
}
Figure