Formula to calculate modified duration
The formula to calculate modified duration is:
Modified Duration = Macaulay Duration / (1 + YTM/n)
Where:
Macaulay Duration = the weighted average number of years to maturity of cash flows
YTM = yield to maturity (the total return)
n = number of coupon periods per year
The Macaulay duration is named after economist and mathematician Frederick Macaulay, who developed the concept of bond duration in the 1930s. Calculating the Macaulay duration is the most difficult part of calculating the modified duration of an asset.
The formula for calculating the Macaulay duration is as follows:
Macaulay Duration = in ti X (PVi/V)
Where:
i = the index for time flows
n = number of coupon periods per year
ti = the time period until the ith payment will be received
PVi = the present value of the time-weighted cash flow
V = the present value of all cash flows