YieldFromDirtyPrice - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Finance

  

YieldFromDirtyPrice

  

calculate the yield of a bond given its dirty price

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

YieldFromDirtyPrice(bond, price, compounding, opts)

Parameters

bond

-

fixed- or floating-rate bond data structure; bond

price

-

non-negative constant; bond's dirty 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 YieldFromDirtyPrice 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 YieldFromDirtyPrice command calculates a bond's yield based on the specified dirty price.

• 

The parameter bond can be either a fixed-rate bond or a floating-rate bond.

• 

The parameter price is the desired dirty price.

• 

The (optional) parameter compounding specifies what type of compounding will be used to calculate the yield. By default Continuous compounding is assumed.

Examples

withFinance:

SetEvaluationDateNovember 25, 2006:

EvaluationDate

November 25, 2006

(1)

Settingsdaycounter=Historical,settlementdays=0,businessdayconvention=Unadjusted,compounding=Continuous

daycounter=Historical,settlementdays=0,businessdayconvention=Unadjusted,compounding=Continuous

(2)

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

bond1ZeroCouponBond100,5,Years:

price1DirtyPricebond1,0.05,Compounded

price178.35261665

(3)

yield1YieldFromDirtyPricebond1,price1

yield10.04879016417

(4)

EquivalentRateyield1,Continuous,Annual

0.05000000000

(5)

yield1YieldFromDirtyPricebond1,price1,Compounded

yield10.05000000006

(6)

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

Settingsdaycounter=Thirty360European:

Settingsdaycounter

Thirty360European

(7)

principal2100:

coupon20.03:

rate20.05:

bond2FixedCouponBondprincipal2,3,Years,coupon2,issuedate=March 17, 2005:

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

yield2YieldFromDirtyPricebond2,100,Compounded

yield20.04649381416

(8)

dirtyprice2DirtyPricebond2,yield2,Compounded

dirtyprice2100.0000000

(9)

YieldFromDirtyPricebond2,dirtyprice2

0.04544535191

(10)

dirtyprice2DirtyPricebond2,rate2

dirtyprice299.41803696

(11)

YieldFromDirtyPricebond2,dirtyprice2

0.05000000002

(12)

Consider the same bond but with semi-annual coupons.

bond3FixedCouponBondprincipal2,3,Years,coupon2,issuedate=March 17, 2005,frequency=Semiannual:

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

yield3YieldFromDirtyPricebond3,100,Compounded

yield30.03443376844

(13)

dirtyprice3DirtyPricebond3,yield3,Compounded

dirtyprice3100.0000000

(14)

YieldFromDirtyPricebond3,dirtyprice3

0.03414070640

(15)

dirtyprice3DirtyPricebond3,rate2

dirtyprice397.97675295

(16)

YieldFromDirtyPricebond3,dirtyprice3

0.05000000002

(17)

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

dirtyprice3DirtyPricebond3,rate2,Compounded

dirtyprice398.05440635

(18)

cashflows3CashFlowsbond3

cashflows31.500000000 on 'March 17, 2007',1.500000000 on 'September 17, 2007',1.500000000 on 'March 17, 2008',100. on 'March 17, 2008'

(19)

addtamountDiscountFactorrate2,tdate,compounding=Semiannual,tincashflows3

98.05440635

(20)

Compatibility

• 

The Finance[YieldFromDirtyPrice] command was introduced in Maple 15.

• 

For more information on Maple 15 changes, see Updates in Maple 15.

See Also

Finance[AccruedAmount]

Finance[CleanPrice]

Finance[DayCounter]

Finance[DirtyPrice]

Finance[FixedCouponBond]

Finance[FloatingRateBond]

Finance[FormatDate]

Finance[ParseDate]

Finance[YearFraction]

Finance[YieldFromCleanPrice]

Finance[ZeroCouponBond]