w3resource

NumPy Financial functions: mirr() function

numpy.mirr() function

The mirr() function is used to modify internal rate of return.

Syntax:

numpy.mirr(values, finance_rate, reinvest_rate)

Version: 1.15.0

Parameter:

Name Description Required /
Optional
values Cash flows (must contain at least one positive and one negative value) or nan is returned.
The first value is considered a sunk cost at time zero.
array_like
Required
finance_rate Interest rate paid on the cash flows
scalar
Required
reinvest_rate Interest rate received on the cash flows upon reinvestment
scalar
Required

Returns: out : float

Modified internal rate of return

NumPy.mirr() method Example:

If you investment $1000 and withdrawals at regular interval $100, $50, $10 and $15. Here finance_rate .34 and reinvest_rate .21, Then the calculate modified internal rate of return (mirr)?

>>> import numpy as np
>>> np.mirr([-1000, 100, 50, 10, 15], .34, .21)

Output:

-0.2742274708267268

Python - NumPy Code Editor:

Previous: irr() function
Next: nper() function



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/numpy/financial-functions/mirr.php