bondduration

Calculates the bond duration for a known bond price and future payments (coupons or fixed incomes). Depending on input, function can return scalar, vector or matrix

Arguments

  1. Number of periods (payments/incomes)
  2. Interest rate per period
  3. Value of periodic payment

Output

Bond duration

Examples

bondduration