GithubHelp home page GithubHelp logo

open-source-modelling / open_source_economic_model Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 6.0 86.08 MB

First open-source asset-liability model.

Home Page: https://open-source.tools/

License: Mozilla Public License 2.0

Python 22.52% Jupyter Notebook 77.48%
actuarial modelling-tool python asset-liability insurance

open_source_economic_model's Introduction

๐Ÿ Open-Source Economic Model (OSEM) ๐Ÿ


Financial institutions such as life insurers or pension funds have a fiduciary duty to manage long-term commitments to their customers. They initially collect premiums/contributions from their clients, and in exchange promise to provide a guarantee or a higher return at a further date. A large part of risk management in such companies is focused on making sure that the invested assets are managed in such a way as to guarantee the honouring of all commitments (pensions, annuities, insurance claims etc.). One such tool is an asset-liability model. Such models try to simulate three things simultaneously:

  • Evolution and performance of company's investments
  • Evolution of liabilities
  • The impact on profitability by different trading strategies in response to outflows and inflows throughout time

Description

The aim of this project is to write a collection of models using technologies that are open-source and widely used (Pyhon and specific packages such as Pands, Numpy, Datetime etc.).

Ultimately, OSEM should be able to take as input:

  • Description and size of investments
  • Description of economic factors such as interest rates, credit spreads etc.
  • Description and size of outflows
  • Description of the factor influencing the size and timing of outflows
  • Description of planned new business that a company wishes to include into the projection

OSEM should be able to produce a projection of what would happen to the balance sheet of this company in 5, 10, 20, 50 years.

Methodology

The development of the OSEM model is still very much an ongoing project. However, a draft of the methodology document can be found in the Documentation folder as OSEM pdf or a OSEM Jupyter notebook.

Specific deep dives into topics related to the methodology are available as Jupyter notebooks or pdf-s. The topics covered so far are:

Getting started

So far, we have produced a simple example that can be ran using the script main.py. A hypothetical portfolio of 3 equities and 3 corporate bonds and a single fixed liability cash flow profile. This example will grow as more development is committed to the main branch. To run the example:

  • Download the OSEM repository
  • Open the Anaconda command prompt
  • Make the OSEM repository the root folder
  • Run the script main.py
  • In the folder Output, look at the cash flow time-series

A simple summary of what goes into the run and what are the outputs can be found in the Summary pdf

Using Copilots for development

If you use copilots to further develope the code, we have started assembling a modelingfile that can be used to refine the prompts. The file is located in the llm_modelfile folder.

Ask to the community

Send us an email at [email protected] with feedback, comments, ideas on what we could do better etc. Do you want to help us on this open source project? Check our wiki page also on GitHub Wiki

open_source_economic_model's People

Contributors

adrianpreston264 avatar gregorfabjan avatar open-source-modelling avatar

Stargazers

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

Watchers

 avatar  avatar

open_source_economic_model's Issues

Trading function

In the main script, trading is done using code that is written directly into the script. This could be incapsulated and put in a separate function/class for clarity and since this is on the roadmap of further development.

New ALM class

A lot of functions are written in the main script and called. They should go in a separate script where they can be maintained properly.

Generate synthetic equities for rebalancing

There might be types of equities that are not present in portfolios but would be bought in future times. To accommodate this, synthetic equities are created. Tasks include:

  • Generate input file for all combinations of equities, save in Intermediate
  • Read into a separate portfolio.
  • Add to cash flow matrix
  • Include in trading algorithm

New dataframe Units

Until now, market value is used for each equity. This is simple to manage, however it does not scale and it limits the options for further development.

The proposal is to create a ledger of "units" of each asset. So that the market value of each position is calculated as market value * units held.

This allows to bring a separation between the movement of price of an asset and the trading activities of a each portfolio.

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.