Re: 答复: 答复: negative discount rate

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/negative-discount-rate-tp15318p15323.html

Hello,
    optimization is a possibility, but are you sure of what you're
doing? Negative rates are one thing (and QuantLib does allow them) but
negative discount factors don't make sense...

Luigi


On Wed, May 28, 2014 at 7:44 AM, Yuanhao Zhang <[hidden email]> wrote:

> Many thanks Cheng, I would take a look at the optimization class and try it.
>
> regards
>
> Alex
>
>
> 2014-05-28 11:45 GMT+08:00 cheng.li <[hidden email]>:
>
>> Hi Yuanhao
>>
>>
>>
>> Maybe it is a little bit complicated than root finding…
>>
>>
>>
>> However if you are familiar with it, it won’t be too hard to start.
>>
>>
>>
>> Anyway I can’t come up any other idea which is suitable for your
>> requirement.
>>
>>
>>
>> Regards,
>>
>> Cheng
>>
>>
>>
>> 发件人: Yuanhao Zhang [mailto:[hidden email]]
>> 发送时间: 2014年5月28日 11:14
>> 收件人: cheng.li
>> 抄送: QuantLib QuantLib
>> 主题: Re: 答复: [Quantlib-users] negative discount rate
>>
>>
>>
>> I want to make it easy to implement. I try to make the curve shift from
>> the point after 3 month tenor to make it hard to get the negative discount
>> rate.
>>
>> Use optimization maybe too complicated, and cost too much time on the
>> optimization, if I have thousands of bond.
>>
>>
>>
>> regards
>>
>>
>>
>> Alex
>>
>>
>>
>> 2014-05-28 10:47 GMT+08:00 cheng.li <[hidden email]>:
>>
>> Hi Yuanhao,
>>
>>
>>
>> As you are actually finding a root within some interval (e.g. (0.0, inf)),
>> you can’t expect to find a “root” for sure. What you can do is to minimize
>> the error within this interval.
>>
>>
>>
>> In such case I suggest you to use optimizer instead of root finder.
>> QuantLib has a built-in framework for optimizer with constraint. E.g. you
>> can use BFGS optimizer with boundary constraint like (0.0, inf).
>>
>>
>>
>> Under such setting, when optimizer hit the boundary it will stay there or
>> try to find a better solution instead of throwing an error.
>>
>>
>>
>> Regards,
>>
>> Cheng
>>
>>
>>
>>
>>
>>
>>
>> 发件人: Yuanhao Zhang [mailto:[hidden email]]
>> 发送时间: 2014年5月28日 10:19
>> 收件人: QuantLib QuantLib
>> 主题: [Quantlib-users] negative discount rate
>>
>>
>>
>> Hi,
>>
>> I try to use the solver function like Bisection or Newton method to find
>> the root of the curve parallel shift to make sure the valuation result is
>> very close to the market quotation.
>>
>> But, when I set the minimum boundary to -0.1,  QuantLib throw out the
>> exception the discount rate can not be the negative one. I know Quantlib
>> allow user to set the discount rate to be negative one, But, I just want the
>> RootFunction to find the result to the lowest one, but never to be negative
>> one.
>>
>>
>>
>> How can I achieve it?
>>
>>
>>
>> Many thanks
>>
>>
>>
>> regards
>>
>>
>>
>> Alex
>>
>>
>
>
>
> ------------------------------------------------------------------------------
> Time is money. Stop wasting it! Get your web API in 5 minutes.
> www.restlet.com/download
> http://p.sf.net/sfu/restlet
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users