|
From: Shashank C. <sha...@gm...> - 2022-08-11 13:59:23
|
Hi jack , Thank you for your help. I really appreciate it. I am not sure what library does the “minimize” function belongs to ? I am not a Python programmer so I am trying to translate this code to C++. Regards Shashank On Thu, Aug 11, 2022 at 9:24 AM Jack G <jac...@gm...> wrote: > Shashank, > > Can I recommend this excellent answer by David Duarte that I think will do > exactly what you want? > > > https://quant.stackexchange.com/questions/57786/sabr-model-pricing-engine-in-python-quantlib > > Best, > Jack > > On Tue, Aug 9, 2022 at 11:17 AM Shashank Choudhary < > sha...@gm...> wrote: > >> Hi Jack , >> >> I am trying to find the values of Rho and Nu which minimize the mean >> squared error between market volatility and volatility computed using the >> sabr model formula for a given set of parameters (alpha, rho, nu , beta). I >> can assume Beta to be 0.5 while alpha can be ATM volatility. >> Now I need to set up the calibration as explained in the MATLAB version >> below >> >> https://www.mathworks.com/help/fininst/calibrating-the-sabr-model.html >> >> Now quantlib has the sabr model class in C++ with the formula to compute >> the volatility, but I need to calibrate the parameters rho and Nu >> that minimises the error function. >> >> Hope this makes sense :) >> >> regards >> Shashank >> >> >> >> On Mon, Aug 8, 2022 at 7:14 PM Jack G <jac...@gm...> wrote: >> >>> Hi Shashank, >>> >>> What exactly are you trying to do here? SABR is a funny one because >>> although it is a "model", it usually isn't used as such and is just used >>> for smile interpolation at a given tenor (with different SABR "models" >>> fitted to each tenor). Quite a lot of the art is about how to choose these >>> adjacent smile fits. >>> >>> I'm not aware of an inbuilt calibrator but it should be easy enough to >>> calibrate to a given vol smile. How are you interacting with QuantLib? >>> There are some exams of calibrators in the cookbook I believe, and I have >>> some python code for QuantLib that will do this for SABR as well if it >>> help,. >>> >>> >>> Best, >>> Jack >>> >>> >>> On Tue, 9 Aug 2022, 06:01 Shashank Choudhary, <sha...@gm...> >>> wrote: >>> >>>> Hi , >>>> >>>> How do I use the calibration engine for the SABR model parameters? I >>>> can access the sabr model class and find implied volatilities for a given >>>> set of parameters but I can’t locate and use the calibration engine, if >>>> there’s one. >>>> >>>> Any help would be much appreciated :) >>>> >>>> Regards >>>> Shashank >>>> _______________________________________________ >>>> QuantLib-users mailing list >>>> Qua...@li... >>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>> >>>> |