- Introduced by
- Mike West and Jeff Harrison
- Year
- 1989
- Type
- Bayesian probabilistic model
- Family
- Bayesian / computational
What does it do?
Time series Bayesian inference applies Bayes' theorem sequentially to time-ordered observations, maintaining a probability distribution over hidden states and model parameters at each time step.
The framework covers state-space models, dynamic linear models, and particle filters, and supports both filtering (estimating the current state from past and present data) and retrospective smoothing (estimating past states from the full series).
The intuition behind the method
Think of the method as a structured way to track an evolving quantity, such as an economic indicator, a sensor reading, or a disease prevalence, while keeping track of what is unknown. At each new observation the model updates its beliefs with Bayes' rule: the prior carries forward what was believed before the new data point, the likelihood scores how consistent the observation is with different parameter values, and the posterior combines the two. Because this update is repeated over time, uncertainty is carried forward from one step to the next rather than replaced by a single point estimate at each step.
History
The Bayesian treatment of time series through dynamic linear models is presented systematically in West and Harrison's book Bayesian Forecasting and Dynamic Models, first published in 1989; the second edition (1997) is the version cited here, and it is the standard reference for this framework. The Kalman filter provides the exact filtering recursion for linear Gaussian state-space models with known variances. Particle filters and sequential Monte Carlo methods, developed in the 1990s, extended the approach to non-linear and non-Gaussian settings.
When to use it
Use time series Bayesian inference when you need coherent uncertainty for the latent state and parameters at every time point, for example in online forecasting, anomaly detection, or retrospective analysis of a process. It is well suited to short or noisy series, to settings where structural changes such as changepoints are plausible, and to problems where prior knowledge about the dynamics or noise levels should be used formally. Avoid it when a long, stationary series is adequately described by a classical ARIMA or exponential smoothing model, or when computational budget is very tight and an approximate frequentist filter is acceptable.
Limitations and considerations
- For non-linear or non-Gaussian models the filtering and smoothing steps are approximations (MCMC or particle methods), and their cost grows with series length and model complexity.
- The choice of state transition structure and prior distributions is made by the analyst and can strongly influence the posterior, particularly in short series.
- If the observation noise variance is misspecified, the credible intervals can be too narrow or too wide, so the calibration of the intervals depends on the model being adequate.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Provides full posterior distributions over states and parameters rather than only point estimates, so uncertainty is reported at each time step.
- Handles missing observations within the same framework by skipping the observation update at the affected time points and propagating the prior forward through the transition equation.
- Prior knowledge about dynamics, seasonal components, or noise levels can be encoded explicitly and is updated as data arrive.
- Supports model comparison through marginal likelihoods and Bayes factors.
- Changepoints and structural breaks can be represented as discrete latent events in the model.
Applications
- Macroeconomic forecasting and nowcasting with dynamic linear or state-space models.
- Real-time state tracking in engineering systems, robotics, and navigation.
- Epidemiological surveillance, tracking disease incidence and detecting changepoints in outbreak data.
- Financial time series, including volatility estimation, stochastic trend decomposition, and regime-switching models.
- Neuroscience, decoding latent neural states from noisy recordings.
- Environmental monitoring, fitting dynamic models to climate or air-quality series with missing data.
How it works
How it works
Specify a prior distribution over the latent state at the starting time, encoding beliefs before any data are observed. Priors on the variance components (observation noise and state evolution noise) are also set at this stage.
Formula
p(\theta_0)
A state transition equation describes how the latent state moves from one time step to the next, here as a linear map with additive Gaussian noise. The transition matrix determines which systematic dynamics, such as trends or seasonal components, the model can represent.
Formula
\theta_t = G_t\,\theta_{t-1} + \omega_t,\quad \omega_t \sim \mathcal{N}(0, W_t)An observation equation links the latent state to the recorded data, with its own noise term. For linear Gaussian models this pair of equations defines the dynamic linear model (DLM). When the observation and state noise variances are known, the Kalman filter gives the exact filtering recursion. When the variances are unknown and receive priors, as set out in the prior step, the joint posterior is generally not available in closed form and must be approximated, for example by MCMC or variational methods. The Kalman recursion is still used within such schemes, applied conditionally on sampled or fixed variance values.
Formula
y_t = F_t^\top\theta_t + \nu_t,\quad \nu_t \sim \mathcal{N}(0, V_t)At each time step the filtering step computes the posterior distribution of the current state given all data observed up to that point. This has two parts. First, the prediction step propagates the previous posterior, p(θ_{t-1} | y_{1:t-1}), through the transition equation, integrating over θ_{t-1}, to give the one-step-ahead predictive distribution p(θ_t | y_{1:t-1}). Second, Bayes' rule combines this predictive distribution with the likelihood p(y_t | θ_t) of the new observation. For non-linear or non-Gaussian models this posterior has no closed form and must be approximated, for example by MCMC, sequential Monte Carlo (particle filters), or variational methods.
Formula
p(\theta_t \mid y_{1:t}) \propto p(y_t \mid \theta_t)\,p(\theta_t \mid y_{1:t-1})Once the full series is available, smoothing revises the estimate of each past state by conditioning on all observations, including those that come after it. The result is a retrospective posterior that is usually tighter than the corresponding filtered one. For linear Gaussian models this is computed by a backward recursion run after the forward filter, such as the Rauch-Tung-Striebel smoother. For non-linear or non-Gaussian models it requires approximation, for example by particle smoothing or MCMC.
Formula
p(\theta_t \mid y_{1:T})Common pitfalls
- Not checking MCMC convergence (R-hat, effective sample size, trace plots) when the posterior is sampled.
- Using flat or very diffuse priors on the variance components, which can yield poorly identified posteriors in short series.
- Relying on in-sample fit without posterior predictive checks or evaluation on held-out observations.
- Confusing filtering (inference on the current state from past data) with smoothing (inference on past states from the full series) and reporting the wrong quantity for the question asked.
- Treating the fitted state-space model as the true data-generating process rather than as an approximation that needs sensitivity analysis.
Frequently asked questions
What is the difference between filtering and smoothing in this framework?
Filtering estimates the hidden state at time t using only data up to and including time t; this is the real-time estimate. Smoothing revisits those estimates once the full series is available, conditioning on all observations, which generally gives tighter posteriors. Both are valid outputs, and the choice depends on whether the application is online or retrospective.
When should I use a particle filter instead of a Kalman filter?
The Kalman filter gives an exact Bayesian update for linear Gaussian state-space models when the noise variances are known. When the transition or observation equation is non-linear, the noise is non-Gaussian, or the variances are unknown and must be estimated jointly with the state, the Kalman filter alone is no longer exact. A particle filter (sequential Monte Carlo) then approximates the posterior by propagating a weighted set of sampled states; the accuracy depends on the number of particles and on the model, and more particles generally reduce Monte Carlo error at a higher computational cost.
How do I choose the state-space structure?
Start from domain knowledge: identify the components that should be modelled, such as a local level, trend, seasonality, regressors, or changepoints. Dynamic linear models provide modular building blocks for each component that can be combined. Model comparison via marginal likelihoods or WAIC can then guide the choice among competing structures.
Can I use this method with irregularly spaced or missing observations?
Missing values are handled by skipping the observation update at those time points, so the prior is propagated forward through the transition equation. Irregular spacing requires the transition model to reflect the elapsed time between observations, for example by scaling the transition matrix or the state noise variance with the time gap. The exact parameterisation depends on the model and the software used and must be specified explicitly rather than assumed.
What software implements Bayesian time series inference?
Stan and PyMC can fit custom state-space models by MCMC. The R packages dlm and KFAS implement dynamic linear models with the Kalman filter and smoother. The R package bsts implements Bayesian structural time series, and TensorFlow Probability provides a structural time series module.
Related methods
Sources
West, M. & Harrison, J. (1997). Bayesian Forecasting and Dynamic Models (2nd ed.). Springer.
ISBN: 978-0387947259Prado, R. & West, M. (2010). Time Series: Modeling, Computation, and Inference. CRC Press.
ISBN: 978-1420093360