I have just become aware of a very interesting theory for portfolio management which is grounded in mathematics, called Universal Portfolios. I am focused on the paper of the same name, here's a link.
I am working on understanding the math better, but I am getting a bit hung up on the examples. In the Examples section of the paper, there is a simple illustration of the usefulness of the algorithm using 2 stocks:
I am working on re-creating the examples with recent data from the stock market, released by kaggle. I am not interested yet in creating the universal portfolio yet. I am interesting in making sure i understand the idea about the "best constant balanced portfolio". This is an important piece of the paper.
Cover is stating that for the 2 stocks listed there, he was able to create constant rebalanced portfolios for list of values, b, which is the weight of one stock, and b-1, the weight of the other. He is stating that the performance of many of these constant rebalanced portfolios is better than that of either of the 2 stocks alone.
I was hoping to be able to pick 2 stocks from the data set and show a similar thing. However for the stocks that I have picked, there seems to be negligible improvement for any of the constant rebalanced portfolios. I am pretty sure I have the calculation correct.
I made some quick plots of several pairs of stocks. I've plotted the return of each stock, and then the constant rebalanced portfolios for a few choices for b ( 0.1, 0.3, 0.5, 0.7, 0.9 ). Most of the time the constant rebalanced portfolios cannot beat the performance of the best performing stock out of the 2, and when they do beat both stocks, it only seems to beat the best stock by a very slight amount. A far cry from the performance improvements that Cover mentions in the paper.
The dates here are 2001 - 2016, daily prices. Here is AAPL and MSFT, as you can see holding AAPL alone in the portfolio beats and constant rebalanced portfolio.
Here is a pair where a couple of the constant rebalanced portfolios perform the best, but it is just a very slight improvement.
From reading the paper I was expecting to see a massive improvement in performance for these simple examples but I'm not seeing anything interesting really. I was wondering if someone had some insight, maybe I did something wrong in my calculation, or maybe this is to be expected. I am also including my python code for the examples.
#!/usr/bin/python3
import pandas as pd
from sqlalchemy import create_engine
from datetime import date, timedelta, datetime
import numpy as np
from scipy.optimize import minimize, fmin
from matplotlib import pyplot as plt
engine = create_engine('postgres://localhost/kaggle')
'''
Universal portfolios
Cover
'''
stock1 = "WFC"
stock2 = "KO"
data = pd.read_sql("""select * from historical_stock_prices where date >= '2001-01-01' and date <= '2012-01-01' and ticker in ('%s','%s');""" % (stock1, stock2), engine )
x = pd.DataFrame({
stock1: data[ data['ticker'] == stock1 ]['adj_close'].tolist(),
stock2: data[ data['ticker'] == stock2 ]['adj_close'].tolist()
}, index=data[ data['ticker'] == stock2 ]['date'].tolist() )
x = np.log( x ).diff().dropna()
for i in range(1,11, 2):
p = i/10.0
print( p )
plt.plot( np.cumprod( np.dot( np.exp( x.values ), [p,1-p] ) ), label=str(p) )
plt.plot( np.cumprod( np.exp( x[stock1].values ) ), label=stock1 )
plt.plot( np.cumprod( np.exp( x[stock2].values ) ), label=stock2 )
plt.legend()
plt.show()



