Finance - Maple Programming 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

Parameters

Options

Description

Examples

Compatibility

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

Options

• 

compounding = Simple, Continuous, Annual, Semiannual, EveryFourthMonth, Quarterly, Bimonthly, Monthly, SimpleThenAnnual, SimpleThenSemiannual, SimpleThenEveryFourthMonth, SimpleThenQuarterly, SimpleThenBimonthly, or SimpleThenMonthly -- This option specifies the compounding type for the given interest rate.

• 

daycounter = a name representing a supported day counter (e.g. ISDA, Simple) or a day counter data structure created using the DayCounter constructor -- This option provides a day counter which will be used to convert the period between two dates as a fraction of the year.

• 

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).

Description

• 

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

• 

For a set of cash flows C[i]t the convexity is defined as

it2C[i]tPtiC[i]tPt

  

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:

paymentdateJan-02-2007

paymentdateJan-02-2007

(1)

cashflow1SimpleCashFlow100,paymentdate

cashflow1100. 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.

nominalamt100

nominalamt100

(5)

rate0.05

rate0.05

(6)

paymentdateJan-01-2015

paymentdateJan-01-2015

(7)

startdateJan-01-2006

startdateJan-01-2006

(8)

enddateJan-01-2010

enddateJan-01-2010

(9)

couponFixedRateCouponnominalamt,rate,startdate,enddate,paymentdate

coupon20. 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.

bondFixedCouponBond100,5,Years,0.05

bondmoduleend module

(12)

cflowsCashFlowsbond

cflows5. 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)

Compatibility

• 

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

• 

For more information on Maple 15 changes, see Updates in Maple 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