Giter Club home page Giter Club logo

Comments (2)

harzkr avatar harzkr commented on May 20, 2024 1

Hi @jadfls

Nice find on the guess value part that you mentioned, but yeah it does pose the difficulty of correctly assuming an initial close value.

I have kept the usage of this package limited to any fallback calls(if others fail), and have shifted my primary package to
webcarrot/xirr, which is based on the XIRR function call from the LibreOffice Software

Since it is closely associated with the MS Office Excel etc., softwares, it correctly calculates values for 99.9% of the use cases, for others, there's usually a problem with improper set of transactions, else, I use fallback calls to this and other XIRR packages to get a value. But mostly those are very corner cases

from finance.js.

jadfls avatar jadfls commented on May 20, 2024

I can confirm this issue. Sample code:

const Finance = require('financejs');
var finance = new Finance();
var start = new Date(Date.parse("2013-12-31"));
var end = new Date(Date.parse("2014-05-15"));
var irr = finance.XIRR([-37987348, 21191041], [start, end], 0);
console.log(irr);    //will not calculate

However, if you (somehow) correctly guess the initial guess close to the result, it will work.

var irr = finance.XIRR([-37987348, 21191041], [start, end], -0.8);
console.log(irr);    //-79.36

@harzkr did you find a solution to your problem?

from finance.js.

Related Issues (20)

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.