-
Notifications
You must be signed in to change notification settings - Fork 50
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
New vanilla option FD schemes #139
Comments
Sure, especially from experienced contributors. Remind me, again, why we want FDs for European Options that do have closed form solutions? |
Ha, don't know if I'm an experienced contributor, but my C++ skills have gotten a little better since last time! I think the main reason is to cope with discrete dividends. For dividends, currently An additional reason could be to check the approximation schemes do converge to BSM, and how quickly. Probably a nice sanity check before using them on American options, where we don't have the closed-form solution. |
I’ve pushed changes for AmericanOption to my cloned repo: https://github.com/fcocquemas/rquantlib/ However, I haven’t submitted a pull request yet. Two main reasons.
https://gist.github.com/fcocquemas/4f8dfed4bae94e8c23c4c46c8bd68623 Let me know your thoughts. I wager you’ll have some suggestions on my code. While I was at it, I added all the Greeks back to the BaroneAdesiWhaley approximation method. I couldn’t figure out the reason they were off. |
Deal? PS Wasn;t that the set of greeks that was on/off upstream for a while? |
Deal!
I think a generic template for makeOption that could handle
PS. No idea. Can't find anything about it in the QL changelog. |
Sounds good to me. Re 1) why don't you plow along with the options related changes (but not yet tests). Once I am done with RcppEigen I can convert RQuantLib -- it is perfect bite-sized code work for my short commute. In a week or so that should be done and we can get to 2) of adding some first tests for your new FD schemes ... and then take a deep breath and maybe add more tests from QL and in general? As for the (non-analytical) greeks, I think we had "many" of them "at inception" and then some "disappeared" so I had empty placeholders. And now I may have missed that they are back. So thanks for filling that in. |
Sounds good to me, too. For the Greeks, with the FD schemes you only get the delta and the gamma. However, with BaroneAdesiWhaley, you get the full set (explicit formulas). |
FYI -- I just merged #140 so we now have tinytest which should make adding tests pretty easy. |
Nice. We can probably borrow some tests from Quantlib. I'm still trying to refactor so that there's not too much duplicated code. One issue I'm having is figuring out how to detect which Greeks are provided or not. Not all schemes provide them/all of them. I'd rather avoid more |
Hello,
I have tweaked
americanOptionEngine
to handle the new FD schemes described here for European options. (SeeEuropeanOptionTest::testPDESchemes()
) It seems to work fine, although some unit tests would be good.I'm also interested to add FD schemes to
europeanOptionEngine
, for comparison purposes mostly, but I haven't yet.Would you be interested in a PR? If so, I need to clean up a few (small) things before I push changes to my repo, and possibly discuss the interface for the EuropeanOption function. Adding an
engine
parameter as the last argument would likely make the most sense, to not break compatibility. But, this would be inconsistent with AmericanOption, whereengine
comes before the discrete dividend vectors.Thanks as always for your work on this, and let me know your thoughts!
The text was updated successfully, but these errors were encountered: