When the market changes its mind
A series is stationary if its statistics, such as the mean and the spread, stay the same over time. Markets are not. A strategy may have a steady mean for years and then lose it, volatility may sit near and then jump, and a correlation may break in a crisis. These changes come in three shapes: a sudden jump (a level shift), a slow slide (drift) and a switch between regimes. The SPY return has an annual volatility of in 2017, in 2008 and in 2020. A single estimate from the whole history describes none of these years well, so we need to notice changes and then adapt.
The CUSUM (cumulative sum) detector is the classic tool. Fix a baseline volatility from a calm period and measure each day by , which averages when nothing has changed. Add to a running total each day, where is an allowance that ignores small excesses, and never let the total go below zero. When the total passes a threshold , raise the alarm. Resetting at zero is the key: a long calm stretch cannot bank credit that later hides a real change. A small or reacts faster but raises more false alarms.
Detection is only half the job. A particle filter can also raise a flag by itself: when today's return is very unlikely under the current cloud, the average likelihood is tiny and the effective sample size collapses, as on 10 October 2018. After an alarm you can widen the filter's noise so that it follows the new level faster, restart it from a flatter belief or switch to an estimator with a shorter memory, which is the next topic.
- Three shapes of change: a jump, a drift and a switch of regime.
- CUSUM: a running total of excess evidence that is reset at zero and raises an alarm above a threshold.
- Speed against false alarms: a lower threshold finds changes sooner but cries wolf more often.
Lab · what's graded
- The total on day two10 pts
- The total on day four10 pts
- The first alarm day10 pts
- A standardised squared return15 pts
- A variance ratio10 pts
- Lowering the threshold10 pts
- A monitoring loop10 pts
- Match the vocabulary10 pts
- Why reset at zero15 pts