Login  Register

Re: selective model calibration

Posted by Peter Caspers-4 on Oct 24, 2013; 9:26am
URL: http://quantlib.414.s1.nabble.com/selective-model-calibration-tp14610p14614.html

Hi Roland,

actually the third case is my core motivation since it seems not really possible to keep only the first component of a piecewise parameter fixed during calibration. A workaround is possible also in this case, but it is really ugly. 

Concerning the second case I observed that calibrating a Hull White Model with piecewise volatility to 1y/34y, 2y/33y, ... 34y/1y at the money coterminal swaptions (the reversion being fixed) takes significantly longer using a 34-dim Levenberg-Marquardt optimzation compared to 34 1-dim optimzations or zero searches. I can send example code, however it relies on a not yet officially released implementation of a GSR model (as described by Piterbarg). Up to now I added a "calibrateIterative(...)" - method to CalibratedModel as a workaround, but you have to consider in which situations this will work correctly before applying it. It would be much nicer to have a robust implementation in the GSR model itself, where you can take care of executing the procedure correctly just by invoking the base class method for each option and fix the respective components in each iteration.

Do you still think example code for the second case would be useful (then I will prepare something you can pull) or can you run a test like the one above easily on your side as well ?

I think the general solution will not require much coding, so I will give it a try on the weekend.

regards
    Peter



On 24 October 2013 10:36, Roland Lichters <[hidden email]> wrote:
Hi Peter,

that sounds interesting and useful. I keep coming across your first case, and I solved it so far by passing a vector of booleans to the model constructor and setting up calibration params and indices to them accordingly, in each model constructor, without changing QuantLib. It is not elegant, but one can select which part of the parameters are calibrated and avoid dealing with various copies of the model. I'd be curious to see whether this can be achieved with less coding when we change QuantLib as you suggest. Your second case didn't even occur to me yet.
Can we have a look at a code example? I am also happy to share my pedestrian approach if of interest.

Regards,
Roland


On 23 Oct 2013, at 21:37, Peter Caspers <[hidden email]> wrote:

> Hi,
>
>  I would like to be able to calibrate only a subset of the parameters
> of a CalibratedModel instance. Even more I would like to fix a subset of
> elements within one multidimensional parameter in some cases. With this
> one could e.g.
>
> - calibrate both reversion and volatilities or fix the reversion and
> calibrate only volatilities in a Hull White model
>
> - calibrate the model volatilities in a Hull White model iteratively to
> single interest rate options with ascending option maturities instead
> of having to do a global calibration to the whole set (which can be
> much slower when you have many options in the calibration basket)
>
> - easily avoid the redundancy in the piecewise volatlities of a markov
> model (multiplying the volatilies by a (non zero) scalar factor does
> not change the model up to numeraire recalibration)
>
> There are probably more use cases. I guess there are workarounds for
> most of these cases, but I would like to propose a solution in the
> CalibratedModel class itself. Since I am not sure about the design I am
> not just sending a pull request but would like to discuss the approach
> first. Here is what I would try:
>
> Add a parameter to the calibrate method specifying the free parameters
> in a vector<bool> and defaulting to an empty vector meaning all
> parameters are free. Within the method one can make use of the
> ProjectedCostFunction then to easily get what we want. One could also
> make this calibrate method protected and leave the public interface as
> it is, just invoking the new method with the default for the new
> parameter. That is probably better because on the level of the
> CalibratedModel one does not know the meaning of the parameters and
> of their components.
>
> Again in the protected section, provide an inner class that allows to
> construct the above vector<bool> conveniently from specifying parameters
> to include or exclude or indices within a parameter to include or
> exclude in or from the set of free parameters.
>
> This does not change anything so far. However derived models can now
> easily overwrite the calibrate method (which we would have to make
> virtual) and do a specialized calibration as needed / specified in the
> concrete models.
>
> What do you think ?
>
> regards
>  Peter
>
>
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-dev mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev



------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev