IMSL C# Numerical Library

Bond.Convexity Method 

Returns the convexity for a security.

public static double Convexity(
   DateTime settlement,
   DateTime maturity,
   double coupon,
   double yield,
   Frequency frequency,
   DayCountBasis basis
);

Parameters

settlement
The DateTime settlement date of the security.
maturity
The DateTime maturity date of the security.
coupon
A double which specifies the security's annual coupon rate.
yield
A double which specifies the security's annual yield.
frequency
A int which specifies the number of coupon payments per year (1 for annual, 2 for semiannual, 4 for quarterly).
basis
A DayCountBasis object which contains the type of day count basis to use.

Return Value

A double which specifies the convexity for a security.

Remarks

Convexity is the sensitivity of the duration of a security to changes in yield. It is computed using the following:

{{{1 \over {\left( {q \times {\it 
            frequency}} \right)^2 }}\left\{ {\sum\limits_{t = 1}^n {t\left( {t + 
            1} \right)} \left( {{{\it coupon} \over {\it frequency}}} \right)q^{ 
            - t} + n\left( {n + 1} \right)q^{ - n} } \right\}} \over {\left( 
            {\sum\limits_{t = 1}^n {\left( {{{\it coupon} \over {\it 
            frequency}}} \right)q^{ - t} }  + q^{ - n} } \right)}}

where n is calculated from Coupnum, and q = 1 + 
            {{\it yield} \over {\it frequency}}.

See Also

Bond Class | Imsl.Finance Namespace | Example