|
From: Daniel <gr...@gm...> - 2022-08-22 16:23:20
|
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 |