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.
Recursive state estimator that updates latent macro states as each noisy observation arrives.
Graph workspace
The Kalman filter's primary output is the filtered state estimate with its conditional variance . The top panel shows the filtered state (and optionally the true state for the toy model) with standard-deviation bands. The bottom panel shows the innovation sequence , which should be white noise if the filter is correctly specified.
Steady-state Kalman gain
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
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
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
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
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.
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.
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.
The number of time periods the simulation runs.
Longer samples let the Kalman gain converge to its steady-state value.
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.