|
From: Daniel <gr...@gm...> - 2022-08-22 19:24:56
|
Thank you Dmitri for your information. Actually I increased the vol surface number to more than to be calibration volatility number, now I can solve for mean reversion and volatility now. But experience another error when I tried to change the yield curve and volatility surface to some other type, I got below error. ---> 14 model.calibrate(swaptions, optimization_method, end_criteria) ~\.conda\envs\tf-gpu\lib\site-packages\QuantLib\QuantLib.py in calibrate(self, *args) def calibrate(self, *args):> return _QuantLib.Gsr_calibrate(self, *args) def setParams(self, params): RuntimeError: G(t,w) should be called with (t,w)=(29.9985,60.0055) in Range [0,60]. What does this runtimeError mean? Thanks, Mark On Mon, Aug 22, 2022 at 12:50 PM Dmitri Goloubentsev <dm...@ma...> wrote: > Hi Mark, > > > The error is coming from LM optimiser. You should reduce number of points > in your vol surface or add more calibration instruments or add some sort of > regularisation. > > Kind regards, > Dmitri. > > On Mon, 22 Aug 2022, 17:26 Daniel, <gr...@gm...> wrote: > >> All, >> >> Please forgive me if someone has answered a similar question before. >> >> I am trying to calibrate interest rate vol surface using GSR (gaussian >> short rate model) based on this post >> >> http://gouthamanbalaraman.com/blog/short-interest-rate-model-calibration-quantlib.html >> >> and I found a python example for GSR model calibration. >> https://github.com/mlungwitz/notebooks/blob/master/GSR_Example.ipynb >> >> What I tried to do is to calibrate the same european swaption vol surface >> in the 1st python example based on 2nd example gsr model specification, >> what I added is: >> gsr = ql.Gsr(term_structure,stepDates, sigmas,reversions); >> engine = ql.Gaussian1dSwaptionEngine(gsr, 64, 7.0, True, False, >> term_structure) >> swaptions = create_swaption_helpers(data, index, term_structure, engine) >> >> optimization_method = ql.LevenbergMarquardt(1.0e-8,1.0e-8,1.0e-8) >> end_criteria = ql.EndCriteria(1000, 100, 1e-6, 1e-8, 1e-8) >> model.calibrate(swaptions, optimization_method, end_criteria) >> >> But this will give me this error: >> >> RuntimeError: less functions (5) than available variables (12) >> >> Is the error caused by Gaussian1dSwaptionEngine? Should I proceed with Gaussian1dNonstandardSwaptionEngine? What change should I do to make it work ? >> >> >> Thanks, >> >> Mark >> >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > |