Coder Social home page Coder Social logo

java-irr's Introduction

java-irr

java版的IRR和XIRR,实现内部收益率的计算

XIRR与IRR都是可以反映一组现金流的内部收益率的,但两者还是有一些区别:

1、适用范围不同: XIRR适用间隔相等现金流内部收益率计算,这个现金流不一定定期发生。XIRR法适用于不定期的投入方式。因为这种方法把每期投入的现金流动首先按投入日期与第一期的日期天数差,折算到”等时间间隔为1天“,然后再进一步折算到”年化收益率“。所以,XIRR法计算出的直接就是年化收益率了

IRR适用间隔相等或不相等的现金流内部收益率计算,现金流必须定期出现。IRR法仅仅适用于”定期“投入的方式,时间间隔如果不平均,就会产生错误,IRR得到的是期内部收益率,这里的期可以指年,半年,季,月,周,日

2、计算参数不同:XIRR数值是必须的,日期也是必须的。IRR可以输入预估值,日期可以不输入。

3、准确性不同:XIRR将日期计算在内,准确性会高一些。

参考

IRR MIRR XIRR的区别

更新

引入牛顿算法并简单封装 https://github.com/RayDeCampo/java-xirr

加入gurss 、猜测值

测试数据全部来源于Microsoft官方

Office IRR

Office XIRR

java-irr's People

Contributors

rockychen1221 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.