# 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.

• Very old one, still unanswered... Can you clarify your question by clearly identifying the 2 cases you are comparing and the symbols you use? Because the usage you make of $\hat{y}$, $y_c$, $y$ and $y_t$ is not clear. – Christophe Jan 18 '17 at 12:07