zero/yoy rates in inflationtermstructure.hpp

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

zero/yoy rates in inflationtermstructure.hpp

mudcrab
Hi there, I was wondering about the motivation for setting the default for
extrapolate to "false" for the following two functions in
inflationtermstructure.hpp:

Rate zeroRate(const Date &d, const Period& instObsLag = Period(-1,Days),
                      bool forceLinearInterpolation = false,
                      bool extrapolate = false) const;

Rate yoyRate(const Date &d, const Period& instObsLag = Period(-1,Days),
                     bool forceLinearInterpolation = false,
                     bool extrapolate = false) const;

Could any argument be made for allowing the extrapolate Boolean to be
passed in through the associated InflationTermStructure constructors
rather than hard-coding it in the inflationtermstructure.hpp file?   I
couldn't find any (easy) way to extrapolate my zeroinflationtermstructure
other than to set the "false" in the top line above to "true" and then
recompile the library.


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: zero/yoy rates in inflationtermstructure.hpp

Luigi Ballabio
On Thu, 2010-06-03 at 13:26 -0700, [hidden email] wrote:

> Hi there, I was wondering about the motivation for setting the default for
> extrapolate to "false" for the following two functions in
> inflationtermstructure.hpp:
>
> Rate zeroRate(const Date &d, const Period& instObsLag = Period(-1,Days),
>                       bool forceLinearInterpolation = false,
>                       bool extrapolate = false) const;
>
> Rate yoyRate(const Date &d, const Period& instObsLag = Period(-1,Days),
>                      bool forceLinearInterpolation = false,
>                      bool extrapolate = false) const;
>
> Could any argument be made for allowing the extrapolate Boolean to be
> passed in through the associated InflationTermStructure constructors
> rather than hard-coding it in the inflationtermstructure.hpp file?   I
> couldn't find any (easy) way to extrapolate my zeroinflationtermstructure
> other than to set the "false" in the top line above to "true" and then
> recompile the library.

I admit it's not immediately obvious (the relevant method is inherited
from a few levels up the hierarchy) but on a per-curve basis, you can
call

curve->enableExtrapolation();

to set the default to true for that curve.

Luigi



--

Barker's Proof:
Proofreading is more effective after publication.



------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users