[R-SIG-Finance] FixedRateBondYield in Rquantlib

Kevin Ramoutar kevinramoutar at yahoo.co.uk
Fri Apr 22 16:44:38 CEST 2016

I have run the following script utilizing the FixedRateBondYield function in RQuantLib

Where price = 109.080evaluation date = 2016/04/13 (YYYY-MM-DD)Maturity date = 2018/11/15Coupon rate = 6.3%Issue date = 2003/11/06
returning a result of:[1] 0.02613533attr(,"class")[1] "FixedRateBondYield"
I cross checked the result with Excel's YIELD function and got a result of 2.639666% which is "fairly" close.
However in my analysis I wanted to evaluate yield to maturities over time and when I updated the "FixedRateBondYield" function to an earlier date (April 3, 2014) the results of the R function and Excel's YIELD function significantly diverge.
Code as follows: EMN2018 <-FixedRateBondYield(,112.538,100,as.Date("2014-04-03"),as.Date("2018-11-15"),3,,c(0.063),,,,,as.Date("2003-11-06"))
EMN2018 returns 
[1] 0.01303334     #1.303334%attr(,"class")[1] "FixedRateBondYield"
Excel's YIELD function returns 3.343845%. My excel function specification as follows YIELD(4/3/2014,11/15/2018,6.3%,112.538,100,2,2)

I would appreciate any assistance with the above.

Best RegardsKevin
	[[alternative HTML version deleted]]

More information about the R-SIG-Finance mailing list