Zero coupon bond yield


#1

Hi,

I’m trying to get the yield of a zero coupon bond by using the DiscountingFixedCouponBondProductPricer.yieldFromDirtyPrice method but coming up against a problem because the factorToNextCoupon method (called by dirtyPriceFromYieldStandard), divides by the fixed rate (0) - which results in NaN everywhere.

Even though there aren’t actually any coupons, should the FixedCouponBond class support zero coupon bonds?

Thanks,


#2

Hi Adam,

Thanks for pointing this to us. You are right there is a problem with fixed coupon = 0. In the code we are multiplying and then dividing by the fixed rate. This is fine, except when there is a 0. The class should support bonds with coupon = 0.

We will correct the problem very soon.

Thanks again for sharing the issue.

Regards,

Marc


#3

A fix for this has just gone into the master branch (https://github.com/OpenGamma/Strata/pull/1094), which will be in the 1.0 release due at the end of June.


#4

Brilliant, Thanks, will give it a go when it’s released.