@travishorn/financejs
    Preparing search index...

    Function calculateModifiedDuration

    • Returns the modified Macauley duration for a security with an assumed par value of $100.

      Modified duration is defined as:

      MDURATION = DURATION / (1 + yield / frequency)
      

      Remarks:

      • settlement, maturity, frequency, and basis are truncated to integers.
      • If settlement or maturity is not a valid date, an error is thrown.
      • If coupon < 0 or if yield < 0, an error is thrown.
      • If frequency is any number other than 1, 2, or 4, an error is thrown.
      • If basis < 0 or if basis > 4, an error is thrown.
      • If settlement >= maturity, an error is thrown.

      Parameters

      • options: ModifiedDurationOptions

        The modified duration calculation options.

      Returns number

      The modified Macauley duration.

      calculateModifiedDuration({
      settlement: new Date("2008-01-01"),
      maturity: new Date("2016-01-01"),
      coupon: 0.08,
      yield: 0.09,
      frequency: 2,
      basis: 1,
      }); // 5.73566981