Coder Social home page Coder Social logo

maween / pypme Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 1.0 9 KB

Assisting utility functions for calculation of Private Equity Public Market Equivalent (PME) measures using Python. Natively compatible with Preqin data format.

License: MIT License

Python 100.00%
python funds calculations private equity pme public market equivalent sse

pypme's Introduction

PyPME

Assisting utility functions for calculation of Private Equity PME measures using Python. Natively compatible with Preqin data format.

Example code:

for idx, fund in cf_funds.iterrows():
  fund_cf = cf_data[cf_data['Fund ID'] == fund['Fund ID']].copy()
  cf_funds.loc[idx,'local_KSPME'] = pypme.KS_PME(fund_cf["Transaction Date"],fund_cf["Transaction Amount"],fund_cf["Transaction Category"],local_index.iloc[:,0],local_index.iloc[:,1])
  cf_funds.loc[idx,'DirectAlpha'] = pypme.Direct_Alpha_PME(fund_cf["Transaction Date"],fund_cf["Transaction Amount"],fund_cf["Transaction Category"],local_index.iloc[:,0],local_index.iloc[:,1])
  cf_funds.loc[idx,'PME+'] = pypme.PME_PLUS(fund_cf["Transaction Date"],fund_cf["Transaction Amount"],fund_cf["Transaction Category"],local_index.iloc[:,0],local_index.iloc[:,1])                      

Where cf_data is the cashflow data imported from Preqin using pd.read_csv('preqin_cf_file.csv'), and local_index is a 2-column DataFrame in the format [Date|Index_Value].

The code above iterates over all unique funds in the file, and assigns the metric on a per-fund basis, using local_index as the basis for discount factor.

The library automatically finds the closest index dates for a given cash flow, and thus day-for-day index data is not required for the code to run properly (albeit, better resolution does obviously increase accuracy).

pypme's People

Contributors

maween avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

pramod-thaz

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.