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
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework