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

-