Anexen / pyxirr

Rust-powered collection of financial functions.
https://anexen.github.io/pyxirr/
The Unlicense
172 stars 16 forks source link

Interest in adding private equity metrics? #42

Closed msquaredds closed 11 months ago

msquaredds commented 1 year ago

Having other PE metrics in the same package would be useful for my project (and I'm guessing others?)

I'm thinking of adding DPI, MOIC and Modified IRR as basic metrics and then adding public market equivalent (PME) metrics too (the same metrics but rescaling the PME "cash flows" based on standard methods such as Kaplan Schoar)

For all of these, other than Modified IRR, there would need to be a wrapper on the input data to either separate out positive (distributions) and negative (contributions) cash flows or the two series could be input separately. For Modified IRR, it would just require discount rate and investment rate inputs. For the PMEs the user would need to supply either price or return series for the PME

Also, I'm willing to mock something up that works in python if there is any interest, I just don't have any experience with Rust, so would need help converting it. I already have something in my project, but would need to separate it out to make it clearer

Anexen commented 1 year ago

Hi, @msquaredds I don't mind adding these metrics to the library. It would be great if you could point to a reference implementation in any language or description with formulas so that I can write the correct tests.

P.S. pyxirr already has an implementation of Modified IRR

msquaredds commented 1 year ago

Nice, I missed the Modified IRR, thanks for pointing that out

I've attached a .py file (zipped since github doesn't allow .py directly) with the metrics and methods for re-scaling cash flows to make them comparable to PMEs. This was done quickly so please let me know if anything doesn't work or you have any questions, I don't mind being more robust about it

pyxirr_pe_functions.zip

Anexen commented 1 year ago

@msquaredds, it is very cool, thank you for the code with annotations and comments. I don't know how to implement the sympy code yet, but I'll try to come up with something. At the very least, sympy will be an optional dependency for pyxirr.

Anexen commented 11 months ago

Hi, @msquaredds, Private equity metrics has been added in v0.10.0.