Member-only story

From Theory to Practice: Building Robust Portfolios with Hierarchical Risk Parity in Python

The Python Lab
8 min readAug 28, 2023

--

Welcome to this tutorial on hierarchical risk parity (HRP), a portfolio optimization technique that considers correlations between asset classes. In this tutorial, we will explore the concept of hierarchical risk parity and learn how to implement this advanced method using Python and historical price data.

Cover Image
Photo by Joshua Aragon on Unsplash

Portfolio optimization is a crucial aspect of investment management. It involves selecting the optimal allocation of assets to maximize returns while minimizing risk. Traditional portfolio optimization techniques, such as mean-variance optimization, assume that asset returns are normally distributed and independent of each other. However, in reality, asset returns are often correlated and their distributions may not be normal.

Hierarchical risk parity (HRP) is a modern portfolio optimization technique that takes into account the hierarchical structure of asset classes and their correlations. It aims to create a well-diversified portfolio by allocating weights to asset classes based on their risk contributions.

In this tutorial, we will cover the following topics:

  1. Introduction to Hierarchical Risk Parity
  2. Building the HRP Algorithm
  3. Implementing HRP in Python

--

--

The Python Lab
The Python Lab

Written by The Python Lab

Discovering the power of algorithms in Python. Exploring ML, AI, and Deep Learning. Data-driven trading strategies.

Responses (1)