The Engle-Granger and Johansen estimators treat the cointegrating vector as a constant estimated once over a formation window. For many pairs this is adequate, but when the economic relationship between two firms drifts — leverage ratios change, product mix shifts, a stock reclassifies into a different sector — the static becomes stale. Trades entered on a mis-estimated hedge ratio carry unintended directional exposure, and the spread no longer mean-reverts to the expected equilibrium.
The Kalman filter solves this by treating as a time-varying state that is tracked and updated daily using every new price observation. The filter predicts the spread given today's hedge ratio, observes the actual price, and updates the estimate — balancing prior belief against new evidence in an optimal (minimum-variance) way. It is the continuous-time analog of rolling window OLS, but without the sharp cut-off and with an explicit model for how evolves.
Learning objectives. By the end of this note you should be able to:
- write down the state-space model for a pairs-trading dynamic hedge ratio;
- execute one step of the scalar Kalman filter: predict, observe, compute the gain, update state and variance;
- explain what the Kalman gain measures and how it balances prior and new information;
- show that the scalar Kalman filter with unit variances is a weighted moving average with Fibonacci weights;
- describe the smoothing application: downsampled random walk and its use for multi-scale trend extraction.
In this lesson
-
- The state-space model
-
- The Kalman filter update equations
-
- The scalar random-walk special case
-
- Application: Kalman smoothing for multi-scale trend extraction
Before you start
The full lesson, with worked examples and exercise solutions, is for members.
Read the full lessonNew to SelfMadeQuant.com? See membership options or browse the Statistical Arbitrage syllabus.