Finance - Maple Programming Help

Home : Support : Online Help : Mathematics : Finance : Financial Instruments : Finance/YieldFromCleanPrice

Finance

 YieldFromCleanPrice
 calculate the yield of a bond given its clean price

 Calling Sequence YieldFromCleanPrice(bond, price, compounding, opts)

Parameters

 bond - fixed- or floating-rate bond data structure; bond price - non-negative constant; bond's clean price compounding - Simple, Continuous, Compounded, or SimpleThenCompounded; the underlying compounding type opts - equations of the form option = value where option is one of accuracy, iterations, or evaluationdate; specify options for the YieldFromCleanPrice command

Options

 • accuracy = positive -- This option specifies the desired accuracy of the result. The default value is 1e-9.
 • evaluationdate = a string containing a date specification in a format recognized by ParseDate or a date data structure -- This option specifies the evaluation date. By default this is set to the global evaluation date (see EvaluationDate).
 • iterations = posint -- This option specifies the maximum number of iterations. The default value is 100000.

Description

 • The YieldFromCleanPrice command calculates a bond's yield based on the specified clean price.
 • The parameter bond can be either a fixed-rate bond or a floating-rate bond.
 • The parameter price is the desired clean price.
 • The (optional) parameter compounding specifies what type of compounding will be used to calculate the yield. By default, Continuous compounding is assumed.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$
 > $\mathrm{SetEvaluationDate}\left("November 25, 2006"\right):$
 > $\mathrm{EvaluationDate}\left(\right)$
 ${"November 25, 2006"}$ (1)
 > $\mathrm{Settings}\left(\left[\mathrm{daycounter}=\mathrm{Historical},\mathrm{settlementdays}=0,\mathrm{businessdayconvention}=\mathrm{Unadjusted}\right]\right)$
 $\left[{\mathrm{daycounter}}{=}{\mathrm{Historical}}{,}{\mathrm{settlementdays}}{=}{0}{,}{\mathrm{businessdayconvention}}{=}{\mathrm{Unadjusted}}\right]$ (2)

Consider a zero-coupon bond with a face value of 100 maturing in five years.

 > $\mathrm{bond1}≔\mathrm{ZeroCouponBond}\left(100,5,\mathrm{Years}\right):$
 > $\mathrm{price1}≔\mathrm{CleanPrice}\left(\mathrm{bond1},0.05,\mathrm{Compounded}\right)$
 ${\mathrm{price1}}{:=}{78.35261665}$ (3)
 > $100\mathrm{DiscountFactor}\left(0.05,5,\mathrm{compounding}=\mathrm{Annual}\right)$
 ${78.35261665}$ (4)
 > $100{\left(\frac{1}{1.05}\right)}^{5}$
 ${78.35261665}$ (5)
 > $\mathrm{yield1}≔\mathrm{YieldFromCleanPrice}\left(\mathrm{bond1},\mathrm{price1}\right)$
 ${\mathrm{yield1}}{:=}{0.04879016417}$ (6)
 > $\mathrm{EquivalentRate}\left(\mathrm{yield1},\mathrm{Continuous},\mathrm{Annual}\right)$
 ${0.05000000000}$ (7)
 > $\mathrm{yield1}≔\mathrm{YieldFromCleanPrice}\left(\mathrm{bond1},\mathrm{price1},\mathrm{Compounded}\right)$
 ${\mathrm{yield1}}{:=}{0.05000000006}$ (8)

Consider a 3-year bond with a face value of 100 that pays a fixed coupon of 3% issued on March 15, 2005.

 > $\mathrm{principal2}≔100:$
 > $\mathrm{coupon2}≔0.03:$
 > $\mathrm{rate2}≔0.05:$

We will use the Thirty360European day counter.

 > $\mathrm{Settings}\left(\mathrm{daycounter}=\mathrm{Thirty360European}\right):$
 > $\mathrm{Settings}\left(\mathrm{daycounter}\right)$
 ${\mathrm{Thirty360European}}$ (9)
 > $\mathrm{bond2}≔\mathrm{FixedCouponBond}\left(\mathrm{principal2},3,\mathrm{Years},\mathrm{coupon2},\mathrm{issuedate}="March 17, 2005"\right):$

Calculate the bond's clean price given its yield and vice-versa.

 > $\mathrm{yield2}≔\mathrm{YieldFromCleanPrice}\left(\mathrm{bond2},100,\mathrm{Compounded}\right)$
 ${\mathrm{yield2}}{:=}{0.02992505925}$ (10)
 > $\mathrm{price2}≔\mathrm{CleanPrice}\left(\mathrm{bond2},\mathrm{yield2},\mathrm{Compounded}\right)$
 ${\mathrm{price2}}{:=}{100.0000000}$ (11)
 > $\mathrm{yield3}≔\mathrm{YieldFromCleanPrice}\left(\mathrm{bond2},\mathrm{price2}\right)$
 ${\mathrm{yield3}}{:=}{0.02948604163}$ (12)
 > $\mathrm{CleanPrice}\left(\mathrm{bond2},\mathrm{yield3}\right)$
 ${99.99999999}$ (13)

Compatibility

 • The Finance[YieldFromCleanPrice] command was introduced in Maple 15.