Calculating MIRR (Modified Internal Rate of Return) Using Python And Numpy

MIRR - The Modified Internal Rate of Return assumes two discount rates while calculating the net present value of the cash flows of an investment. When the cash flow is negative MIRR applies the rate of financing and if the cash flow is positive MIRR applies the rate of reinvestment.

NumPy Updated 17 Apr 2020 1 min read

Overview

  • While the IRR - Internal Rate of Return for a set of cash flows assume the same discount rate for both positive and negative cash flows, the Modified Internal Rate of Return assumes different discount rates for them.
  • Since the external factors like inflation is not included in both IRR and MIRR calculation, in MIRR the discount rate for a positive cash flow (i.e., in flow) is typically less than the discount rate for a negative cash flow. Hence, MIRR is considered the more conservative and realistic when compared to IRR.
  • Both the techniques are applied and results are compared while assessing the return potential of an investment.

Example

python
# Example Python program that calculates the Modified

# Internal Rate of Return on a set of cashflows(sometimes positive and sometimes negative)

# resulting from an initial investment

import numpy as np

t0  = -500; # Negative as t0 is an outflow

t1  = 30;

t2  = 50;

t3  = -10;

t4  = 20;

t5  = -5;

# All the cash flows as a Python list

cashFlows = [t0, t1, t2, t3, t4, t5];

# Calculate the Modified Internal Rate of Return

mirr = round(np.mirr(cashFlows, 5, 6), 4);

print("Modified Internal Rate of Return:%3.4f"%mirr);

Output

Output
Modified Internal Rate of Return:1.8209