@travishorn/financejs
    Preparing search index...

    Function calculateInternalRateOfReturn

    • Calculates the internal rate of return for a series of cash flows. The cash flows do not have to be even, as they would be for an annuity. However, the cash flows must occur at regular intervals, such as monthly or annually. The internal rate of return is the interest rate received for an investment consisting of payments (negative values) and income (positive values) that occur at regular periods.

      Remarks:

      • Uses an iterative technique for calculating the internal rate of return. Starting with guess, this function cycles through the calculation until the result is accurate within a small absolute threshold. If this function can't find a result that works after 100 tries, a RangeError is thrown.
      • This function is closely related to calculateNetPresentValue(), the net present value function. The rate of return calculated by this function is the interest rate corresponding to a 0 (zero) net present value.

      Parameters

      • options: InternalRateOfReturnOptions

        The internal rate of return calculation options.

      Returns number

      The internal rate of return.

      When inputs are invalid or the algorithm cannot converge.

      calculateInternalRateOfReturn({
      cashFlows: [-70000, 12000, 15000, 18000, 21000],
      }); // -0.021244848272975403
      calculateInternalRateOfReturn({
      cashFlows: [
      -59984, 5868, 9728, 7261, 2716, 1010, 8531, 3481, 8906, 7035, 1800,
      2436, 6143, 9844, 1200, 1528, 848,
      ],
      guess: 0.05,
      }); // 0.03905013260704959