Skip to content

Feature/barriers - #10

Merged
jsidhu06 merged 10 commits into
mainfrom
feature/barriers
May 5, 2026
Merged

Feature/barriers#10
jsidhu06 merged 10 commits into
mainfrom
feature/barriers

Conversation

@jsidhu06

@jsidhu06 jsidhu06 commented May 5, 2026

Copy link
Copy Markdown
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.

jsidhu06 added 10 commits May 3, 2026 21:33
…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

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.10526% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/derivatives_pricing/valuation/core.py 91.66% 1 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@jsidhu06
jsidhu06 merged commit 9be0fb9 into main May 5, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant