Repository navigation
Fix _norm_cdf scaling; add option pricer backtest + sensitivity model - #31
Open
IamJasonBian wants to merge 1 commit into
Open
IamJasonBian wants to merge 1 commit into
IamJasonBian wants to merge 1 commit into
Conversation
- Fix options/black_scholes._norm_cdf: A&S 7.1.26 approximates erf but was applied to x without the 1/sqrt(2) scaling (bug inherited from the allocation-engine port), so Phi was off by up to ~0.04 and every bs_call_price/bs_put_price consumer in options/ was skewed. - Add bs_call_implied_vol (bisection). - Add options/pricer_backtest: prices a real contract daily with three sigma models (realized vol, frozen entry IV, prior-day IV) and scores MAE / bias / MAPE vs actual closes. - Add options/sensitivity: analytic Greeks + spot x IV x days-forward grid. - Same change as IamJasonBian/allocation-engine#62. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
options/black_scholes._norm_cdfapplied the A&S 7.1.26 erf approximation toxwithout the1/sqrt(2)scaling (inherited from the allocation-engine port), so Φ was off by up to ~0.04. Everybs_call_price/bs_put_priceconsumer inoptions/(simulation, backtest_forward, historical_pricing, vol compares, report) was skewed.bs_call_implied_vol: bisection IV solver.options/pricer_backtest: prices a real contract daily with three σ models and scores them vs actual closes.options/sensitivity: analytic Greeks + spot × IV × days-forward scenario grid CLI.Same change as IamJasonBian/allocation-engine#62.
Backtest — NBIS 11/20/2026 $230C, 2026-09-29 → 2026-10-20 (n=16)
Run
Test plan
math.erf)options/reports — numbers change with the Φ fix🤖 Generated with Claude Code