Statistics Glossary → State-space model and the Kalman filter
State-space model and the Kalman filterconcept
A modelling framework that describes a time series as an unobserved, time-varying state vector (level, slope, season) plus a noisy measurement of it, together with the algorithm that estimates the state step by step.
The model consists of two equations. The observation equation links the measured value to the hidden state: yₜ = Zαₜ + εₜ. The state (transition) equation describes how the state evolves over time: αₜ₊₁ = Tαₜ + ηₜ. The simplest example is the local level model: the true level changes as a random walk, and the observation fluctuates around it with noise. Adding slope, seasonal and regression terms gives structural time series (unobserved components) models; ARIMA models can also be written in state-space form.
At each step the Kalman filter does two things: it predicts the new state from the previous estimate, and when the new observation arrives it updates the prediction, weighting it according to the relative size of the observation noise and the state noise. The variances are estimated by maximum likelihood, using the likelihood built from the filter's prediction errors. The smoother uses the whole series to give the best estimate of the state at each time. The framework handles missing observations naturally; if a component's variance is fixed at zero, that component becomes deterministic (fixed).
An everyday example
Someone weighs themselves every morning, but the scale varies by ±0.5 kg and water intake differs from day to day. The true weight (the hidden state) changes slowly while the number on the scale (the observation) is noisy. Each morning the Kalman filter combines yesterday's estimate with today's reading: if the scale is erratic it trusts yesterday's estimate more, and if weight is changing quickly it trusts today's reading more.
In MerQur
Available in the unobserved components model as the 'Level' (stochastic or fixed), 'Slope' (stochastic, fixed or none) and 'Irregular' component options; with the stochastic choice the component's variance is estimated, and with the fixed choice it is set to zero.
Analyses where this concept appears
Unobserved Components Model (Structural Time Series)
Related concepts
Forecast horizon and forecast intervalSeasonality and seasonal period