This is the “average” periodically compounded rate of return
that gives a net present value of 0.0; for a more complete explanation,
see Notes below.

Parameters:

values : array_like, shape(N,)

Input cash flows per time period. By convention, net “deposits”
are negative and net “withdrawals” are positive. Thus, for
example, at least the first element of values, which represents
the initial investment, will typically be negative.

Returns:

out : float

Internal Rate of Return for periodic input values.

Notes

The IRR is perhaps best understood through an example (illustrated
using np.irr in the Examples section below). Suppose one invests 100
units and then makes the following withdrawals at regular (fixed)
intervals: 39, 59, 55, 20. Assuming the ending value is 0, one’s 100
unit investment yields 173 units; however, due to the combination of
compounding and the periodic withdrawals, the “average” rate of return
is neither simply 0.73/4 nor (1.73)^0.25-1. Rather, it is the solution
(for ) of the equation: