|
From: Luigi B. <lui...@gm...> - 2020-06-09 16:11:35
|
Hello Frederick,
unfortunately the optimizer can impose constraints on the parameters,
not the fitted quotes. I would do as you already did, that is, modify
FittingCost::values() to add a penalty when the quotes are outside the
range. I'm not sure why that would give you a worse curve, but optimizers
are hard to reason about. If I had to guess, it might be that the
unconstrained optimization goes through the forbidden range before going to
the minimum, and by adding a penalty you're blocking that path. But you
would need to print out the values during optimization to be sure of what's
happening.
Sorry this wasn't a lot of help,
Luigi
On Fri, May 15, 2020 at 2:25 PM Frederick Delaroche <
fre...@ri...> wrote:
> Hi all,
>
>
>
> I am using FittingBondDiscountCurve, Svensson fitting method. Fitting is
> working nicely; however, I wanted to add a specific control over change in
> quotes (i.e. no constraint on Svensson parameters) to keep the fitted quote
> within a given range (e.g. a bid / ask).
>
>
>
> - *Is there any way to do this with QuantLib?*
>
>
>
> I have tried a basic solution (modifying the FittingCost::values function
> by changing the error when error itself was above (or below) a given
> value), but it doesn’t work as expected: depending on the limit, I don’t
> find the optimal values for the fitted quotes.
>
>
>
> “Not find the optimal values” means:
>
> - If I don’t have any limit for quotes move, I have a set of fitted
> quotes. If I check the max error compared to orginal quotes and if I set
> this move as the limit, I will find a different set of fitted quotes which
> give a “worse” discount curve.
>
>
>
> Thanks for your help.
>
>
>
> Rgds,
>
> -
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|