What is the formula for calculating the duration of a mortgage with monthly payments?
Duration = Σ (CFj * tj) / (P * Σ (CFi / (1 + YTM)^ti)), where CFj represents cash flow at time tj, tj denotes time in years to the jth cash flow, P is the present value of all future cash flows, YTM stands for yield to maturity, CFi denotes cash flow at time ti, and ti represents time in years to the ith cash flow.