This repo contains a custom implementation of numpy.irr built from scratch. It is used to compute the internal rate of return, also called APR, which is useful in a wide range of financial circumstances.
What’s wrong with numpy.irr? It’s extremely slow and usually returns nan.
Installing
The easiest way to install is probably to run this:
There are two implementations available in this package. irr.irr defaults to irr.irr_binary_search which is slower but more stable. There is also irr.irr_newton which is much faster but sometimes doesn’t converge.
This repo contains a custom implementation of
numpy.irrbuilt from scratch. It is used to compute the internal rate of return, also called APR, which is useful in a wide range of financial circumstances.What’s wrong with
numpy.irr? It’s extremely slow and usually returnsnan.Installing
The easiest way to install is probably to run this:
More info
There are two implementations available in this package.
irr.irrdefaults toirr.irr_binary_searchwhich is slower but more stable. There is alsoirr.irr_newtonwhich is much faster but sometimes doesn’t converge.Binary Search
Newton’s method
Misc
This repo uses the MIT License