Performing quantitative analysis (using Python/Pandas) on different Investment Management firm portfolios, algorithmic portfolios and portfolios based on the S&P 500 to determine which is performing the best across areas such as returns, Sharpe ratios (risk-to-reward), and other volatility metrics. Data based on a 4-year timeframe from 2015-2019. Investment Management Firm portfolios analyzed include Soros Fund Management LLC, Paulson & Co. Inc., Tiger Global Management LLC and Berkshire Hathaway LLC. These metrics are then visualized using matplotlib.
While the Investment Management Firm dataset and the Algorithmic dataset already had "daily returns" data before being loading into the notebook, the S&P 500 dataset had only "returns" as the data. Therefore, it was necessary to convert this to "daily returns" by using the ".pct_change()" function:
# Calculate S&P 500 daily returns using .pct_change() function:
sp500_daily_returns = sp500_history_df.pct_change()
# Rename column:
sp500_daily_returns.columns = ["S&P 500 Daily Returns"]
# Drop nulls:
sp500_daily_returns.dropna(inplace=True)
After loading in the separate dataframes and cleaning the data, I concatenated them into one dataframe to make working with the numbers easier:
Based on the above graph, on a day-to-day basis, the S&P 500 at-large is less volatile than any of the individual portfolios, which makes sense. Tiger Global Management is the most volatile portfolio, with swings much larger than any other; it may significantly outperform the S&P 500 at times, but at other times, it significantly underperforms the S&P 500. Berkshire Hathaway also appears to display some volatility, at times outperforming the S&P 500, but not to the extent of Tiger Global.
Based on the above graph, during this 4-year stretch from 2015-2019, Algorithm 1 performed the best and led to the most cumulative returns: it started to separate itself in early 2019. This is followed by Berkshire Hathaway, and in third, the S&P 500. Paulson & Co. Inc. had the worst cumulative returns over the 4-year period; in fact, Paulson and Tiger Global Management were the only portfolios to finish in the red.
The largest spread in the above box plot is for the portfolio of Berkshire Hathaway Inc. The smallest spread in the above box plot is for the portfolio of Paulson & Co. Inc. It should be noted that although Tiger Global Management does not have the largest spread, it does have the greatest outliers.
Before moving forward, it was necessary to calculcate each portfolios' Standard Deviation using the ".std()" function, along with the annualized Standard Deviation:
# Calculate the standard deviation for each portfolio:
daily_std_df = pd.DataFrame(daily_returns_df.std()).rename(columns = {0:"Standard Deviation"})
# Calculate the annualized standard deviation (252 trading days):
annualized_std_df = daily_std_df * np.sqrt(252)