CONVEXIT Function
calculates and returns a scalar containing the convexity of a noncontingent cashflow
The CONVEXIT function calculates and returns a scalar containing the convexity
of a noncontingent cashflow.
 times
 is an ndimensional column vector of times.
Elements should be nonnegative.
 flows
 is an ndimensional column vector of cashflows.
 ytm
 is the perperiod yieldtomaturity of the
cashflow stream. This is a scalar and should be positive.
Convexity is essentially a measure of how duration,
the sensitivity of price to yield, changes as interest rates
change:

C = [1/P] [( d^{2} P)/( dy^{2} )]
With cashflows that are not yield sensitive, and the assumption of
parallel shifts to a flat termstructure, convexity is given by:
where P is the present value,
y is the effective per period yieldtomaturity,
K is the number of cashflows, the kth
cashflow being c(k) t_{k} periods from the present.
Example
proc iml;
timesn=do(1,100,1);
timesn=T(timesn);
flows=repeat(10,100);
ytm=.1;
convexit=convexit(timesn,flows,ytm);
print convexit ;
quit;
CONVEXIT
199.26229
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.