Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an experimental analytic pricer for forward-start european options in Heston model #943

Merged
merged 7 commits into from
Nov 28, 2020
Merged

Adding an experimental analytic pricer for forward-start european options in Heston model #943

merged 7 commits into from
Nov 28, 2020

Conversation

jackgillett101
Copy link
Contributor

@jackgillett101 jackgillett101 commented Nov 23, 2020

…ions in Heston model

This is an implementation of S. Kruse's paper "On the Pricing of Forward Starting
Options under Stochastic Volatility
", which gives an analytical form for forward start options in the Heston model.

There are still several improvements possible (implementation of the characteristic function calculator, integration choices, some numerical stability issues at distant parameters, probably more...), but as a first step I thought it made sense to add this to the experimental section of the repo.

I've tested the prices against the MC procedure and the analytic procedure where possible and they seem reliable (eg. see image below).

image

(the coloured lines are prices coming from this pricer, the lilac points at resetTime=0 are vanilla prices coming from AnalyticHestonEngine, and the brown dots are MC prices coming from MCForwardEuropeanHestonEngine)

@lballabio lballabio added this to the 1.21 release milestone Nov 23, 2020
@coveralls
Copy link

coveralls commented Nov 24, 2020

Coverage Status

Coverage increased (+0.04%) to 71.213% when pulling a9bd208 on jackgillett101:analytic_heston_forward_european into 60afa35 on lballabio:master.

I hadn't realised that even LD prices have some randomness if the seed is removed, which caused occasional failuers.

DayCounter dc = Actual360();
SavedSettings backup;
Date today = Date::todaysDate();
Copy link
Owner

@lballabio lballabio Nov 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole test suite sets a fixed evaluation date before starting, so I suggest using

      Date today = Settings::instance().evaluationDate();

instead.

The idea is that having the evaluation date dependent on the actual today's date makes the tests prone to spurious errors, upon which we have to increase the tolerance to pass. Using a variable date might find some actual errors, but it's unlikely and we don't run the test suite every day anyway.

(Using the fixed date might also allow you to get the tolerance back to its original value in the previous test case.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This certainly seems sensible. The other tests in that test suite use the current day's date as well (I'd borrowed their convention) - shall I make the change across the suite while I'm doing it?

@jackgillett101
Copy link
Contributor Author

I've moved to the fixed date throughout the test file. All pass.

I tightened the tolerance again, needed to add some more paths as MC error s still quite large (also changed to PSR because these provide an MC error estimate which I used to track it while developing)

@lballabio lballabio merged commit 43272b2 into lballabio:master Nov 28, 2020
@lballabio lballabio changed the title Adding an experimental analytic pricer for forward-start european opt… Adding an experimental analytic pricer for forward-start european options in Heston model Nov 28, 2020
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.

None yet

3 participants