LessonThis is a lesson restated in new words. Any figure in it is an example from the source, not this desk's record.
A mean-reversion trade needs a level to lean against, and that level is an estimate. A Kalman filter keeps the estimate alive by blending a mean-reversion model with each new price. How far the level moves is a noise choice you set, and a level that chases the tape is also a noisier one.
Why it matters
In a classroom simulation, prices come from a process that really is pulled toward a stable center. You fit that center from a sample, buy when price sits far under it, and sell when price sits far over it. Single trades still lose. The lecture's picture is a gain path that climbs because size is sensible and the estimate is right often enough.
That picture needs a stationary process. Listed prices are not one. A name can look pulled toward a center, then drift, then act as if the center moved. Trade against a level you froze weeks ago and the old level becomes a bad magnet. The filter exists because the question is not only what the mean was, but when it stopped being that mean.
The idea in plain words
The textbook model is an Ornstein-Uhlenbeck process, a random path tugged toward a long-run level. Nobody observes that level, or a stock's expected return. You take a window of prices and fit a center. On the lecture's live screen the bars are one minute long and the fit uses sixty of them. The fitted center is a dashed reference, already an estimate. For a process that really is Ornstein-Uhlenbeck, the law of large numbers pulls the sample toward the long-run level, and trading around it is treated as statistically efficient. Position size is the remaining design choice.
Live prices refuse that story. There is no single long-run mean for the law to find, and the right window is not obvious. The filter treats the mean-reversion model as a prior belief, then lets new bars tug the estimated level. In the example the filtered level sits under the dashed fit because the recent path is falling. The model says revert. The tape says the center moved. The filter reports a compromise.
The compromise has a dial. Call the observations very noisy and the level barely budges, so trades lean hard toward the older center. Call them clean and the level chases every swing. Adaptation helps only when the move is a real regime change rather than chatter.
How to use it
Fit the parameters on a stated window, then run the filter on bars you did not use for that fit. The lecture's one-minute bars and sixty-bar calibration are a baseline, not a universal setting.
Walk the fit forward: choose parameters on one slice, apply them on the next, and roll. Nudge the noise dial and the window length. A useful specification should not collapse because the window grew by a handful of bars. Someone who has followed one company through policy, sector, and news may still use the filtered level as a reference. The lecture says no indicator plays the hand, and not to trade the screen live if you cannot say what this process is.
What usually goes wrong
The classroom curve is not a forecast of a brokerage account. The smooth result belongs to a stationary mean-reverting process, which listed stocks are not, so the asymptotic claim does not transfer.
A stale level means you notice the regime changed only after a string of losses. A noise setting so loose that every bar rewrites the thesis is the opposite error. Shopping one window, one noise value, and one ticker until a backtest looks calm does not finish the system. The lecture's warning is that walk-forward work can still fall apart live.
Questions people ask
Do I need the true long-run mean?
No. In the stationary textbook case an estimate is enough, because repeated bets only need to be right on average and sized with care. You never check the estimate against a hidden true mean.
How fast should the filtered mean move?
As fast as the noise setting allows. High noise keeps the original model in charge. Low noise lets recent prices drag the level. That dial is the practical tradeoff.
Can a backtest settle the noise setting?
It can narrow the candidates. Slice the history, refit, and test the next slice. Stability across nearby settings tells you more than the single best in-sample curve, and it is still not a promise about the next regime.