Closed fcocquemas closed 6 years ago
I'd say so, and as it generally new how about running it by the (very friendly) folks over at QuantLib?
Repo is here: https://github.com/lballabio/QuantLib/ and I guess you know about the mailing list(s).
We could also integrate it here first and test and illustrate then bubble up upstream. Deal?
Deal. I don't understand the QL codebase very well at all, but that email from Luigi Ballabio suggests that it might not be something easy to do upstream in a general way.
Sorry, had not seen the email link.
Hm. If it is hard to do there ... how do plan to attack it here is the two code-bases are so close?
(Sorry, at work, and no time to look in great detail hence quick replies)
Well, Luigi Ballabio claims that it is hard to do for the general case. However he does give a simple example for a particular instance. Basically, you shift volatility by a small increment and compute two prices around the original value, then compute the slope of the secant.
So right now all I do is this:
QuantLib::Spread dvol = 0.0001;
vol->setValue(volatility + dvol);
QuantLib::Real P1 = option.NPV();
vol->setValue(volatility - dvol);
QuantLib::Real P2 = option.NPV();
QuantLib::Real vega = (P1 - P2) / (2 * dvol);
vol->setValue(volatility);
Right. I have done that somewhere too. Can't remember where though.
I think this can be closed.
I need to (numerically) compute the vega of American options when using discrete dividends (and thus
CrankNicolson
). Inspired by this example, I have written seven lines of codes that do just that. I do not have a proper way of benchmarking at this point, but the values are close enough to the European vega that some papers use as a proxy.Is there any interest for me to submit this in a PR? The downside is that it requires computing the option price twice more, so there is likely a computing cost for more intensive applications.