Residual Edge Analyzer tests whether a strategy’s returns contain performance that simple baselines do not explain. You supply a CSV with a date, the strategy return and each baseline return, plus a JSON config that declares the baseline choice, return basis, analysis scope and universe data type.
The script runs an intercept OLS model with Newey-West standard errors for the primary baseline and all sensitivity baselines, adds rolling alpha stability and regime breakdowns, and writes a JSON artifact and a Markdown report. It fetches no data and changes no exposure. The skill frames it as a falsification gate and not as trade authorization.
What You Get
- A JSON artifact with the primary and sensitivity model results
- A concise Markdown report
- Annualized alpha with a HAC t-statistic, and the residual edge ratio
- Rolling alpha stability, VIF for multi-factor models and residual autocorrelation
- An active-return breakdown across predeclared regimes
- Handoff guidance to backtest-expert, signal-postmortem and trade-performance-coach
Common Use Cases
- Checking whether a backtest beats a market or equal-weight baseline
- Explaining whether a drawdown came from baseline exposure or from strategy behaviour
- Adding an attribution quality gate after backtesting
- Comparing results across alternate baseline models for sensitivity
What Makes It Unique
It is built to disprove an edge as much as to find one. Baselines must be declared up front, gross and net bases must match, same-universe baselines need point-in-time membership, and missing declarations lower the verdict. The skill lists what it is not: holdings-based Brinson attribution, feature-level Shapley explanations, or analysis from summary metrics without a dated return series.
Under The Hood
Claude runs one Python script, analyze_residual_edge.py, from the shell with an input CSV, a config file and output paths. The script reads those local files, does the statistics itself and writes the JSON and Markdown reports to the paths you give. It makes no network calls and fetches no market data. Two reference files describe the input contract and the statistical methodology, and Claude loads them when it needs to explain the inputs or interpret results.