Dynamic Linear Model (Linear Gaussian State Space)
A dynamic linear model (or linear Gaussian state-space model) splits the data-generating process into a hidden state that evolves over time and a noisy observation of (a linear function of) that state. The two equations are
with , , and initial state . The state is hidden; the observation is what the analyst sees. The dimensions and need not match: there can be more observations than states or vice versa.The transition matrix () describes how the state evolves between time steps; the observation matrix () describes which linear combinations of the state are observed at time . Allowing to depend on gives the framework its missing-data handling: setting at unobserved time points lets the state propagate forward through its own dynamics without any update from the (absent) observation, and the next available measurement updates the state through its own . The covariances (process noise) and (measurement noise) separate two distinct sources of randomness, uncertainty in the state’s evolution versus uncertainty in the measurement device, that classical ARMA models conflate into a single innovation term.
The framework’s two structural axioms are that is a Markov process (past and future are independent given the present) and that the observations are conditionally independent given the states. All cross-time dependence in the data flows through the state, which is what makes the inference algorithms (the Kalman filter and smoother) computationally tractable.
The framework subsumes nearly every classical linear time-series model. ARMA(p, q) admits a state-space representation with state dimension in companion form. VAR is a state-space model where the state and observation coincide. Local-level and local-linear-trend models, Bayesian regression with drifting coefficients, structural time-series models, and unobserved-components decompositions all fit the same template, and the same Kalman-filter inference handles all of them.
State Dimension is a Modeling Choice is the analyst's invention, not a quantity in the data. The same observed series can be modeled with different state structures: as a level + trend (2-dimensional state), as an ARMA(p, q) (state of dimension in companion form), as a regression with time-varying coefficients (state = the coefficient vector). Choosing the state structure is the key modeling decision; everything else (filter, smoother, MLE) is mechanical given the structure.
The state
Intuition
Where ARMA models describe the observed series as one stochastic process, the DLM splits it into two: a true signal that evolves over time and a measurement of that signal that is corrupted by sensor noise. The split matters whenever the measurement device is itself noisy (sensor drift, missing samples, batch-to-batch lab variation), or whenever the parameter the analyst cares about (a true blood-glucose trajectory, a true volatility, an intended cursor velocity) is not directly recorded but only inferred through indirect measurements. ARMA cannot do this; it has only one noise term, conflating process and measurement variability. The DLM separates them.
The state-space form is also the right framework for modeling time-varying parameters. An ARMA model has fixed coefficients; a DLM with a state vector containing the coefficients can let them drift over time, often at a much slower rate than the observations. This is how Kalman-filter-based regression, the recursive least squares of econometrics, tracks structural breaks. And because the state recursion is Markov, the Kalman filter computes posterior state estimates one step at a time, never re-touching old data, a property impossible for ARMA models, which need the entire history to evaluate the exact likelihood.
Properties
(Encompasses ARMA, VAR, and Local-Trend Models) Almost every linear time-series model has a state-space representation.
For an ARMA(1, 1) , write the state , transition , observation . The companion-form construction generalizes to higher orders. The local-level model , is a 1-dimensional DLM. Holt’s local-linear-trend uses a 2-dimensional state with transition . This unification is why state-space methods are the modern lingua franca for time-series implementation: one Kalman filter handles the inference for an entire family of models that would otherwise need bespoke algorithms.
(Markov + Conditional Independence) The two structural axioms make the joint distribution factorize cleanly.
The Markov property of the state and the conditional-independence of observations together give
This factorization is what makes the Kalman recursions efficient: the posterior at time depends on the past only through the posterior at time , so the algorithm never has to revisit earlier data. The same factorization is the basis of the EM algorithm for parameter learning and of the particle filter for non-Gaussian extensions.
(Identifiability Pitfalls) Without constraints, the parameters are not all identifiable.
Replacing by for any invertible and rotating the parameters accordingly leaves the observed distribution unchanged. So unique identification requires fixing the basis (typical in tracking problems where the state has a known physical meaning) or imposing structural constraints (typical in econometric DLMs where, for example, is fixed to identity rows and is restricted to a particular form). Standard software requires the user to specify the structure explicitly to avoid the unidentifiable cases.
(Maximum Likelihood via the Filter) The Kalman filter computes the model log-likelihood as a by-product.
The one-step-ahead predictive density of each under the model is Gaussian with mean and covariance the filter produces in passing. Summing the log-densities gives the model log-likelihood, which a numerical optimizer wraps to learn unknown parameters by maximum likelihood. Alternatively, the EM algorithm uses the smoother in its E-step and closed-form Gaussian solutions in its M-step. Both approaches are implemented in statsmodels.tsa.statespace.
(Missing Data is Free) Setting at unobserved times leaves the state recursion intact.
When an observation is missing at time , the filter performs only the state’s prediction step and skips the measurement update, leaving a larger posterior covariance to honestly reflect that no information arrived. When the next observation comes in, the update step proceeds as usual. This is the single biggest practical advantage of DLMs over ARMA: gaps in the data require no special handling beyond zeroing the measurement matrix. ARMA-based imputation (the standard arima interpolation) is in fact this trick under the hood.
(Inference Lives in 3.12) The filtering, smoothing, and likelihood machinery is general Bayesian inference.
Once the DLM is specified, every inference question (the filtered state , the smoothed state , the model likelihood) is computed by the Kalman filter and Kalman smoother algorithms. Those algorithms live in the Bayesian Statistics treatment because they are general-purpose recursive Bayesian updates that apply equally to non-time-series problems (robotics state estimation, recursive Bayesian regression, GP regression in time). The DLM specifies the model; the Kalman algorithms do the inference.
Examples
Local-level model
, , with and . What does this represent?
Interpretation is a slowly drifting true level of some quantity; the observation is a noisy measurement of it. The state-noise variance controls how quickly the level can change, and the observation-noise variance controls how noisy each measurement is. The signal-to-noise ratio determines how much the Kalman filter should trust new data versus its own prediction. This model is the state-space form of ARIMA(0, 1, 1) / single exponential smoothing: different language, same underlying process.
The state
Local linear trend (Holt's model)
State with and . Observation . What is the structure?
Reading the model is a drifting level and is a drifting slope. The transition matrix is , the measurement matrix is (only the level is observed, the slope is hidden), and the process noise covariance is . With the slope is constant and only the level drifts; with both variances positive the slope itself drifts. The corresponding non-state-space form is ARIMA(0, 2, 2): the model picks up both first and second differencing structure.
Bone-marrow transplant with missing data
Three blood markers are measured daily but of measurements are missing, especially after day 35. How does the DLM handle the gaps?
Setup and inference VAR(1) in the true (unobserved) marker values , with a free matrix capturing cross-marker influences and process noise covariance allowing co-fluctuation. The observation equation is , with on days when measurements are taken and on days when they are missing. The filter propagates the state forward through missing days using only the dynamics; the smoother then revisits those days using future observations to interpolate, often dramatically improving the missing-day estimates. This is the standard scientific workflow for partial longitudinal data, and it falls out of the DLM framework with no special-purpose code.
The state equation is a