|
From: Ben W. <ben...@ma...> - 2021-10-18 09:45:55
|
Hi Hamed, A couple of things…. HW model uses swaption volatility to model the evolution of coupon paying swaps, not zero rates. This a ‘Q’ measure (market implied) type model – this is important distinction as the requirement is to calibrate the market quotes. You are looking at zero coupon Canadian Government rates which are not market quotes (they are implied from market rates) and there is no option market to get implied Vol from. The Vasicek model is not used as a Q measure because it can not calibrate to the market. I suspect you are looking at P (real world) measures - in which case you estimate the volatility and mean reversion from historical data. Quantlib has a Vasicek model (ql.Vasicek(r0=0.05, a=0.1, b=0.05, sigma=0.01, lambda=0.0) but it is up to you to come up with r, a, b, sigma and lamba. Regards Ben From: Hamed Helali <hel...@gm...> Sent: Monday, 18 October 2021 11:12 AM To: qua...@li... Subject: [Quantlib-users] Calibrating short-rate models on zero-coupon bonds Hello, I am trying to use the QuantLib package in Python for calibrating term-structure models in order to forecast upcoming yield curves. I reviewed these instructions on calibrating the short rate models: http://gouthamanbalaraman.com/blog/short-interest-rate-model-calibration-quantlib.html You have shown calibrating HW model using swaption data. What I am trying to do is using zero-coupon bond yield curves to calibrate the Vasicek model. The data is retrieved from this page: https://www.bankofcanada.ca/rates/interest-rates/bond-yield-curves/ However, I could not map what you have in the instructions to what I need in my task. For example, I cannot figure out what function should I use instead of SwaptionHelper. Generally, I am having a hard time understanding helpers and their purpose. Also, I could not find any docs for model.calibrate() method. P.S.: I got this feedback that using vanilla zero-coupon bond yields for calibrating models will not give a good estimation of volatility. I need to use instruments with some optionality in order to calibrate the volatility. Could please comment on this. I cannot understand the reason behind this clearly. Best, Hamed. |