CONVEXITY Function
Evaluates the convexity for a security.
Usage
result = CONVEXITY(settlement, maturity, coupon_rate, yield, frequency, basis)
Input Parameters
settlement—The date on which payment is made to settle a trade. For a more detailed discussion on dates see Chapter 8, Working with Date/Time Data in the .
maturity—The date on which the bond comes due, and principal and accrued interest are paid. For a more detailed discussion on dates see Chapter 8, Working with Date/Time Data in the .
coupon_rate—Annual interest rate set forth on the face of the security; the coupon rate.
yield—Annual yield of the security.
frequency—Frequency of the interest payments. It should be 1, 2 or 4.
*1—One payment per year (Annual payment)
*2—Two payments per year (Semi-annual payment)
*4—Four payments per year (Quarterly payment)
basis—The method for computing the number of days between two dates. It should be 0, 1, 2, 3 or 4.
*0—Actual/Actual
*1—US (NASD) 30/360
*2—Actual/360
*3—Actual/365
*4—European 30/360
Returned Value
result—The convexity for a security. If no result can be computed, NaN is returned.
Input Keywords
Double—If present and nonzero, double precision is used.
Discussion
Function CONVEXITY computes the convexity for a security. Convexity is the sensitivity of the duration of a security to changes in yield.
It is computed using the following:
where n is calculated from the function COUPON_NUM and:
Example
In this example, CONVEXITY computes the convexity for a security with the settlement date of July 1, 1990, and maturity date of July 1, 2000, using the Actual/365 day count method.
settlement = VAR_TO_DT(1990, 7, 1)
maturity = VAR_TO_DT(2000, 7, 1)
coupon = .075
yield = .09
frequency = 2
basis = 3
PRINT, CONVEXITY(settlement, maturity, coupon, yield, $
   frequency, basis)
; PV-WAVE prints: 59.4050