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

Heston Model: Support for Angled Contour Shift Integrals #1826

Merged
merged 41 commits into from
Dec 20, 2023

Conversation

klausspanderen
Copy link
Contributor

and improved exponentially fitted Gauss-Laguerre quadrature

@coveralls
Copy link

coveralls commented Nov 6, 2023

Coverage Status

coverage: 72.147% (-0.03%) from 72.176%
when pulling c1acc8b on klausspanderen:heston_update
into f430521 on lballabio:master.

#include <cmath>

namespace QuantLib {
std::complex<Real> expm1(const std::complex<Real>& z) {

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These implementations are for real arguments. Without further proof I'd be rather cautious to use the Pde-approximations in the complex plane.

Copy link
Contributor

Choose a reason for hiding this comment

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

You are correct.
I found this stackoverflow answer giving the same formula. Regard this thread as void if you want.

Size numberOfEvaluations() const;

static void doCalculation(Real riskFreeDiscount,
Copy link
Owner

Choose a reason for hiding this comment

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

Hi Klaus, apologies for the delay. Just to be paranoid, do you think it's possible to implement this method in terms of the new stuff and keep it around for a bit as deprecated? Unfortunately it was a public one.

@@ -58,20 +58,25 @@ namespace QuantLib {
AndersenPiterbargOptCV,
Copy link
Owner

Choose a reason for hiding this comment

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

Do you think it makes sense to declare this enumeration once and use it both here and in the analytic engine? If some of the choices are not supported by an engine, I suppose it can throw.

Comment on lines 241 to 243
QL_REQUIRE(cv_ == ControlVariate::Gatheral
|| ControlVariate::BranchCorrection,
"Gather and Branch-Correction are not supported as control-variate");
Copy link
Owner

Choose a reason for hiding this comment

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

Should this be != ? Also, after the || there's no condition, just an enum (which is probably why this passes)

Comment on lines +166 to +172
Real priceVanillaPayoff(
const ext::shared_ptr<PlainVanillaPayoff>& payoff,
const Date& maturity) const;

Real priceVanillaPayoff(
const ext::shared_ptr<PlainVanillaPayoff>& payoff, Time maturity) const;

Copy link
Owner

Choose a reason for hiding this comment

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

Do these need to be public?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we need something to put doCalcuation() users off till later. It is also used in a market model test case.

@lballabio lballabio added this to the Release 1.33 milestone Dec 20, 2023
@lballabio lballabio merged commit 42c3a24 into lballabio:master Dec 20, 2023
51 checks passed
@klausspanderen klausspanderen deleted the heston_update branch December 31, 2023 14:42
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.

4 participants