Giter Site home page Giter Site logo

romanloop / portfolio-optimization-with-physics-inspired-graph-neural-networks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amazon-science/co-with-gnns-example

0.0 0.0 1.0 80.93 MB

License: Other

Python 0.09% HTML 7.61% Jupyter Notebook 92.29% JavaScript 0.02%

portfolio-optimization-with-physics-inspired-graph-neural-networks's Introduction

Portfolio Optimization with Physics-Inspired Graph Neural Networks

A Master's Thesis Specialization Project

The main objective of this specialization project is to apply the approach of Schuetz et al. to the S&P 500 assets, constructing a portfolio of uncorrelated assets and comparing its volatility and performance with benchmarks.

Introduction

A well-known optimization problem in finance is the risk diversification of a portfolio. The objective is to construct a portfolio from a subset of ๐‘› assets selected from a large universe of ๐‘ assets, aiming to exhibit the lowest possible risk. These minimum risk portfolios are particularly valuable to relatively risk-averse investors. In practice, the universe of assets can be very large.

The ๐‘ assets in the universe can be modeled as a graph, where the assets are represented by vertices, and their relationships are derived from the correlations between them. These correlations are pivotal in finding minimum risk portfolios, as they determine the overall portfolio risk. Ideally, the minimum risk portfolio would consist of uncorrelated assets.

When constructing low-risk portfolios, one may aim to find the largest possible set of uncorrelated assets. Computationally, this poses a major challenge as the set of possible solution candidates grows exponentially with the number of nodes. This makes a brute force approach infeasible for large sets. While there are approximation algorithms, none of them scale effectively to graphs with thousands or even hundreds of thousands of nodes.

Schuetz et al. developed a self-supervised deep learning approach to approximate the MIS on large graphs. Their graph neural network-based approach claims to be very fast and accurately. The promising solution runtime of $~n^{1.7}$ scales very well compared to the solution runtime of the Boppana-Halldorsson algorithm โ€“ a state of the art algorithm for the MIS problem โ€“ with a solution runtime of $~n^{2.9}$ The main goal of this project is to apply the approach of Schuetz et al. the S&P500 assets. Building a portfolio of uncorrelated assets and compare its performance with benchmarks.

Documentation

A detailed documentation of the project and all results can be found in docs/TechnicalReport_VP2_GNN-MIS_RomanLoop_V2.pdf The original paper "Combinatorial Optimization with Physics-Inspired Graph Neural Networks" from Schuetz et al. can be found on arXiv. The code of the authors is available on Github.

The main code (end-to-end process) can be found in the backtest.ipynb notebook. All code regarding hyperparameter optimization is contained in hyperparameter_optimization_my.ipynb and hyperparameter_optimization_raytune.ipynb. Helper functions and reusable code can be found in utils pyhton files.

Python setup

Please note I have provided a requirements.txt file, which defines the environment required to run this code. The code has been run with Python 3.9. and is not tested with any other Python version. Thus, I suggest to create a virtual environment with Python 3.9: python -m venv .venv

portfolio-optimization-with-physics-inspired-graph-neural-networks's People

Contributors

romanloop avatar jbrubaker avatar peitsche avatar amazon-auto avatar

Forkers

deepquant1601

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.