python为什么叫爬虫,python 内部收益率_python – IRR实现中使用的数值方法是什么?

 2023-09-23 阅读 29 评论 0

摘要:ActiveState Recipes站点具有在Python中实现Internal Rate of Return的功能:def irr(cashflows, iterations=100):"""The IRR or Internal Rate of Return is the annualized effectivecompounded return rate which can be earned on the investedpyt

ActiveState Recipes站点具有在Python中实现

Internal Rate of Return的功能:

def irr(cashflows, iterations=100):

"""The IRR or Internal Rate of Return is the annualized effective

compounded return rate which can be earned on the invested

python为什么叫爬虫。capital, i.e., the yield on the investment.

>>> irr([-100.0, 60.0, 60.0, 60.0])

0.36309653947517645

"""

rate = 1.0

investment = cashflows[0]

python计算存款收益代码?for i in range(1, iterations+1):

rate *= (1 - npv(rate, cashflows) / investment)

return rate

此代码返回正确的值(至少对于我已针对Excel检查的几个示例),但我想知道原因.

>它似乎不是牛顿方法(无衍生物)或正​​割方法(仅跟踪一次迭代)的实现.

>特别是,投资变量作为第一个现金流元素(以及随后的使用)的定义让我感到困惑.

python输入,有任何想法吗?

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/1/88648.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息