State-Space Models and the Kalman Filter - Overview
Summary
A state-space model describes a time series through a hidden Markov state that evolves over time (the transition equation) and is observed only noisily (the observation equation). Bayesian filtering computes the posterior of the state given past data via a recursive predict → update cycle; for the linear-Gaussian case this cycle has a closed form — the Kalman filter. The backward RTS smoother refines those estimates using all the data, and the filter’s by-product, the prediction-error decomposition, yields the marginal likelihood that makes MCMC over model parameters tractable. This is the machinery underneath Bayesian Structural Time-Series Model.
Overview
This folder ingests the linear-Gaussian core of Särkkä (2013), Bayesian Filtering and Smoothing. The four companion notes build a single recursive pipeline:
- Linear-Gaussian State-Space Models — the model: a Markovian latent state with a linear transition and a linear-Gaussian observation. Defines every symbol.
- The Kalman Filter — the forward recursion:
predict(Chapman–Kolmogorov) thenupdate(Bayes’ rule), giving the filtering distribution in closed form. - The RTS Smoother — the backward recursion: a second pass that conditions each state on the entire data record , giving .
- Marginal Likelihood via the Kalman Filter — the filter’s innovations and their covariances factor the likelihood , enabling MAP estimation, MCMC, and EM over parameters .
Main Content
The recursive pipeline
The general probabilistic state-space model (Särkkä Def. 4.1) is
The Bayesian filtering equations (Särkkä Thm. 4.1) compute the filtering distribution recursively:
- Predict (Chapman–Kolmogorov):
- Update (Bayes):
When the model is linear-Gaussian, every distribution stays Gaussian and these integrals collapse to matrix algebra — the Kalman filter (forward) and RTS smoother (backward).
Why state-space form matters
- Constant cost per step. Naïve Bayes over the full joint costs more at every new observation; the recursive filter does work per time step.
- Modularity. Independent state components (level, slope, seasonal, regression) stack as block-diagonal , and concatenated — exactly how Local Linear Trend and Seasonality assembles a BSTS model.
- Tractable likelihood. The prediction-error decomposition (see Marginal Likelihood via the Kalman Filter) gives analytically, so parameter inference (MAP / MCMC / EM) needs only the filter.
Examples
The running example across these notes is the Gaussian random walk plus noise (local level model), Särkkä Examples 4.1, 4.2, 8.1, 12.1:
It is filtered in The Kalman Filter, smoothed in The RTS Smoother, and has its noise variance inferred in Marginal Likelihood via the Kalman Filter. This is the simplest BSTS state component.
Connections
- Linear-Gaussian State-Space Models — formal model definition
- The Kalman Filter — forward predict/update recursion
- The RTS Smoother — backward smoothing recursion
- Marginal Likelihood via the Kalman Filter — likelihood and parameter inference
- Bayesian Structural Time-Series Model — the applied state-space model this machinery powers
- Local Linear Trend and Seasonality — concrete state components in Kalman form
See Also
- MCMC Inference for CausalImpact — uses a simulation smoother (Durbin–Koopman) closely related to the RTS pass
- Single Marketing Time Series — ARIMA-based univariate alternative
- Hilbert Space Gaussian Processes — GPs admit equivalent state-space (Kalman) representations