calculate the clean price of a bond - Maple Help

Home : Support : Online Help : Mathematics : Finance : Cash Flow Analysis : Finance/CleanPrice

Finance[CleanPrice] - calculate the clean price of a bond

 Calling Sequence CleanPrice(bond, yield, compounding, opts)

Parameters

 bond - fixed or floating rate bond data structure; bond yield - non-negative constant; desired yield compounding - Simple, Continuous, Compounded, or SimpleThenCompounded; the underlying compounding type opts - equations of the form option = value where option is evaluationdate; specify options for the CleanPrice command

Description

 • The CleanPrice command computes the clean price of a bond, given its yield. Clean price does not include any accrued interest that has accumulated since the last coupon payment.
 • The parameter bond is either a fixed coupon bond or floating rate bond. The parameter yield is the desired yield.

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},\mathrm{compounding}=\mathrm{Continuous}\right]\right)$
 $\left[{\mathrm{daycounter}}{=}{\mathrm{Historical}}{,}{\mathrm{settlementdays}}{=}{0}{,}{\mathrm{businessdayconvention}}{=}{\mathrm{Unadjusted}}{,}{\mathrm{compounding}}{=}{\mathrm{Continuous}}\right]$ (2)

Consider a zero-coupon bond with a face value of 100 maturing in one year.

 > $\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 percent issued on March 15, 2005.

 > $\mathrm{Settings}\left(\mathrm{daycounter}=\mathrm{Thirty360European}\right):$
 > $\mathrm{Settings}\left(\mathrm{daycounter}\right)$
 ${\mathrm{Thirty360European}}$ (9)
 > $\mathrm{principal2}:=100:$
 > $\mathrm{coupon2}:=0.03:$
 > $\mathrm{rate2}:=0.05:$
 > $\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{cleanprice2}:=\mathrm{CleanPrice}\left(\mathrm{bond2},\mathrm{yield2},\mathrm{Compounded}\right)$
 ${\mathrm{cleanprice2}}{:=}{100.0000000}$ (11)
 > $\mathrm{YieldFromCleanPrice}\left(\mathrm{bond2},\mathrm{cleanprice2}\right)$
 ${0.02948604163}$ (12)
 > $\mathrm{CleanPrice}\left(\mathrm{bond2},\mathrm{rate2}\right)$
 ${97.35137029}$ (13)
 > $\mathrm{dirtyprice2}:=\mathrm{DirtyPrice}\left(\mathrm{bond2},\mathrm{rate2}\right)$
 ${\mathrm{dirtyprice2}}{:=}{99.41803696}$ (14)
 > $\mathrm{YieldFromDirtyPrice}\left(\mathrm{bond2},\mathrm{dirtyprice2}\right)$
 ${0.05000000002}$ (15)

Consider the same bond but with semi-annual coupons.

 > $\mathrm{bond3}:=\mathrm{FixedCouponBond}\left(\mathrm{principal2},3,\mathrm{Years},\mathrm{coupon2},\mathrm{issuedate}="March 17, 2005",\mathrm{frequency}=\mathrm{Semiannual}\right):$

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

 > $\mathrm{yield3}:=\mathrm{YieldFromCleanPrice}\left(\mathrm{bond3},100,\mathrm{Compounded}\right)$
 ${\mathrm{yield3}}{:=}{0.02997946101}$ (16)
 > $\mathrm{cleanprice3}:=\mathrm{CleanPrice}\left(\mathrm{bond3},\mathrm{yield3},\mathrm{Compounded}\right)$
 ${\mathrm{cleanprice3}}{:=}{100.0000000}$ (17)
 > $\mathrm{YieldFromCleanPrice}\left(\mathrm{bond3},\mathrm{cleanprice3}\right)$
 ${0.02975698958}$ (18)
 > $\mathrm{CleanPrice}\left(\mathrm{bond3},\mathrm{rate2}\right)$
 ${97.41008628}$ (19)
 > $\mathrm{dirtyprice3}:=\mathrm{DirtyPrice}\left(\mathrm{bond3},\mathrm{rate2}\right)$
 ${\mathrm{dirtyprice3}}{:=}{97.97675295}$ (20)
 > $\mathrm{YieldFromDirtyPrice}\left(\mathrm{bond3},\mathrm{dirtyprice3}\right)$
 ${0.05000000002}$ (21)

Note that since the bond has semi-annual coupons, the Compounded yield is based on semi-annual compounding.

 > $\mathrm{dirtyprice3}:=\mathrm{DirtyPrice}\left(\mathrm{bond3},\mathrm{rate2},\mathrm{Compounded}\right)$
 ${\mathrm{dirtyprice3}}{:=}{98.05440635}$ (22)
 > $\mathrm{cashflows3}:=\mathrm{CashFlows}\left(\mathrm{bond3}\right)$
 ${\mathrm{cashflows3}}{:=}\left[{\mathrm{1.500000000 on \text{'}March 17, 2007\text{'}}}{,}{\mathrm{1.500000000 on \text{'}September 17, 2007\text{'}}}{,}{\mathrm{1.500000000 on \text{'}March 17, 2008\text{'}}}{,}{\mathrm{100. on \text{'}March 17, 2008\text{'}}}\right]$ (23)
 > $\mathrm{add}\left({t}_{\mathrm{amount}}\mathrm{DiscountFactor}\left(\mathrm{rate2},{t}_{\mathrm{date}},\mathrm{compounding}=\mathrm{Semiannual}\right),t\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}∈\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{cashflows3}\right)$
 ${98.05440635}$ (24)