calculate the convexity of a set of cash flows or a bond
Convexity(cashflows, rate, opts)
Convexity(bond, rate, opts)
data structure created using the SimpleCashFlow constructor or a list of such data structures; cash flows
fixed or floating rate bond data structure; bond
non-negative real number; interest rate
equations of the form option = value where option is one of evaluationdate, compounding or daycounter; specify options for the Convexity command
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).
The Convexity command calculates the convexity of a set of cash flows or a bond.
For a set of cash flows Ci⁡t the convexity is defined as
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:
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).
paymentdate ≔ Jan-02-2007
cashflow1 ≔ SimpleCashFlow⁡100,paymentdate
cashflow1≔100. on January 2, 2007
Here is another example.
nominalamt ≔ 100
rate ≔ 0.05
paymentdate ≔ Jan-01-2015
startdate ≔ Jan-01-2006
enddate ≔ Jan-01-2010
coupon ≔ FixedRateCoupon⁡nominalamt,rate,startdate,enddate,paymentdate
coupon≔20. on January 1, 2015
Compute the value of this cash flow on January 01, 2005.
Here is an example using bonds.
bond ≔ FixedCouponBond⁡100,5,Years,0.05
bond ≔ moduleend module
cflows ≔ CashFlows⁡bond
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'
The Finance[Convexity] command was introduced in Maple 15.
For more information on Maple 15 changes, see Updates in Maple 15.
Download Help Document