Feature/barriers - #9
Merged
Merged
Conversation
- 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>
…in BT98 Table6 greeks
…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
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.
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