Difference in values obtained from BNDYIELD in MATLAB and YIELD in EXCEL
9 views (last 30 days)
Show older comments
MathWorks Support Team
on 13 May 2016
Answered: MathWorks Support Team
on 19 May 2016
'BNDYIELD 'is a function that calculates the yield to maturity for a fixed-income security. Let's take an IBM bond as an example. The CUSIP '459200JG7' refers to a (almost 10 year to maturity from today) IBM corporate bond with the following characteristics:
Coupon: 3.45% Maturity: 02/19/2026 Day Count: 30/360 Coupon Frequency: Semi-Annual No Odd Coupons (Last or First)
Let's say that I'm purchasing this bond today for a settlement Date (t+3) of May 10th, 2016. Let's say that I am purchasing this Bond at a price of $106.8125 and assuming a redemption (par) amount of $100, I would like to know what is the yield of maturity I am getting.
If I use the bndyield formula in MATLAB:
Yield = bndyield(106.8125,0.0345,'05/10/2016','02/19/2026','Period',2,'Basis',1)
I get a result of 0.026530631026615 or 2.6531% yield (rounded up)
Using an Excel formula of YIELD...
=YIELD("5/10/2016","02/19/2026",0.0345,106.8125,100,2,0)
...and using the same inputs, I get the following result:
0.0265385150 or a yield of 2.6539%.
The 'BNDYIELD' in MATLAB and YIELD function in Excel generate different values for same set of parameters.
Accepted Answer
MathWorks Support Team
on 13 May 2016
The issue here is the optional input argument DiscountBasis in the function BNDYIELD. The default for this optional input argument is to use actual/actual for SIA bases. Here is the description of this optional input argument:
DiscountBasis - Basis used to compute the discount factors for
computing the yield. The default behavior is for SIA
bases to use the actual/actual day count to compute
discount factors, and for ISMA day counts and BUS/252
to use the specified basis.
It seems like Excel uses the same basis for discounting and generating cash flows. We get a similar answer when calling BNDYIELD with this optional argument.
>>Yield = bndyield(106.8125,0.0345,'05/10/2016','02/19/2026','Period',2,'Basis',1, 'DiscountBasis',1)
Yield =
0.026538515006546
0 Comments
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!