| Financial Toolbox | Search  Help Desk |
| yldbond | Examples See Also |
Syntax
yld = yldbond(sd, md, rv, price, cpn, per, basis, maxiter, eom) yld = yldbond(sd, md, rv, price, cpn, per, basis, maxiter) yld = yldbond(sd, md, rv, price, cpn, per, basis) yld = yldbond(sd, md, rv, price, cpn, per) yld = yldbond(sd, md, rv, price, cpn) yld = yldbond(sd, md, rv, price)
Arguments
sdsd must be earlier than or equal to md.mdrvpricecpn0.per1, 2, 3, 4, 6, and 12. Default = 2.basis0 = actual/actual (default), 1 = 30/360, 2 = actual/360, 3 = actual/365.maxiter50. Enter an empty matrix [] to accept the default and also enter values for eom.eommd is an end-of-month date for a month having 30 or fewer days. 0 = ignore flag, meaning that a bond's coupon payment date is always the same day of the month. 1 = set flag (default), meaning that a bond's coupon payment date is always the last day of the month.Description
yld = yldbond(sd, md, rv, price, cpn, per, basis, maxiter, eom)
returns the yield to maturity of coupon and zero-coupon bonds using a Newton-Raphson iterative method. This function also applies to pure discount securities by setting cpn = 0. To calculate the spot rate of a security, set per = 1.
Example
Given data for three bonds with the same maturity date:sd = '01/01/1960'; md = '01/01/1990'; rv = 1000; price = [1276.76 1258.92 1197.43]; cpn = 0.08; per = 2; basis = 0; maxiter = 30; eom = 0;Execute the function.
yld = yldbond(sd, md, rv, price, cpn, per, basis, maxiter, eom)
yld =
0.0600 0.0611 0.0650
See Also
acrubond, prbond, ylddisc, yldmat, yldoddf, yldoddfl, yldoddl, yldtbill and functions for Term Structure of Interest Rates
Reference
Mayle, Standard Securities Calculation Methods, Volumes I-II, 3rd edition. Formulas 5, 7.