Basic Prerequisites: 05 · Failure Modes & Practice.


1. Intuition & Practical Objective

The Kalman filter is causal: at time it uses only . That is exactly right for a live trading system - you cannot use data you don’t have. But two important jobs are not causal:

  • Research and signal attribution - “what was the true dynamic hedge ratio over the backtest?” uses the whole sample, including the future relative to each point. The optimal answer is the smoother, not the filter, and it is strictly more accurate (same data, more of it used per estimate).
  • Non-linear / non-Gaussian models - stochastic volatility, duration, default intensity, and regime models are not linear-Gaussian. The Kalman filter is then only the best linear estimator, and a particle filter (sequential Monte Carlo) recovers the true nonlinear posterior.

This page covers both: the Rauch–Tung–Striebel (RTS) smoother (the offline twin of the filter, which is the EM/MLE workhorse for state-space models) and the bootstrap particle filter (the general non-linear/non-Gaussian engine), applied to the canonical finance example - stochastic volatility.


2. Mathematical Ground Truth & Derivations

2.1 The Rauch–Tung–Striebel smoother (offline)

The filter runs forward producing and . The smoother then runs backward, using the future to sharpen each estimate:

Because it conditions on more data, always - smoothing can only reduce uncertainty. Tsay §11.1.1 defines the smoothing problem ( for ); the backward recursion above is the standard RTS form. The smoother is what you use to (i) look back at the latent state, and (ii) run the EM algorithm for maximum-likelihood parameter estimation in state-space models (E-step = smoother).

2.2 Why the Kalman filter is not enough: non-linearity

In the stochastic-volatility model the observation is a non-linear function of the log-variance state:

The measurement density is non-Gaussian in , and a single daily return is genuinely weak information about - which is exactly why volatility is hard to measure. Linearizing (extended Kalman filter) is biased here; the right tool is to represent the whole posterior with weighted samples.

2.3 The bootstrap particle filter (SIR)

Sequential importance resampling maintains a weighted sample approximating :

  1. Weight: (multiply in log space to avoid underflow).
  2. Estimate: (any posterior functional).
  3. Resample when the effective sample size falls below (systematic resampling), reset weights to .
  4. Propagate: .

As the particle approximation converges to the true posterior for any non-linear, non-Gaussian model - at cost per step. This is the general successor to the Kalman filter.


3. Computational Implementation - smoother and particle filter, both from scratch

Part A runs the RTS smoother on the local-level model and measures the variance/RMSE reduction. Part B is a bootstrap particle filter for the stochastic-volatility model, scored against the known latent log-volatility.

Part A: the smoother uses the same data but cuts the mean posterior variance by 44.4% and the RMSE by 15.2% versus the causal filter - a free lunch only if your use-case is offline (research, EM estimation, attribution). Part B: the particle filter recovers the latent log-volatility with RMSE 0.330 against a stationary spread of 0.503 (corr 0.63) from a non-linear, non-Gaussian model the Kalman filter cannot handle at all - and the mean effective sample size (2995 of 4000) confirms the particle set stays healthy. The practical reading: Kalman for the linear-Gaussian core, smoother for offline study, particles for the models that break linearity.


4. Failure Modes & First-Principles Breakdowns

  1. Using the smoother to “decide” past trades. The smoother knows the future at every point; a backtest that trades its output is look-ahead bias dressed as cleverness. Filters deploy, smoothers research.
  2. Particle degeneracy / weight collapse. With a too-narrow proposal and a heavy-tailed likelihood, ESS collapses to a handful of particles and the estimate becomes noise. Monitor ESS, resample, and prefer a low-variance resampling scheme; for hard problems use a better proposal (auxiliary/guided PF).
  3. Particle filters do not scale to high state dimension (“curse of dimensionality”): the number of particles needed grows exponentially with the state dimension. For high-dimensional linear-Gaussian problems, use the Kalman filter (or ensemble Kalman filter) - particles are for low-dimensional non-linear problems.
  4. Smoothing is not forecasting. A smoother’s low RMSE over history does not translate into a better tradeable signal; the gain from smoothing is delivered retrospectively and is unavailable in real time. Don’t confuse the two types of “accuracy”.
  5. Model risk does not vanish with better filters. A perfect particle filter for a wrong stochastic-volatility model is still wrong. Non-linear filters fix the inference, not the model - the misspecification failure mode (page 05) survives every upgrade here.

5. References

  • Tsay, Analysis of Financial Time Series (3rd ed.)
  • Särkkä, S.: Bayesian Filtering and Smoothing (2013)
  • Durbin & Koopman, Time Series Analysis by State Space Methods
  • Doucet, de Freitas & Gordon, Sequential Monte Carlo Methods in Practice
  • Harvey, Kim & Shephard (1994), Estimation of stochastic volatility models with diagnostics

6. Connected Graph Bridges