http://quantlib.414.s1.nabble.com/selective-model-calibration-tp14610p14612.html
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.
> 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-devFree 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 >