8-k-scanner
Scan SEC 8-K disclosures across a single ticker or a watchlist using Massive's pre-parsed disclosure taxonomy. Groups the underlying rows by filing (one 8-K…
Bayesian Online Change-Point Detection (BOCPD) on a ticker's daily log returns. Detects points in time where the return-generating distribution changed (regime shift in mean, vol, or both), reports the confidence at each detected boundary, and emits per-segment statistics
$ npx -y skills add rgourley/quant-garage --skill change-point-detector --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/change-point-detectorContext preview
The summary Claude sees to decide when to auto-load this skill.
Bayesian Online Change-Point Detection (BOCPD) on a ticker's daily log returns. Detects points in time where the return-generating distribution changed (regime shift in mean, vol, or both), reports the confidence at each detected boundary, and emits per-segment statistics
name: change-point-detector description: Bayesian Online Change-Point Detection (BOCPD) on a ticker's daily log returns. Detects points in time where the return-generating distribution changed (regime shift in mean, vol, or both), reports the confidence at each detected boundary, and emits per-segment statistics (annualized return, annualized vol) so the reader can see what changed. Uses Adams and MacKay (2007) BOCPD with a Normal-Gamma prior on (mu, tau) and a Student-t predictive so hyperparameters update in closed form. Requires Stocks Basic. Runs on the free tier.
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.
break, and if so when?"
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.
Optional:
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.
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 many observations since the last detected boundary. Full setup echoed (lambda_run_prior, threshold).
**Layer 2: rendered note**. Header + summary of counts, detected change point list, segment stats table, one-line Take comparing current vs prior regime.
Adams and MacKay (2007) BOCPD:
1. **Model.** Assume returns are drawn from a Normal, with unknown mean mu and precision tau. Put a Normal-Gamma prior on (mu, tau) with hyperparameters (mu0=0, kappa0=1, alpha0=0.1, beta0=0.01). This gives a Student-t predictive with closed-form updates when a new observation arrives. 2. **Run length posterior.** Maintain P(r_t = r | x_{1:t}), the posterior over "run length since last change point." At each t:
Student-t predictive under the sufficient stats accumulated for that run.
predictive summed over all previous run lengths.
3. **Hazard.** Geometric with rate 1/lambda_run. lambda_run is the prior mean run length between change points. 4. **Detection.** A time t is flagged as a change point when P(r_t = 0 | x_{1:t}) exceeds the threshold (0.5 by default). Consecutive detections within 20 observations are merged. 5. **Segments.** The boundaries partition the return series into segments; per-segment stats let a reader see the shift.
retry, and daily aggs.
Narrative note with a per-segment stats block. A single-name change point analysis is typically 0-5 segments; note format reads better than a table.
One call per run.
detector on a portfolio's daily P&L would extend cleanly by swapping the univariate predictive for a multivariate one.
Eckley 2012) is a frequentist alternative that scales O(N) and gives L2-optimal segmentation. Queued as `pelt-segmentation`.
the same update inside a loop.
A caller who cares about specific regime types (vol regime vs mean regime) could tune this.
These are clean PR extensions.
Trade like a pro. Without the terminal. View the full landing page → Quant and equity research tools that run inside Claude, or behind your own UI.
Scan SEC 8-K disclosures across a single ticker or a watchlist using Massive's pre-parsed disclosure taxonomy. Groups the underlying rows by filing (one 8-K…
Track sell-side analyst positioning on a name via Benzinga Analyst Ratings. Pulls every rating event over the lookback window, classifies each as upgrade /…
Build a clean, point-in-time, ready-to-backtest OHLCV dataset for a US equity universe across an arbitrary date window. Emits parquet plus a manifest plus an…
Single-commodity macro read. Answers "is this commodity in a winning or losing macro setup right now" and names the macro driver that dominates it. Pulls one…
Reconcile a position file against splits, dividends, and spinoffs to catch breaks before they hit P&L or T+1 settlement. Use when an operator hands over a CSV…
Scan for material 8-K corporate actions over a lookback window. For a ticker or watchlist, pulls SEC EDGAR 8-K filings, filters to material items (offerings,…