AI Glossary / Time series and signal processing / Advanced
Switching Kalman filter
Definition
A switching Kalman filter estimates a continuous hidden state when a discrete mode can change the system's dynamics or observation model. It combines mode uncertainty with state uncertainty, using Kalman-style calculations within linear Gaussian components. Practical implementations often approximate the growing mixture of possible mode histories rather than performing one ordinary Kalman update for the whole system.
What it means
A single motion model may describe steady movement poorly during a turn or acceleration. A switching model represents several possible regimes and updates how plausible each is as observations arrive. The mode is usually hidden, so the system need not commit immediately to one explanation. A mode probability expresses uncertainty within the chosen model; it does not prove which physical regime is actually present.
How it works
Define mode-specific transition and observation models, initial mode probabilities and a rule for switching modes, commonly a Markov transition matrix. Predict the next mode probabilities, propagate the continuous-state distributions and evaluate how well each mode predicts the new observation. Multiply predicted mode weights by observation likelihoods and normalize.
Exact filtering can accumulate one Gaussian component for each possible mode history, producing rapid growth. Approximations such as the interacting multiple model method mix and compress distributions to control computation. Combining state estimates requires accounting for both uncertainty within modes and disagreement between their means. The component covariance average alone omits the latter contribution.
Three practical examples
- A tracking model represents steady motion and maneuvering as different regimes. Observations influence both the estimated position and the probability of each regime.
- A sensor model distinguishes ordinary measurement noise from a broader disturbance mode. This provides an explicit alternative explanation for unusual readings, though it does not automatically identify their cause.
- An operations model allows different dynamics in active and idle periods. Its usefulness depends on whether those chosen modes capture relevant behavior and can be distinguished from available observations. These examples illustrate possible formulations rather than measured improvements in tracking or forecasting.
Think of it this way
Imagine two analysts maintaining different explanations of a moving object. Each updates a position estimate, but a coordinator also updates confidence in their explanations. If their estimates disagree, that disagreement is part of uncertainty. Averaging their confidence intervals while ignoring how far apart their estimates are would give an incomplete picture.
Worked example
Consider two fictional modes, A and B, with current probabilities 0.6 and 0.4. Let P(next A | current A) = 0.9 and P(next B | current A) = 0.1. Let P(next A | current B) = 0.2 and P(next B | current B) = 0.8. These conditional statements explicitly define the transition direction.
The predicted probability of A is 0.6 times 0.9 plus 0.4 times 0.2 = 0.62. B has probability 0.38. Suppose the new observation has likelihood density 0.1 under A and 0.3 under B. These are stipulated illustrative likelihoods, not probabilities that a continuous observation equals one exact value.
Unnormalized posterior mode weights are 0.062 and 0.114. Their sum is 0.176, giving normalized weights 31/88, approximately 0.3523, and 57/88, approximately 0.6477. B becomes more probable despite its lower predicted probability because the observation is three times as likely under its predictive distribution.
Separately stipulate that the completed mode-conditional state updates have means 10 and 14, with variances one and four. These summaries illustrate the combination step; a full set of state equations and measurement updates is not being reconstructed. The mixture mean is (31/88) times 10 plus (57/88) times 14 = 277/22, approximately 12.5909.
The mixture variance is the weighted sum of each component variance plus its squared distance from the mixture mean. It equals approximately 6.5940. Averaging only the component variances gives 259/88, approximately 2.9432, omitting about 3.6508 from uncertainty about which mean applies. Replacing this mixture by a single Gaussian with the same mean and variance preserves those moments, but not generally its full shape.
Illustrative case study
Fictional Harbor Tracking uses the constructed summaries to review an estimator dashboard. A developer reports the mixture mean correctly but displays uncertainty based only on the weighted component variances. The review identifies the missing disagreement term and updates the calculation.
The team also shows mode probabilities alongside the combined estimate so readers can see when alternative explanations remain plausible. Before deployment, it plans to evaluate transition assumptions and approximation behavior on representative recordings. This scenario demonstrates bookkeeping and interpretation; it does not claim that the fictional modes, likelihoods or model accurately describe any real tracking problem.
Common misconceptions and mistakes
Selecting the highest-probability mode and discarding all others is a hard decision, not equivalent to retaining a mixture. An IMM is an approximation method within this broader family, not a guarantee of exact filtering. Mode-transition matrix orientation must be checked explicitly because software conventions differ. Likelihoods depend on predictive uncertainty as well as residual size, so choosing the smallest residual alone is not generally the same update. More modes can increase ambiguity and computation without improving the model.
Business use
Use the approach when a few interpretable regimes plausibly explain changing behavior and observations can help distinguish them. Document mode definitions, transition assumptions, noise models and approximation choices. Evaluate state accuracy and uncertainty calibration, including during transitions. Compare with a simpler model to establish whether extra complexity helps the intended task. Avoid presenting mode labels as confirmed events when the estimator only assigns relative probabilities among its specified alternatives.
People also ask
Does switching mean choosing one filter at every step?
Not necessarily. Soft switching retains probabilities across modes.
Are all switching Kalman filters exact?
No. Exact mixtures can grow with mode history, so practical methods often compress them.
Can observations and dynamics both switch?
Yes. The discrete mode can select different dynamics, measurement relationships or noise assumptions, depending on the formulation.
Check your understanding
Why is the combined variance larger than the weighted average of one and four?
Answer: The component means differ. Uncertainty about whether the state is near 10 or near 14 contributes additional variance beyond uncertainty within either component.
Related terms
- Kalman filter
- Hidden Markov model
- switching linear dynamical system
- interacting multiple model
- Gaussian mixture
- mode probability
- moment matching
Learn next
Keep the same transition probabilities but give the new observation equal likelihood under both modes. The posterior mode probabilities remain 0.62 and 0.38. Explain why an observation that does not discriminate between modes leaves their predicted relative weights unchanged.
More in Time series and signal processing
- State space modeling - State space modeling describes a changing system using an underlying state and equations connecting that state to observations.
- Stationarity - Stationarity is a property describing statistical stability over time.
- Stationary process - A stationary process is a stochastic process whose statistical behavior is invariant under shifts in time, according to a specified definition of stationarity.
- Time series - A time series is a sequence of observations associated with times or time intervals.
- Time series analysis - Time series analysis is the study of observations indexed by time, with methods that account for their ordering, timing and dependence.
- Time Series Forecasting - Time series forecasting estimates future values of a quantity from information available at a specified time.
Sources
Kevin P. Murphy, Switching Kalman Filters (1998), introduction and inference sections: https://www.cs.cmu.edu/~motionplanning/papers/sbp_papers/kalman/murphy_switching_kalman.pdf FilterPy, IMM implementation, mode-weight updates and mixture covariance: https://filterpy.readthedocs.io/en/latest/_modules/filterpy/kalman/IMM.html All probabilities, component summaries and the Harbor Tracking scenario are original teaching constructions; the example isolates weighting and combination rather than a complete filtering run.
Previous: Switching Hidden Markov Model Next: Sycophancy