Skip to content
Prev 2581 / 15274 Next

Bond valuation

Duration calculation is indeed contained in termstrc

The entry is given as...

duration {termstrc}

The function calculates the Macauly duration, modified duration and 
duration based weights.
Usage
duration(cf_p, m_p, y)

Arguments
cf_p     cashflows matrix including the prices of the bonds.
m_p     maturity matrix, the first row is filled with zeros.
y     yields of the bonds.


Charles Ward
Paul DeBruicker wrote: