|
From: Philippe H. <phi...@ex...> - 2024-01-30 13:35:43
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Thank you. I looked at it and it’s great. His post-calibration simulation on HW is done in Python though so performance will be an issue. Thence my asking if there were routines existing in C++.<div><br><div>Thank you.<br><div><br id="lineBreakAtBeginningOfSignature"><div dir="ltr">Regards<div><br></div><div>Philippe Hatstadt</div><div>+1-203-252-0408</div><div><br></div></div><div dir="ltr"><br><blockquote type="cite">On Jan 30, 2024, at 7:24 AM, Luigi Ballabio <lui...@gm...> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr">Hi, not much is already existing, I'm afraid. You can have a look at Goutham's post at <a href="https://gouthamanbalaraman.com/blog/hull-white-simulation-quantlib-python.html">https://gouthamanbalaraman.com/blog/hull-white-simulation-quantlib-python.html</a> (also in the cookbook if you have it) for a few ideas; he generates interest-rate paths based on a Hull/White model, but something similar should work for G2 as well.<div><br></div><div>Hope this helps,</div><div> Luigi</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 24, 2024 at 8:03 PM Philippe Hatstadt <<a href="mailto:phi...@ex...">phi...@ex...</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I was able to calibrate a G2++ model to normal UST swaption volatilities (heroically using SOFR swaptions and re-scaling by rates ratio to generate so-called Treasury Swaption vol surface).</div><div>Code is below:</div><div><br></div><div>model = G2(term_structure);<br># engine = TreeSwaptionEngine(model, 25)<br># engine = ql.G2SwaptionEngine(model, 10, 400)<br>engine = ql.FdG2SwaptionEngine(model)<br>swaptions = create_swaption_helpers_normal(data, index, term_structure, engine)<br>optimization_method = LevenbergMarquardt(1.0e-8,1.0e-8,1.0e-8)<br>end_criteria = EndCriteria(1000, 100, 1e-6, 1e-8, 1e-8)<br>model.calibrate(swaptions, optimization_method, end_criteria)<br></div><div>a, sigma, b, eta, rho = model.params()\<br></div><div><br></div><div>The question now is as follows: I want to use this model towards a GNMA OAS model for which I would need monte-carlo paths of 2y/5y/10y forward CMT rates spaced say monthly.</div><div><br></div><div>I assume that I would first need to use the 5 G2++ parameters calibrated above and then generate paths of the short rate, then somehow compute forward CMT at each forward monthly epoch Ti by computing the break-even coupon C10(Ti) such that PV(Ti, bond(cpn=C10(Ti)) == 100?</div><div>Are there existing QL classes or modules that do all that from a given calibrated model like above?</div><div>By the same token, I would also need stochastic pathwise discount factor vectors DF(Ti, path j), i=0 to 30y monthly. Is there also a QL module that generates those? I can obviously do it manually, but I am on the python side, so I want to re-use as much of existing libraries as I can to use efficient C++ code indirectly via SWIG.</div><div><br></div><div>Regards </div><br clear="all"><div><div dir="ltr" class="gmail_signature"><div dir="ltr">Philippe Hatstadt</div></div></div></div> <br> <p dir="ltr" style="line-height:1.38;background-color:rgb(239,239,239);margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">1370 Broadway, Suite 1450 | New York, NY | 10018</span></p><p dir="ltr" style="line-height:1.38;background-color:rgb(239,239,239);margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><a href="https://www.exosfinancial.com/" target="_blank"><img src="https://exos-website-media.s3.amazonaws.com/Disclosures/img1.jpg" alt="https://www.exosfinancial.com/" data-unique-identifier=""></a> <a href="https://www.linkedin.com/company/meetexos/about/" target="_blank"><img src="https://exos-website-media.s3.amazonaws.com/Disclosures/img3.jpg" alt="https://www.linkedin.com/company/meetexos/about/" data-unique-identifier=""></a> <br></span></p><p dir="ltr" style="line-height:1.38;background-color:rgb(239,239,239);margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Broker-Dealer services offered through Exos Securities LLC, Member SIPC, FINRA. For important disclosures including Form CRS and Regulation BI click </span><a href="https://www.exosfinancial.com/general-disclosures" target="_blank"><span style="font-size:11pt;font-family:Arial;color:rgb(17,85,204);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">here</span></a>.<br></p><p dir="ltr" style="line-height:1.38;background-color:rgb(239,239,239);margin-top:0pt;margin-bottom:0pt"><span style="background-color:transparent;font-size:9pt;font-family:Arial;color:rgb(0,0,0);font-weight:700;vertical-align:baseline;white-space:pre-wrap"><br></span></p><p dir="ltr" style="line-height:1.38;background-color:rgb(239,239,239);margin-top:0pt;margin-bottom:0pt"><span style="background-color:transparent;font-size:9pt;font-family:Arial;color:rgb(0,0,0);font-weight:700;vertical-align:baseline;white-space:pre-wrap">Confidentiality Notice</span><span style="background-color:transparent;font-size:9pt;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">: The information contained in this email (including attachments) is only for the personal and confidential use of the sender and recipient named above. If the reader is not the intended recipient, you are notified that you have received this message in error and that any review, dissemination, copying or distribution is prohibited. If you have received this communication in error, please notify the sender immediately by e-mail and delete or destroy the original message and all copies. </span><br></p>_______________________________________________<br> QuantLib-users mailing list<br> <a href="mailto:Qua...@li..." target="_blank">Qua...@li...</a><br> <a href="https://lists.sourceforge.net/lists/listinfo/quantlib-users" rel="noreferrer" target="_blank">https://lists.sourceforge.net/lists/listinfo/quantlib-users</a><br> </blockquote></div> </div></blockquote></div></div></div></body></html> <br> <p dir="ltr" style="line-height:1.38;background-color:rgb(239,239,239);margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">1370 Broadway, Suite 1450 | New York, NY | 10018</span></p><p dir="ltr" style="line-height:1.38;background-color:rgb(239,239,239);margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><a href="https://www.exosfinancial.com/" target="_blank"><img src="https://exos-website-media.s3.amazonaws.com/Disclosures/img1.jpg" alt="https://www.exosfinancial.com/"></a> <a href="https://www.linkedin.com/company/meetexos/about/" target="_blank"><img src="https://exos-website-media.s3.amazonaws.com/Disclosures/img3.jpg" alt="https://www.linkedin.com/company/meetexos/about/"></a> <br></span></p><p dir="ltr" style="line-height:1.38;background-color:rgb(239,239,239);margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Broker-Dealer services offered through Exos Securities LLC, Member SIPC, FINRA. For important disclosures including Form CRS and Regulation BI click </span><a href="https://www.exosfinancial.com/general-disclosures" target="_blank"><span style="font-size:11pt;font-family:Arial;color:rgb(17,85,204);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">here</span></a>.<br></p><p dir="ltr" style="line-height:1.38;background-color:rgb(239,239,239);margin-top:0pt;margin-bottom:0pt"><span style="background-color:transparent;font-size:9pt;font-family:Arial;color:rgb(0,0,0);font-weight:700;vertical-align:baseline;white-space:pre-wrap"><br></span></p><p dir="ltr" style="line-height:1.38;background-color:rgb(239,239,239);margin-top:0pt;margin-bottom:0pt"><span style="background-color:transparent;font-size:9pt;font-family:Arial;color:rgb(0,0,0);font-weight:700;vertical-align:baseline;white-space:pre-wrap">Confidentiality Notice</span><span style="background-color:transparent;font-size:9pt;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">: The information contained in this email (including attachments) is only for the personal and confidential use of the sender and recipient named above. If the reader is not the intended recipient, you are notified that you have received this message in error and that any review, dissemination, copying or distribution is prohibited. If you have received this communication in error, please notify the sender immediately by e-mail and delete or destroy the original message and all copies. </span><br></p> |