Python中的 numpy.mirr()
numpy.mirr(values, finance_rate, reinvest_rate) :此财务函数可帮助用户计算修改后的 IRR 值,即修改后的内部收益率,即。 “平均”周期性复合回报率
内部收益率等于 -
Parameters :
values : [array-like] Input cash flows per time period. net “deposits” are negative and net “withdrawals” are positive
finance_rate : Interest paid on cash amounts.
reinvest_rate : Interest received on cash amounts.
Return : Modified Internal Rate of Return for periodic input values ie. considering interest values.
代码:
Python3
# Python program explaining
# mirr() function
import numpy as np
'''
Question :
Investment = 500
Withdrawls at regular interval : 50, 31, 3, 11
'''
Solution = np.mirr([-500, 50, 31, 3, 11], .34, .21)
print("Solution - Modified Internal Rate of Return : ", Solution)
输出:
Solution - Modified Internal Rate of Return : -0.26165615714437973