calculate the convexity of a set of cash flows or a bond - Maple Help

Online Help

All Products    Maple    MapleSim


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

Finance[Convexity] - calculate the convexity of a set of cash flows or a bond

Calling Sequence

Convexity(cashflows, rate, opts)

Convexity(bond, rate, opts)

Parameters

cashflows

-

data structure created using the SimpleCashFlow constructor or a list of such data structures; cash flows

bond

-

fixed or floating rate bond data structure; bond

rate

-

non-negative real number; interest rate

opts

-

equations of the form option = value where option is one of evaluationdate, compounding or daycounter; specify options for the Convexity command

Description

• 

The Convexity command calculates the convexity of a set of cash flows or a bond.

• 

For a set of cash flows Cit the convexity is defined as

it2CitPtiCitPt

  

where Pt is the discount factor at time t implied by the given interest rate.

• 

A bond's convexity is defined as the weighted second derivative of the price function with respect to the interest rate:

ⅆ2ⅆr2BrBr

• 

The parameter cashflows is a cash flow or a list of cash flows (see FixedRateCoupon, InArrearIndexedCoupon, ParCoupon, SimpleCashFlow, or UpFrontIndexedCoupon).

• 

The parameter bond must be a fixed- or floating-rate bond data structure (see FixedCouponBond, FloatingRateBond, ZeroCouponBond).

Examples

withFinance:

SetEvaluationDateJan-01-2005:

paymentdate:=Jan-02-2007

paymentdate:=Jan-02-2007

(1)

cashflow1:=SimpleCashFlow100,paymentdate

cashflow1:=100. on January 2, 2007

(2)

Convexitycashflow1,0.03,evaluationdate=Jan-01-2005

4.010966410

(3)

Convexitycashflow1,0.03,evaluationdate=Jan-01-2004

9.016445862

(4)

Here is another example.

nominalamt:=100

nominalamt:=100

(5)

rate:=0.05

rate:=0.05

(6)

paymentdate:=Jan-01-2015

paymentdate:=Jan-01-2015

(7)

startdate:=Jan-01-2006

startdate:=Jan-01-2006

(8)

enddate:=Jan-01-2010

enddate:=Jan-01-2010

(9)

coupon:=FixedRateCouponnominalamt,rate,startdate,enddate,paymentdate

coupon:=20. on January 1, 2015

(10)

Compute the value of this cash flow on January 01, 2005.

Convexitycoupon,0.03,evaluationdate=Jan-01-2005

100.

(11)

Here is an example using bonds.

bond:=FixedCouponBond100,5,Years,0.05

bond:=moduleend module

(12)

cflows:=CashFlowsbond

cflows:=5. on 'January 1, 2006',5. on 'January 1, 2007',5. on 'January 1, 2008',5. on 'January 1, 2009',5. on 'January 1, 2010',100. on 'January 1, 2010'

(13)

Convexitybond,0.03,evaluationdate=Jan-05-2000

92.45245571

(14)

Convexitycflows,0.03,evaluationdate=Jan-05-2000

92.45245571

(15)

See Also

Finance[CompoundFactor], Finance[DiscountFactor], Finance[Duration], Finance[EvaluationDate], Finance[FixedRateCoupon], Finance[InArrearIndexedCoupon], Finance[NetPresentValue], Finance[ParCoupon], Finance[SetEvaluationDate], Finance[SimpleCashFlow], Finance[UpFrontIndexedCoupon], Finance[ZeroCurve]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam