Kalman Filter Innovations and Residuals in Pair Trading
Summary
This note raises a modeling question about calculating a spread for mean-reversion pairs trading with a Kalman filter. It contrasts the measurement prediction error, formed from the observed value and the filter’s predicted measurement, with a residual formed using the measurement estimate after the state has been updated with the observation. The distinction is whether the spread is based on the forecast made before incorporating the current observation or on the fitted value after that update.
The document asks what advantage the prediction error might have, but supplies no answer, experiment, or performance evidence. It therefore does not establish which quantity is preferable as a trading signal. A researcher applying either definition would need to specify the filter timing carefully and evaluate the resulting spread behavior and strategy out of sample, since using the updated estimate changes how the current observation enters the residual.
Key ideas
- The note compares a Kalman filter’s pre-update measurement prediction error with a post-update residual.
- The two quantities differ in whether the current observation has already updated the estimated state.
- The document asks which is preferable for pair-trading spread calculation but provides no conclusion or evidence.
- Any strategy comparison should define filter timing and assess the signal out of sample.
Tags
Full text
# mean reversion with Kalman Filter - Spread calculation
# mean reversion with Kalman Filter - Spread calculation
Ernest Chan in its book "Algorithmic Trading" shows how to use the Kalman Filter for mean reversion pair trading.
I have seen that he uses the measurement prediction error for calculating the spread size. In other works, he bases the spread calculation on:
$$ e = y_{t} - \hat{y} $$
where, $ \hat{y} $ is the measurement prediction based on the state variable predictor $ \hat{x}(k+1|k)$ where $k$ is the time/measurement.
I was wondering what the advantage of using the measurement prediction error instead of the residuals is. With residuals I mean $y - y_c$ where $y_c$ is the estimate of the measurement based on the updated/corrected state variable.
Thanks.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.