Function computeIrr

  • Computes the Internal Rate of Return (IRR) of the given cash flows. There may be multiple valid IRR results. NaN and infinite results are filtered out. Results less than -100% are also filtered out, since they are unreasonable as IRRs --- investment would turn negative in the next period after a period with a positive balance, and the negative balance would generate positive return in that period.

    Parameters

    • cashFlows: number[]

      The cash flow of each period.

    Returns number[]

    An array of IRRs.