AI Glossary / Probabilistic machine learning / Intermediate
Local level model
Definition
A local level model represents a time series as noisy observations of an underlying level that changes through a random walk. It separates short-lived observation noise from changes in the latent baseline, providing a simple state-space model for tracking and forecasting.
What it means
A measurement can move because the underlying process changed or because the observation is noisy. A local level model gives those two explanations separate roles.
The latent level carries forward from one time point to the next, with a random disturbance allowing it to shift. The observed value adds another disturbance that affects that observation without automatically changing the underlying level.
The word local means the baseline can evolve over time. It does not refer to geographic locality or to fitting a separate regression in every moving window. The basic model has no persistent slope, seasonal cycle or external predictor unless those components are added explicitly.
How it works
A common Gaussian specification is y_t = level_t + observation_noise_t, with level_t = level_(t−1) + level_noise_t. The two noise sequences have zero mean and are usually assumed mutually independent, with variances R and Q respectively.
With known parameters and an appropriate Gaussian initial state, a Kalman filter updates the level estimate as each observation arrives. The prediction variance increases by Q before the next observation. The update then balances that uncertain prediction against the new measurement using R.
A smoother can revise past level estimates using later observations. Parameter estimation must also address Q, R and the initial state. Different choices alter how readily the model interprets a surprising observation as a genuine baseline change.
Three practical examples
- A monitoring tool tracks the drifting baseline of a noisy sensor.
- An operations analyst uses the model as a simple benchmark for a nonseasonal series without a sustained slope.
- A forecasting study separates estimated latent-level uncertainty from the additional noise expected in future observations.
Think of it this way
Think of watching the height of a slowly shifting platform through an imperfect measuring device. Some variation comes from the platform and some from the measurement.
The analogy does not imply that every real process moves slowly or follows Gaussian disturbances. The fitted variance ratio determines how much movement the model allows, and real jumps, outliers or cycles may require a richer description.
Worked example
Updating a baseline after one measurement
Suppose an original teaching example ends one period with filtered level mean 10 and variance 1. Let the next level disturbance have variance Q = 0.5, and let observation noise have variance R = 2.5. Treat these parameters as known.
Before the next measurement, the predicted mean remains 10 and the predicted level variance is 1 + 0.5 = 1.5. A new observation y = 14 has innovation 14 − 10 = 4, with innovation variance 1.5 + 2.5 = 4.
The Kalman gain is 1.5/4 = 0.375. The updated level mean becomes 10 + 0.375 times 4 = 11.5. Its variance becomes (1 − 0.375) times 1.5 = 0.9375.
The next observation forecast has mean 11.5 and variance 0.9375 + 0.5 + 2.5 = 3.9375. Two periods ahead, its mean is still 11.5 while its variance is 0.9375 + 2 times 0.5 + 2.5 = 4.4375. Flat forecast means do not imply certainty: uncertainty grows with the horizon.
Illustrative case study
Fictional case: tracking a measurement baseline
A fictional workshop records a daily calibration reading from an instrument. The readings fluctuate, and the team wants a baseline estimate that can move without treating every fluctuation as a permanent shift.
It fits a local level model and compares its forecasts with a fixed mean and a last-observation baseline. The team reviews unusually large innovations and checks whether known maintenance events coincide with changes the model estimates.
When a weekly pattern appears in the residuals, the team considers a seasonal extension. It does not force the local level component to explain every systematic feature. The fictional case illustrates a model review, not a claimed reduction in calibration error.
Common misconceptions and mistakes
A random-walk latent level does not imply that observed measurements equal a random walk without noise. The extra observation-noise term changes the model and its inference.
The level is not simply a moving average with a user-selected window. The Kalman update weight is determined by uncertainty, and can change over time, especially during initialization. In a steady-state setting it has a relationship to exponential smoothing, but the state-space formulation also describes uncertainty.
The filtered level at time t uses observations available through t. The smoothed level may use later data. Evaluating a real-time decision with smoothed historical estimates can therefore introduce information that was unavailable at the decision time.
Business use
Use this model as a transparent baseline when tracking a changing level is more important than extrapolating a sustained trend. It can help separate a forecasting problem from unnecessary model complexity.
Check the sampling interval, missing observations, outliers and residual patterns. Report both latent-level intervals and observation-prediction intervals with clear labels, since they answer different questions. Use rolling or forward-in-time evaluation to assess forecasting performance. If the series has persistent growth, seasonality, abrupt regime changes or bounded outcomes, compare extensions or alternative observation models.
People also ask
Why does the mean forecast stay flat?
Future random-walk disturbances have mean zero, and the basic model has no slope term to create expected growth.
What happens if Q is zero?
The latent level is constant over time, although its value can remain uncertain and observations can still be noisy.
Does a large R make the filter trust a new observation more?
Other things equal, it makes the observation less informative, so the update weight is smaller.
Check your understanding
In the worked example, what is the level variance one period ahead after the update, excluding observation noise?
Answer: It is 0.9375 + 0.5 = 1.4375. Adding observation variance 2.5 gives the wider observation-prediction variance 3.9375.
Related terms
- Kalman filter
- Random walk
- Exponential smoothing
- Local linear trend model
- State-space model
- observation noise
- process noise
Learn next
Vary the ratio Q/R and observe how the filtered level responds to a single unusual measurement. Then compare filtering and smoothing, ensuring future information is excluded from real-time evaluation.
More in Probabilistic machine learning
- LDA-HMM - LDA-HMM is a composite text model combining latent Dirichlet allocation's document-level topics with a hidden Markov model's local sequence structure.
- Leapfrog integrator - The leapfrog integrator is a numerical method that advances position and momentum through alternating half and full steps.
- Likelihood tempering - Likelihood tempering changes the influence of observed data by raising the likelihood to a power before combining it with the prior.
- Log-Gaussian Cox process - A log-Gaussian Cox process is a model for randomly located events in which the logarithm of an underlying event intensity follows a Gaussian process.
- Log-sum-exp trick - The log-sum-exp trick is a numerically stable way to calculate the logarithm of a sum of exponentials.
- Manifestation shift - Manifestation shift is a change in how a target condition produces the observable physical characteristics used to recognize it.
Work in finance? Get the free CFO AI Prompt Pack: 7 prompts for finance leaders.
Sources
Primary model documentation: TensorFlow Probability, LocalLevel: https://www.tensorflow.org/probability/api_docs/python/tfp/sts/LocalLevel
Primary structural-model reference: statsmodels, UnobservedComponents: https://www.statsmodels.org/stable/generated/statsmodels.tsa.statespace.structural.UnobservedComponents.html
The scalar update and workshop case are original teaching examples.
Previous: Local Laplacian filters Next: Local linear trend model