Skip to content

elarchet/ConnectednessPortfolio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Connectedness Portfolio

This project analyzes the connectedness of commodity markets and performs portfolio optimization using both covariance and DYIC (Dynamic Connectedness Index) matrices.

Usefull links

Features

  • Fetches and cleans historical commodity data from Yahoo Finance using yfinance
  • Computes rolling-window connectedness measures (DYIC) using VAR models
  • Visualizes connectedness and portfolio performance
  • Portfolio optimization using [PyPortfolioOpt] with both covariance and DYIC matrices
  • Compares optimized portfolios with an equally weighted benchmark

Project Structure

  • code.ipynb: Main Jupyter notebook containing all code, analysis, and visualizations
  • pyproject.toml: Project dependencies and configuration (uses Poetry)
  • poetry.lock: Locked dependency versions

Requirements

Getting Started

  1. Install dependencies
    Using Poetry:

    poetry install

    Using pip:

    pip install -r requirements.txt
  2. Run the notebook
    Open code.ipynb in VS Code or JupyterLab and run all cells.

Main Packages Used

  • numpy, pandas: Data manipulation
  • yfinance: Downloading financial data
  • matplotlib, seaborn: Visualization
  • statsmodels: VAR modeling and connectedness analysis
  • pyportfolioopt: Portfolio optimization

Author

Etienne Larchet
MIT License


About

Portfolio optimization on commodities using connectedness theories

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors