Coder Social home page Coder Social logo

rs-portfolio-opt's Introduction

Portfolio Optimization under a Markov Regime-Switching Framework

This repository contains the source code to conduct numerical experiments similar to those presented in the following two papers:

The work in these two papers pertains to a Markov regime-switching factor model that captures the cyclical nature of asset returns in modern financial markets. Maintaining a factor model structure allows us to easily derive the first two moments of the asset return distribution: the expected returns and covariance matrix. By design, these two parameters are calibrated under the assumption of having distinct market regimes. In turn, these regime-dependent parameters serve as the inputs during portfolio optimization, thereby constructing portfolios adapted to the current market environment. The proposed framework leads to a computationally tractable portfolio optimization problem, meaning we can construct large, realistic portfolios.

Dependencies

  • Julia v1.x
  • JuMP.jl v1.x
  • Ipopt.jl v1.x
  • TimeSeries.jl v0.23

Usage

This repository contains all the files used to necessary to run the numerical experiments of the regime-switching portfolio optimization framework. To run the experiments. please refer to the main.jl file. Anyone wishing to make any changes to the models can do so by tinkering with a copy of the code base. The code base is made up of the following files:

  • dataload/DataLoad.jl: Module to download data from Kenneth French's data library. Use this module to download returns of the Fama-French three-factor model, as well as the Industry Portfolios to serve as the historical asset returns.
  • optimization/PortfolioOptimization.jl: Module to construct optimal nominal and regime-switching portfolios. Six portfolio optimization models are currently available for use:
    • mvo: Nominal mean-variance optimization
    • rsmvo: Regime-switching mean variance optimization
    • minvar: Nominal minimum variance optimization
    • rsminvar: Regime-switching minimum variance optimization
    • rp: Risk parity portfolio optimization
    • rsrp: Regime-switching risk parity portfolio optimization.
  • optimization/Optimization.jl: Supporting script called by the PortfolioOptimization.jl module. This script contains the JuMP-based optimization models.
  • optimization/HiddenMarkovModel.jl: Supporting script called by the PortfolioOptimization.jl module. This script contains an implementation of the Baum-Welch algorithm to fit a hidden Markov model to the factor returns.
  • optimization/FactorModels.jl: Supporting script called by the PortfolioOptimization.jl module. This script contains an implementation of linear regression under a single regime, as well as under the assumption of multiple regimes.

Licensing

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

rs-portfolio-opt's People

Contributors

gcosta151 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.