- Introduced by
- Carter & Kohn; West & Harrison
- Year
- 1994–1997
- Type
- Bayesian posterior sampling for time-ordered data
- Family
- Bayesian / computational
What does it do?
Time series MCMC applies Markov chain Monte Carlo to Bayesian inference for time-ordered data.
Instead of a single point estimate, it draws samples from the joint posterior of latent states and parameters, so uncertainty about trends and dynamics is carried through every time point. The approach is most developed for linear, Gaussian state space models.
The intuition behind the method
Suppose an underlying quantity such as inflation evolves over time but is observed only through noisy measurements. A state space model describes how the hidden state moves from one time point to the next, how measurements arise from it, and what priors apply to the unknown parameters. MCMC then draws many trajectories of the hidden states together with parameter values, each consistent with the data. Summaries of these draws, such as quantiles, give uncertainty bands for the hidden path. Whether those bands are well calibrated depends on how adequate the model and priors are.
History
Carter and Kohn (1994) showed how the Gibbs sampler can draw a whole state trajectory in one block for linear state space models, using the Kalman filter, with errors that are mixtures of normals and coefficients that can switch over time. West and Harrison's Bayesian Forecasting and Dynamic Models (2nd ed., 1997) sets out the Bayesian framework in which such dynamic models are usually written. Non-linear and non-Gaussian models fall outside the Carter and Kohn construction and are handled by other samplers, such as particle-based MCMC and Hamiltonian Monte Carlo.
When to use it
Choose time series MCMC when you need full posterior uncertainty over latent states and parameters of a dynamic model, such as a linear Gaussian state space or dynamic linear model, and when prior knowledge about the dynamics should be formally included. It is useful for short series, where maximum-likelihood asymptotics may be unreliable, and for series with missing time points, which the state space framework accommodates directly. Do not choose it when a standard frequentist model such as ARIMA gives an adequate fit for the question, when the model is non-linear or non-Gaussian and no suitable sampler is available, or when the series is very long and simpler estimators already give stable results at much lower cost.
Limitations and considerations
- Exact block sampling via the Kalman filter requires a linear, conditionally Gaussian structure. Non-linear dynamics or count-valued observations require alternative samplers, such as particle MCMC or Hamiltonian Monte Carlo.
- Computationally heavier than maximum likelihood, since each sweep resamples the full state trajectory and the sampler must run long enough to mix.
- Inference on variance parameters is sensitive to the prior, particularly for short series, where the data carry limited information about the scale of state innovations.
- A misspecified evolution equation can produce confident but misleading state paths, and posterior summaries alone will not reveal this.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Yields full posterior distributions for latent states and parameters, so uncertainty bands for the hidden path are available at every time point.
- Missing time points need no special treatment: the Kalman-filter step simply has no observation to condition on at those times.
- Measurement errors that are mixtures of normals remain tractable, because Carter and Kohn (1994) introduce indicator variables that keep the sampler conditionally Gaussian.
- Prior information about dynamics or variances can be encoded formally and updated by the data, which helps when the series is short.
- Model comparison through marginal likelihoods is possible from the sampler output, although estimating them requires additional work.
Applications
- State space modelling of macroeconomic time series such as GDP growth, inflation, and unemployment.
- Stochastic volatility modelling in finance, where latent volatility evolves over time.
- Epidemiological surveillance tracking latent infection rates from noisy case-count data, which calls for a non-Gaussian extension of the sampler.
- Climate science analyses requiring posterior uncertainty over hidden climate states.
- Signal processing and sensor fusion where measurements contain noise and may be irregularly spaced.
- Ecological population dynamics modelling with partially observed counts, which requires a non-Gaussian observation model.
How it works
How it works
The observation equation links the measurements y_t to the hidden state θ_t through F_t, and the evolution equation propagates the state from θ_{t-1} to θ_t through G_t. The noise terms are assumed conditionally Gaussian, with ν_t ~ N(0, V_t) and ω_t ~ N(0, W_t). F_t and G_t are known system matrices, while V_t and W_t are the observation and evolution variance matrices, which are either fixed or given priors and sampled. Carter and Kohn (1994) allow the errors to be mixtures of normals, handled through indicator variables, and the sampler described here is exact only under this conditionally Gaussian structure. Separating these two equations lets dynamics, trends and seasonal components be expressed within one probabilistic model. The linear form shown here is what allows the Kalman-filter-based sampler to be used directly.
Formula
y_t = F_t \theta_t + \nu_t, \quad \theta_t = G_t \theta_{t-1} + \omega_tA normal prior is placed on the initial state θ_0. The variance parameters and any static coefficients also need priors. Conjugate or weakly informative choices are common, and informative priors can encode external knowledge such as expected seasonal structure.
Formula
\theta_0 \sim \mathcal{N}(m_0, C_0)The whole latent state trajectory is drawn as one block by a forward filtering, backward sampling scheme. A Kalman filter is run forward in time to obtain the filtered distribution of the state at each time point, and states are then sampled backwards in time from their conditional distributions given the later draws. Carter and Kohn (1994) described generating the full state vector in one block from Kalman filter output within a Gibbs sampler. In their comparisons, this block approach dominated a Gibbs sampler that generated the states one at a time.
Formula
p(\theta_{1:T} \mid y_{1:T}) = p(\theta_T \mid y_{1:T}) \prod_{t=1}^{T-1} p(\theta_t \mid \theta_{t+1}, y_{1:t})Within a Gibbs sampler, the variance and coefficient blocks are drawn conditional on the current state trajectory, and the state trajectory is drawn conditional on the current parameters. One full sweep updates all unknowns in turn. When the model is non-linear, or the noise cannot be written in a conditionally Gaussian form, the Kalman-filter step is no longer exact, and alternative samplers, such as particle-based MCMC or Hamiltonian Monte Carlo, are needed instead.
Several chains are run from different starting values, and convergence is assessed with diagnostics: R-hat values close to 1, adequate effective sample sizes, and trace plots without drift or sticking. These checks can flag non-convergence but cannot prove that the chains have reached the true posterior. Posterior predictive checks compare data simulated from the fitted model with the observed series to assess model adequacy.
Common pitfalls
- Running a single chain from one starting point and trusting its summaries; several chains from dispersed starts are needed to detect non-convergence.
- Assuming the sampler mixes quickly: dependence between states and variance parameters under Gibbs updates can slow mixing in some models, so the chain may move slowly through the posterior.
- Using very tight priors on variance parameters, which can prevent the model from matching the observed scale of the dynamics.
- Skipping posterior predictive checks, so that a structurally wrong evolution equation passes unnoticed.
- Applying the linear Gaussian sampler to count data or heavy-tailed noise without an extension suited to that observation model.
- Reporting Monte Carlo error, which shrinks as more draws are taken, as if it were posterior uncertainty about the parameters.
Frequently asked questions
What is the Forward Filtering Backward Sampling algorithm?
FFBS is a blocked Gibbs sampler for linear Gaussian state space models. It runs a Kalman filter forward through time to obtain filtered distributions, then samples the entire state trajectory backwards in one pass. Sampling all states as a block avoids the slow mixing that tends to occur when each state is updated one at a time, which is the comparison Carter and Kohn (1994) made.
When should I use particle MCMC instead of FFBS Gibbs sampling?
FFBS relies on Kalman-filter steps that are exact only for a linear, conditionally Gaussian structure. When the dynamics are non-linear (for example logistic growth), or when the observations are non-Gaussian in a way that cannot be written as a mixture of normals (for example counts), those steps are no longer exact. Particle MCMC, which embeds a particle filter inside an MCMC kernel, and Hamiltonian Monte Carlo are alternative samplers for such cases. They lie outside the Carter and Kohn construction and are not covered by the sampler described on this page.
How many MCMC iterations do I need for a time series model?
There is no universal rule. State space models with many latent states can mix slowly, so use several chains and judge convergence with R-hat and effective sample sizes rather than a fixed iteration count. If the diagnostics are poor, lengthen the run before trusting the summaries.
Can time series MCMC handle missing observations?
Yes. Time points without an observation simply contribute no likelihood term. The Kalman filter propagates uncertainty across the gap, and backward sampling draws the missing states conditionally on the observed data, so they are imputed as part of the posterior.
How does this differ from classical ARIMA?
ARIMA is a frequentist model estimated by maximum likelihood, returning point estimates and asymptotic standard errors. Time series MCMC returns full distributions over states and parameters, can incorporate prior information, handles missing observations within the state space, and can encode time-varying structure, at considerably higher computational cost.
Related methods
Sources
Carter, C. K. & Kohn, R. (1994). On Gibbs sampling for state space models. Biometrika, 81(3), 541–553.
Open DOI referenceWest, M. & Harrison, J. (1997). Bayesian Forecasting and Dynamic Models (2nd ed.). Springer.
ISBN: 978-0387947259