|
From: Peter C. <pca...@gm...> - 2020-06-16 19:53:16
|
Hi Matthias S, if you have n step dates the GSR model (in its most general form) has n+1 volatility and n+1 reversion parameters, i.e. 2n+2 free parameters in total. Alternatively you can use a time independent mean reversion which leaves you with n+2 free parameters. You can fix any subset of these parameters to values of your choice and calibrate the remaining parameters using the CalibratedModel::calibrate() function to an arbitrary set of CalibrationHelpers. The number of helpers that are required to run the optimisation depends on the optimiser you choose. The GSR model has some predefined convenience functions to fix certain parameters (FixedReversions(), FixedVolatilities(), MoveVolatility(), MoveReversion()), you can look at their implementation to see how to set up a general vector of booleans that fixes the parameter subset you want. There are also customised calibration functions (calibrateVolatilitiesIterative(), calibrateReversionsIterative()) which run several calibrations on subsets of parameters in sequence, which can be more efficient than calibrating all free parameters in one optimisation. The most usual use case (at least from my point of view) is to have a time independent, fixed mean reversion and a stepwise volatility function that is calibrated to a strip of swaptions or caps. If you post a concrete example you are trying to run and which causes problems, we can help you with that. Thanks Peter > On 16. Jun 2020, at 17:41, Matthias Siemering <mat...@gm...> wrote: > > Hello Matthias, > > Thank you for the pointer to Peter Caspers' blog. > Now ceased the attempts to calibrate mean reversion with Gsr. > > Have been looking at the GeneralizedHullWhite implementation, too. "Interesting" results when comparing to the regular one, but need further investigation before it potentially bears another question. > > > Regards, > > Matthias > > > On Sat, Jun 6, 2020 at 2:00 PM lungwitz <lun...@go... <mailto:lun...@go...>> wrote: > Hi Matthias, > > Peter Caspers has written a quite detailed description on his Blog on his GSR implementation that I have found very helpful: > > https://quantlib.wordpress.com/2015/03/29/gaussian-models/ <https://quantlib.wordpress.com/2015/03/29/gaussian-models/> > > For callable Bonds you can use a nonstandard swaption (including a rebate and a Credit Spread) as described there, through this does not capture the Credit Spread volatility related part of the option. > > Indeed the mean reversion has to be provided as an external input. > > Best regards > Matthias > > -------- Ursprüngliche Nachricht -------- > Von: mat...@gm... <mailto:mat...@gm...> > Datum: 06.06.20 12:36 (GMT+01:00) > An: qua...@li... <mailto:qua...@li...> > Betreff: [Quantlib-users] Gaussian short rate model + calibration > > Dear QL users, > > I cannot say I have great familiarity with short-rate or market models, so please bear with me on this one: > > Trying to value a multi-callable swaption and bond using a Hull-White model with (piecewise) time-dependent volatility. > As I understand, <ql/models/shortrate/onefactormodels/hullwhite.hpp> does not satisfy this condition: > > This class implements the standard single-factor Hull-White model defined by > \f[ > dr_t = (\theta(t) - \alpha r_t)dt + \sigma dW_t > \f] > where \f$ \alpha \f$ and \f$ \sigma \f$ are constants. > > I believe it was this ML's archive where I picked up Gsr as a recommended alternative and it looks fine (for some definition of "fine") for swaption pricing. > There are two questions, however: > > 1) It is apparently not possible to calibrate both volatilities and reversion(s). > > While Gsr implements CalibratedModel, performing "joint" calibration like this > > // vector<bool> fixedParms = gsr->FixedReversions(); > vector<Real> modelVols(voldates.size() + 1, 0.01); > fixedParms = vector<bool>(modelVols.size() + 1, false); > gsr->calibrate(calibSet, lm, ec, NoConstraint{}, vector<Real>{}, fixedParms); > > would not work, because only the first modelVols.size() number of calibration instruments are acknowledged, leaving the optimizer with an under-determined function. > > Likely there is a good reason for this. Market practice to have mean reversion as a given model parameter? Or that is just the way the model is supposed to work? > > 2) There is no pricing engine for callable bonds that can consume Gsr, if I am not mistaken. Gsr does not seem to implement ShortRateModel: > > Gsr <- {Gaussian1dModel, CalibratedModel, ...} <- {TermStructureConsistentModel, ...} > > Likely to do with the tree(const TimeGrid&) method in that interface. Alternatively, there is <ql/experimental/shortrate/generalizedhullwhite.hpp>. It sits in the "experimental" folder, but so does everything callable bond related. So I wonder whether the latter is more suitable for instrument/bond pricing while Gsr might be more model of choice for scenario generation purposes? > > > Again, apologies for any incorrect terminology or confusing remarks. Happy to clarify further, if necessary (and possible for me). > > > Thank you, > > Matthias > > > > > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... <mailto:Qua...@li...> > https://lists.sourceforge.net/lists/listinfo/quantlib-users <https://lists.sourceforge.net/lists/listinfo/quantlib-users> > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users |