State-Space Filter

Filtering time-series state-space
Bottom Line

Loading filter assessment...

The Kalman filter estimates latent fair value and momentum from noisy observed prices using a two-state linear model with RTS backward smoothing.

--
Avg Momentum
--
Trend Participation
--
Innovation Var
--
Band Width
--
Tickers Tracked

Action Framework

Momentum + & Low Innovation
Trend is reliable. Position with the filter's direction. High conviction.
Momentum + & High Innovation
Trend exists but uncertainty is elevated. Reduce position size, widen stops.
Momentum - & Low Innovation
Controlled decline. Defensive positioning appropriate. Systematic, not panicked.
Momentum - & High Innovation
Regime uncertainty. Reduce exposure, wait for filter to stabilize before re-entry.

Overview

The Kalman filter treats the observed daily closing price as a noisy measurement of two latent states: log fair value and momentum (the rate of change of fair value). By framing the problem as linear-Gaussian state estimation, the filter continuously updates its beliefs about the true price level while discounting transient noise, microstructure effects, and short-horizon volatility.

What It Estimates

  • Latent fair value — the de-noised log-price level the market is centered on
  • Momentum state — the current drift or trend in fair value
  • Uncertainty bands — the filter's confidence in its estimates via the covariance matrix

Strengths

  • Optimal linear filter (minimum variance)
  • Recursive: updates in O(1) per timestep
  • Transparent uncertainty quantification
  • Natural framework for missing data

Limitations

  • Assumes linear dynamics and Gaussian noise
  • Parameter estimation (Q, R) requires calibration
  • May lag during structural breaks
  • Single regime model (no switching)

How It Works

The filter operates in a predict-update cycle, processing one observation at a time.

  1. Observe noisy price. Read the day's closing price $y_t$.
  2. Predict via state transition. $\hat{x}_{t|t-1} = A \hat{x}_{t-1|t-1} + C u_t$, $P_{t|t-1} = A P_{t-1|t-1} A' + Q$.
  3. Update with Kalman gain. $\hat{x}_{t|t} = \hat{x}_{t|t-1} + K_t e_t$.
  4. Smooth with RTS backward pass. Refine all historical estimates using future data.

Key Equations

State Vector

$$\mathbf{x}_t = \begin{bmatrix} \log p_t \\ \mu_t \end{bmatrix}$$

State Transition

$$\mathbf{x}_{t+1} = \mathbf{A}\,\mathbf{x}_t + \mathbf{C}\,u_t + \mathbf{w}_t, \quad \mathbf{w}_t \sim \mathcal{N}(0, \mathbf{Q})$$

Kalman Gain

$$\mathbf{K}_t = \mathbf{P}_{t|t-1}\,\mathbf{H}^\top \left(\mathbf{H}\,\mathbf{P}_{t|t-1}\,\mathbf{H}^\top + R_t\right)^{-1}$$

RTS Smoother

$$\hat{\mathbf{x}}_{t|T} = \hat{\mathbf{x}}_{t|t} + \mathbf{L}_t\left(\hat{\mathbf{x}}_{t+1|T} - \hat{\mathbf{x}}_{t+1|t}\right)$$

Diagnostics

Filter health is assessed through the innovation sequence $e_t = y_t - H \hat{x}_{t|t-1}$.

  • Autocorrelation test — Ljung-Box on innovations
  • Normality test — Jarque-Bera; heavy tails indicate non-Gaussian dynamics
  • Q/R ratio — governs responsiveness vs smoothness tradeoff

Key References

  • Kalman, R. E. (1960). A New Approach to Linear Filtering and Prediction Problems.
  • Rauch, H. E., Tung, F., and Striebel, C. T. (1965). Maximum Likelihood Estimates of Linear Dynamic Systems.
  • Harvey, A. C. (1990). Forecasting, Structural Time Series Models and the Kalman Filter.
  • Durbin, J. and Koopman, S. J. (2012). Time Series Analysis by State Space Methods.

Related Models