|
From: Peter C. <pca...@gm...> - 2018-07-30 19:34:57
|
Hi Francois,
let’s be a bit careful changing this ;-) … this computes a projected fixing of an Ibor Index which by definition is a simply (linearly) compounded rate r. The forward compound factor between d1 and d2 is therefore
1 + r * yearFraction(d1, d2)
The same compound factor in terms of discount factors (and therefore independent of any rate conventions) is given by disc1 / disc2, from which the return value formula follows.
Best Regards
Peter
> On 30 Jul 2018, at 13:02, Francois Botha <ig...@gm...> wrote:
>
> Hi,
>
> I notice this code:
>
> inline Rate IborIndex::forecastFixing(const Date& d1,
> const Date& d2,
> Time t) const {
> QL_REQUIRE(!termStructure_.empty(),
> "null term structure set to this instance of " << name());
> DiscountFactor disc1 = termStructure_->discount(d1);
> DiscountFactor disc2 = termStructure_->discount(d2);
> return (disc1/disc2 - 1.0) / t;
> }
>
> The last line looks odd to me. disc1/disc would return a non-continuously compounded return. Dividing by t is the approach to annualise continuous returns. So the 2 are not consistent.
>
> I would have expected:
> return std::pow(disc1 / disc2, 1 / t) - 1.0;
>
> On the other hand, if I make that change, many tests fail, so I'm by no means confident about my assertion above.
>
> regards
> Francois Botha
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
|