[R-SIG-Finance] Complex yields.

Keith S Weintraub kw1958 at gmail.com
Tue Jul 7 18:35:13 CEST 2015


Forgive me if I have asked this before in this forum.

I have been working on some bonds with odd cashflows and I need to be able to back out the yield from the price.

Sometimes the yield will turn out to be complex.

I have used the polyroot function in {base} R which works fine. Usually there are a number of non-complex roots that make sense.

The problem with using polyroot is that the exponents have to be integers (polyroot <—> polynomial). That leaves me with a bit of a problem when I want to find the yield of a bond with coupons on off-dates.

For example suppose I have an 11 day front stub and semi-annual coupon payments. With coupon payments at 11, 191, 376, … I would then have to convert to days and have a problematic numerical calculation.

If you have any pointers to papers on this or code I would greatly appreciate it.

Thanks so much for your time,

More information about the R-SIG-Finance mailing list