Skip to main content

Cookies on Macro by Mark.We use essential cookies for sign-in, locale, and security. With your permission, we also use optional cookies for preferences, for analytics, and for advertising measurement with the Meta (Facebook) Pixel. Read our cookie policy.

Macro by MarkMacro by Mark
  • Home
Loading…
Loading…
← Models
MacroConceptsPolicyModels

Kalman filter Model

Recursive state estimator that updates latent macro states as each noisy observation arrives.

OverviewGraphMathReferences

Graph workspace

Filtered state with uncertainty bands and innovation sequence (2x1 panel)

Graph workspace

The Kalman filter's primary output is the filtered state estimate αt∣t\alpha_{t|t}αt∣t​ with its conditional variance Pt∣tP_{t|t}Pt∣t​. The top panel shows the filtered state (and optionally the true state for the toy model) with ±2\pm 2±2 standard-deviation bands. The bottom panel shows the innovation sequence vtv_tvt​, which should be white noise if the filter is correctly specified.

Chart axis metadata
xTime (periods)periods · 0 to TyState value (top) / Innovation (bottom)model units · data-dependent / centered at zero
Latent state, noisy measurement, and
the filtered estimate static chart preview showing Noisy measurement, True latent state, Filtered estimate
Innovation sequence static chart preview showing Innovation, Zero
xTime (periods)periods · 0 to TyState value (top) / Innovation (bottom)model units · data-dependent / centered at zero

Current results

Steady-state Kalman gain

Explain: Steady-state Kalman gain
K∞=lim⁡t→∞KtK_{\infty} = \lim_{t \to \infty} K_tK∞​=limt→∞​Kt​

Long-run weight on new data. High gain means the filter adapts quickly; low gain means it smooths heavily. Determined by Q/R and by the state persistence F.

0.2410

dimensionless

Filter MSE

Explain: Filter MSE
T−1∑t(α^t∣t−αt)2T^{-1} \sum_t (\hat{\alpha}_{t|t} - \alpha_t)^2T−1∑t​(α^t∣t​−αt​)2

Average squared error of the filtered state relative to the truth (available in the toy model). Lower is better.

0.2153

squared model units

Innovation variance ratio

Explain: Innovation variance ratio
T−1∑tvt2/StT^{-1} \sum_t v_t^2 / S_tT−1∑t​vt2​/St​

Should be approximately 1.0 if the filter is correctly specified, as it is here: the toy filters with the true F, Q and R. With 150-200 observations sampling noise alone moves it by about 0.1 either way. Values well above 1 indicate the model underestimates uncertainty; well below 1, it overestimates.

1.01

ratio

Signal-to-noise ratio

Explain: Signal-to-noise ratio
Q/RQ / RQ/R

Ratio of state noise to measurement noise. High Q/R favors tracking data; low Q/R favors smoothing. The Kalman gain is a monotone function of this ratio for a given F.

0.1000

ratio

Controls

very slow to fade
Explain: How long shocks last

State persistence: 0.95

How much of last period's hidden state carries into this one; higher is smoother.

Controls how much the true state (gray dashed) meanders versus mean-reverts.

truth drifts
Explain: How much the truth moves

State noise variance: 0.1

How much the hidden true value can change from one period to the next.

Higher Q increases the Kalman gain (filter trusts data more) and widens the uncertainty bands.

data mildly noisy
Explain: How noisy the measurements are

Measurement noise variance: 1

How much error sits in each observation; larger settings make the readings noisier.

Higher R decreases the Kalman gain (filter trusts the model more) and observations scatter wider around the filtered state.

150
Explain: How many periods to simulate

The number of time periods the simulation runs.

Longer samples let the Kalman gain converge to its steady-state value.

0
Explain: Where the truth starts

The true starting value of the hidden series; the filter begins at zero and must learn it. It changes the chart only, not the readouts.

Shifts the starting level of the gray dashed line. The filter starts at 0 and must learn the true initial state.

Keep going

Read next

Continue with a related concept, model, or example.

Theory model

IS-LM Model

a well-connected theoretical model two steps from here

New angle: theoretical model →
Macro by Mark
Help
Privacy PolicyTerms of UseEthics and Compliance

© 2026 Mark Jayson Nation LLC