Alternatives:
If price and/or yield, accrued interest, current yield, estimated Macaulay duration, estimated convexity, interest on interest, etc. are required, and estimates of duration measures (change in price due to a + and - swing of 0.01 basis points) can be used in place of actual duration measures, use the bond_risk routine instead of this routine.
Notes:
The price input to this routine is the dirty price, which is used as the denominator in the duration equation. If a 0 is input for price, this routine calculates the denominator as the present value of coupon and principal cash flows.
Results:
The variable dur contains the calculated Macaulay duration. The variable mod_dur contains the modified duration. The results are accurate to as many places as supported by double precision values.
Error Conditions:
Returned values should be ignored for a non-zero status. See Errors.