Members:
- Francesco Leopardi
- Lefteris Nazos
- Evi Prousanidou
- Oriol Ripalta I Maso
- Santiago Diaz Tolivia
Why not simply use MPT (Modern Portfolio Theory)? The MPT portfolio optimization model fails to perform well in real settings due to:
- It involves the estimation of returns for a given set of assets. In real life, estimating returns is very difficult, and small errors in estimation can lead to sub-optimal performance.
- Mean-variance optimization methods involve the inversion of a covariance matrix for a set of assets. This matrix inversion makes the algorithm susceptible to market volatility and can heavily change the results for small changes in the correlations.
The HRP model solves some of these problems.
We will be using data from Polygon and/or Yahoo Finance through their proprietary APIs
100 assets will be chosen arbitrarily from the S&P500 based on data availability. Large cap firms will be prioritized
The HRP portfolio optimization model can be divided into three parts:
-
Hierarchical Clustering
which breaks down assets into hierarchical clusters- This is done by calculating the eucledian distance between the asset's returns. This is done by calculating the covariance matrix among the returns of all the assets and applying the eucledian distance formula
- Then we use a linkage method to cluster the firms that are closely correlated
- We clustered all our assets into a hierarchical tree based on similarity defined through our chosen distance measure (eucledian distance)
-
Quasi-Diagonalization
which reorganizes the covariance matrix by placing similar assets together- In this step we rearrange columns and rows of the covariance matrix to be able to have highly covaried assets on the diagonal and dissimilar assets further apart.
-
Recursive Bisection
where weights are assigned to each asset in our portfolio- The recursive bisection method will break every cluster in the quasi-diagonalized matrix into smaller sub-clusters. We start with the largest cluster, and use the assumption that the inverse-variance allocation of the matrix is the most optimal allocation for the portfolio
pip install -r requirements.txt
- A backtesting infrastructure for comparing and evaluating different porfolio optimization strategies against benchmarks.
- Backcasting requires -> agents that will participate in the simulation. In order for agents to participate in the simulation they need a prediction(Weight-Allocation) model, which is responsible for predicting the necessary values/weights.
- The current implementation doesn't save the weights after the simulation is over. It outputs the simulation results against the benchmarks we want to show.
- You can add benchmarks in the runner.py as follows: benchmarks = [b.PNL('P'),b.Sharpe('P')] denoting, the metric and its frequency.
- You can add Agents, that inherit a model, and backtest them with the Backtester Class.
- See and run runner.py
Explain different methodologies for clustering!