Skip to content

Feature/barriers - #9

Merged
jsidhu06 merged 12 commits into
mainfrom
feature/barriers
May 3, 2026
Merged

Feature/barriers#9
jsidhu06 merged 12 commits into
mainfrom
feature/barriers

Conversation

@jsidhu06

@jsidhu06 jsidhu06 commented May 3, 2026

Copy link
Copy Markdown
Owner

Handle zero/tiny vol in barrier pricing engines
Block select barrier pricing engine Greeks (i.e. binomial delta/gamma when spot is very close to barrier, MC gamma, discrete monitoring theta on all engines)
Select different param defaults for FD barrier engine pricing (continuous vs discrete monitoring)
(pde); Fix American discrete KO handling

jsidhu06 and others added 12 commits April 26, 2026 19:03
- Relax UnderlyingData to allow σ=0
- Add shared coerce_positive_float helper across underlying and spec dataclasses
- Remove helper from barrier_analytical.py
- Also add three coverage tests (Asian rejection, LR-greek rejection, BSM/MC vanilla agreement)
Co-authored-by: Copilot <copilot@github.com>
…ircuit and BSM theta closed-form

- OV.delta/gamma now short-circuit to 0 (KO) or delegate the bump to a cached vanilla equivalent (KI) for inception-triggered barriers.
- BSM theta short-circuits at engine level with a closed-form (0 for AT_HIT/no-rebate, +r·V/365 for AT_EXPIRY) since the PDE identity doesn't hold for at-inception triggered KOs (it does hold for KIs but we route to vanilla.theta() for precision)
- Lift _vanilla_equivalent_valuation to OV (memoised) so PDE's existing usages share the cached instance.
- Discrete barriers require finer spatial resolution due to repeated discontinuities at observation dates; default to spot_steps=2400, time_steps=1600 with IMPLICIT (L-stable) scheme to avoid CN ringing.
- Continuous monitoring keeps existing CN/1200/800 defaults.
- Boyle-Tian Table 8 PDE_FD tolerance loosened to reflect IMPLICIT vs CN paper-truth gap.

Co-authored-by: Copilot <copilot@github.com>
- For discrete KOs, payoff is the terminal payoff after the KO reset at maturity.  The engine previously reused that same array as intrinsic for the American PSOR constraint at every step.
-  We now assign intrinsic = payoff.copy before reset
- Set default barrier theta time bump to 7 days (empirically more accurate than 1 day)
- Allows for blocking discrete monitoring theta for all pricing methods
@jsidhu06
jsidhu06 merged commit 75145dc into main May 3, 2026
15 checks passed
@codecov

codecov Bot commented May 3, 2026

Copy link
Copy Markdown

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