float imsl_f_convexity (struct tm settlement, struct tm maturity, float coupon_rate, float yield, int frequency, int basis)
The type double function is imsl_d_convexity.
Required Arguments
struct tmsettlement (Input) The date on which payment is made to settle a trade. For a more detailed discussion on dates see the Usage Notes section of this chapter.
struct tm maturity (Input) The date on which the bond comes due, and principal and accrued interest are paid. For a more detailed discussion on dates see the Usage Notes section of this chapter.
floatcoupon_rate (Input) Annual interest rate set forth on the face of the security; the coupon rate.
floatyield (Input) Annual yield of the security.
intfrequency (Input) Frequency of the interest payments. It should be one of IMSL_ANNUAL, IMSL_SEMIANNUAL or IMSL_QUARTERLY. For a more detailed discussion on frequency see the Usage Notes section of this chapter.
intbasis (Input) The method for computing the number of days between two dates. It should be one of IMSL_DAY_CNT_BASIS_ACTUALACTUAL, IMSL_DAY_CNT_BASIS_NASD, IMSL_DAY_CNT_BASIS_ACTUAL360, IMSL_DAY_CNT_BASIS_ACTUAL365, or IMSL_DAY_CNT_BASIS_30E360. For a more detailed discussion see the Usage Notes section of this chapter.
Return Value
The convexity for a security. If no result can be computed, NaN is returned.
Description
Function imsl_f_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 imsl_coupon_number, and .
Example
In this example, imsl_f_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.