Repository navigation
Fix Heston ADI term-structure consistency - #115
Conversation
This branch has not been deployed
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.
What is this PR for?
Fixes the non-flat-curve pricing error in #114. Heston drift and ADI discounting now use instantaneous forward rates, European Heston boundaries use
D(T)/D(t), and Douglas stages use the appropriate old/new calendar times. A default discounting-rate accessor preserves other models' existing convention. Production changes and eleven new regression tests are mirrored in both source trees.For
Dr(t)=exp(-0.01*t-0.08*t*t),q=0.02, constant variance0.04, andS0=K=100, T=1, the fine-grid call improves from 9.2175627974 to 11.3075312066, versus the analytic 11.3129337493. Refining the grid reduces the patched error from 0.01835 to 0.00540.Dependency: this PR is stacked on #113, whose natural variance-boundary correction is required. The comparison contains only the term-structure patch. Merge #113 first, then retarget this PR to
main.What type of PR is it?
Bug Fix
Todos
mainbefore merging.What is the related issue?
Fixes #114. Follows the separate term-structure observation in #112.
How should this be tested?
Local validation on Oracle JDK 17.0.12 / Maven 3.6.3, for both
java-11andjava-8source profiles:-Ddoclint=none).git diff --checkpassed.The Java 8 source-profile run used:
Additional actual-runtime check on Oracle JDK 8u181: all production/test sources compiled, Checkstyle passed, and JavaDoc passed with
-Ddoclint=none. Strict Java 8 JavaDoc failed on pre-existing errors in unchanged files such asAbstractTreeProduct.javaandConfigTree.java. The numerical run under x86 emulation was stopped after 12½ minutes with no completed test-class report; actual Java 8 numerical validation remains incomplete locally, despite matching intermediate prices. GitHub Actions provides the full Java 8 runtime test run.The full repository suite was not run locally; GitHub Actions runs it.
Questions:
Does the licenses files need update?
No.
Are there breaking changes for older versions?
No required interface implementation changes: the new accessor has a default implementation. Non-flat Heston prices intentionally change. Existing scalar-rate constructors retain their interpolation/extrapolation convention, which does not produce flat exponential curves at all maturities.
Does the change require additional documentation?
The helper/accessor JavaDoc describes the numerical rate and compatibility convention. Scope is European Heston 2D ADI; other products and 1D/3D solvers are not fully migrated. Rate differentiation averages adjacent rates at curve knots, and the complete Douglas scheme remains generally first order because discounting stays explicit.