change-point-detectorlisted
Install: claude install-skill rgourley/quant-garage
# change-point-detector
You hand over a ticker. The skill pulls 2 years of daily closes,
computes log returns, and runs Bayesian Online Change-Point Detection.
Reports the specific dates where the return distribution appears to
have shifted, the confidence at each boundary, and the annualized
return + vol per segment so you can see what changed.
## When to invoke
- "When did SPY's regime shift this cycle?"
- Sharpening `market-regime` when the rule buckets miss the edge
- Auditing a pairs-scanner result: "did this pair's cointegration
break, and if so when?"
- Post-hoc labeling on a name that behaved differently pre- and
post-a specific event
Not for: real-time entries. BOCPD lags real change points by 5-20
observations; the algorithm needs enough post-shift data to update
the posterior.
## What you need
- A ticker (`--ticker`)
- `MASSIVE_API_KEY` exported
- Stocks Basic minimum
Optional:
- `--lookback-days` (default 504, ~2 years). Minimum 100.
- `--lambda-run` (default 250): prior mean run length between change
points in observations. 250 = "expect roughly one change per
year." Raise to 500 to suppress smaller regime edges; lower to
100 to be more sensitive to short-lived regimes.
## What you get back
Two output layers from one run.
**Layer 1: canonical JSON**.
`change_points` with per-detection date, index, and posterior
confidence. `segments` with per-segment n_obs, mean/std daily return,
and annualized return + vol. `current_run_length_obs` for how m