Is the numpy.irr function correct?

This question may have an obvious answer that I am just missing. I am looking through the source code for numpy.irr and getting a bit confused about how they are going about solving it. IRR is found by solving

0 = \sum^n_{i=0} \frac{a_i}{(1+irr)^i}

for irr. However, in the numpy code it solves the polynomial

\sum_{t=0}^M{v_t\cdot x^t} = 0

for x, then returns 1/x - 1 as the IRR. I might be mistaken, but these don't seem to be equivalent operations. They are close, but it seems that there would be situations in which the two numbers could be very different. Is there another library that has a more accurate IRR, or would I be better off creating my own function?

1 answer

  • answered 2019-01-11 05:28 user2357112

    I might be mistaken, but these don't seem to be equivalent operations.

    You're mistaken. Those are equivalent operations.