-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
#include <cmath> | ||
|
||
namespace QuantLib { | ||
std::complex<Real> expm1(const std::complex<Real>& z) { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
QL_REQUIRE(cv_ == ControlVariate::Gatheral | ||
|| ControlVariate::BranchCorrection, | ||
"Gather and Branch-Correction are not supported as control-variate"); |
There was a problem hiding this comment.
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)
Real priceVanillaPayoff( | ||
const ext::shared_ptr<PlainVanillaPayoff>& payoff, | ||
const Date& maturity) const; | ||
|
||
Real priceVanillaPayoff( | ||
const ext::shared_ptr<PlainVanillaPayoff>& payoff, Time maturity) const; | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
and improved exponentially fitted Gauss-Laguerre quadrature