Coder Social home page Coder Social logo

e2e-dro's Introduction

Distributionally Robust End-to-End Portfolio Construction

This repository contains the source code to reproduce the numerical results in our paper Distributionally Robust End-to-End Portfolio Construction. Our paper introduces a robust end-to-end (E2E) learning system where the final decision layer is based on a distributionally robust (DR) optimization model for portfolio construction. This repository was created by Giorgio Costa and Garud Iyengar, and belongs to Iyengar Lab in the IEOR Department at Columbia University.

Introduction

We propose an end-to-end distributionally robust system for portfolio construction that integrates the asset return prediction model with a distributionally robust portfolio optimization model. We also show how to learn the risk-tolerance parameter and the degree of robustness directly from data. End-to-end systems have an advantage in that information can be communicated between the prediction and decision layers during training, allowing the parameters to be trained for the final task rather than solely for predictive performance. However, existing end-to-end systems are not able to quantify and correct for the impact of model risk on the decision layer. Our proposed distributionally robust end-to-end portfolio selection system explicitly accounts for the impact of model risk. The decision layer chooses portfolios by solving a minimax problem where the distribution of the asset returns is assumed to belong to an ambiguity set centered around a nominal distribution. Using convex duality, we recast the minimax problem in a form that allows for efficient training of the end-to-end system.

A copy of our paper is available in arXiv: https://arxiv.org/abs/2206.05134

Dependencies

  • Python 3.x/numpy/scipy/pandas/matplotlib
  • cvxpy 1.x
  • cvxpylayers 0.1.x
  • PyTorch 1.x
  • pandas_datareader/alpha_vantage

Usage

This repository contains all the files and data used to generate the experimental results in our paper. To reproduce the experimental results, please refer to the main.py file.

Anyone wishing to design their own robust portfolios should refer to the e2edro module. The e2edro module contains the following files:

  • e2edro.py: Allows one to construct DR E2E objects.
  • RiskFunctions.py: Includes two alternative deviation risk functions that can be called by e2edro objects. These are the portfolio variance and portfolio mean absolute deviation.
  • LossFunctions.py: Includes three alternative loss functions for end-to-end learning. These are the portfolio return, the portfolio Sharpe ratio, and the portfolio single-period return over the portfolio multi-period standard deviation.
  • PortfolioClasses.py: Includes multiple objects used to store experimental data and results, as well as portfolio backtest results.
  • BaseModels.py: Allows one to construct naive models without end-to-end learning. These are used as competing models in the numerical experiments.
  • DataLoad.py: Provides code to download factor data from Kenneth French's data library (https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html) and asset data from AlphaVantage (www.alphavantage.co). It also includes functtions to generate synthetic data.

Licensing

Unless otherwise stated, the source code is copyright of Columbia University and licensed under the Apache 2.0 License.

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.