Feature/barriers - #10
Merged
Merged
Conversation
jsidhu06
commented
May 5, 2026
Owner
- Amend discrete barrier default params in PDEParams.for_barriers cls method.
- Add inception-triggered barrier short-circuits for vega and rho. Add tests for all 5 barrier inception-triggered Greeks.
- Tighten _validate_bump: raise on bump+non-NUMERICAL even on auto-resolve.
- Amend random_seed default in MonteCarloParams from None to 42.
…ethod - Previously: spot_steps, time_steps = 2400, 1600 - Now: spot_steps, time_steps = 1600, 1200 - News res is 2x faster, only very marginally less accurate - Loosen rtol in TestBarrierPresentValueAgainstBroadieGlasserman from 0.002 to 0.004
- Current suite tests: numerical bump and reprice delta/gamma (they avoid state transition), analytical (BSM) theta.
…olve - Bump kwargs (epsilon/time_bump_days/rate_bump) previously silently no-op'd when auto-select resolved to ANALYTICAL/GRID/TREE. - Validation now runs after _resolve_greek_method against the resolved method, replacing the silent-ignore foot-gun with an actionable error pointing users to either drop the bump or pass greek_calc_method=NUMERICAL.
- More accurate for bump and revalue Greeks
- Avoids the un-trigger problem on discrete bumped pricing dates and keeps theta consistent with the gamma/delta short-circuits
- Mirrors the delta/gamma/theta NUMERICAL pattern (KO → 0 or closed-form, KI → vanilla equivalent) for symmetry. - Add 24 new test cases (TestInceptionTriggeredGreekShortCircuits now covers all five greeks across BSM/BIN/PDE_FD NUMERICAL combos). - Also harmonize comment style across all five short-circuits in core.py.
….NUMERICAL into vanilla delta() calls - Passing epsilon alone now raises an exception if auto resolve does not resolve to NUMERICAL
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.