Python

Corr-correlation

We recently read two blog posts from Robot Wealth and FOSS Trading on calculating rolling pairwise correlations for the constituents of an S&P 500 sector index. Both posts were very interesting and offered informative ways to solve the problem using different packages in R: tidyverse or xts. We’ll use those posts as a launchpad to explore the rolling correlation concept with respect to forecasting returns. But we’ll be using Python to do a lot of the heavy lifting.

Writing conundrums

We’re taking a break from our portfolio series and million sample simulations to return to a subject that we haven’t discussed of late despite its featured spot in this blog’s name—options. In this post, we’ll look at the buy-write (BXM) and put-write (PUT) indices on the S&P 500, as conceived, calculated, and published by the CBOE. Note: we’ve discussed the buy-write strategy in the past here and here. In those posts, we analyzed the performance of the buy-write relative to its underlying index, the S&P 500.

Sequential satisficing

In our last post, we ran simulations on our 1,000 randomly generated return scenarios to compare the average and risk-adjusted return for satisfactory, naive, and mean-variance optimized (MVO) maximum return and maximum Sharpe ratio portfolios.1 We found that you can shoot for high returns or high risk-adjusted returns, but rarely both. Assuming no major change in the underlying average returns and risk, choosing the efficient high return or high risk-adjusted return portfolio generally leads to similar performance a majority of the time in out-of-sample simulations.

Satisficing and optimizing

In our last post, we explored mean-variance optimization (MVO) and finally reached the efficient frontier. In the process, we found that different return estimates yielded different frontiers both retrospectively and prospectively. We also introduced the concept of satsificing, originally developed by Herbert Simon. Simply put, satisficing is choosing the best available solution afforded by a messy reality, when an optimal solution requires hard to know (or unknowable) information. Alternatively, an optimal solution might be easy to find, but requires conditions so abstracted from normal phenomena as to be devoid of reality.

I like to MVO it!

In our last post, we ran through a bunch of weighting scenarios using our returns simulation. This resulted in three million portfolios comprised in part, or total, of four assets: stocks, bonds, gold, and real estate. These simulations relaxed the allocation constraints to allow us to exclude assets, yielding a wider range of return and risk results, while lowering the likelihood of achieving our risk and return targets. We bucketed the portfolios to simplify the analysis around the risk-return trade off.

Weighting on a friend

Our last few posts on portfolio construction have simulated various weighting schemes to create a range of possible portfolios. We’ve then chosen portfolios whose average weights yield the type of risk and return we’d like to achieve. However, we’ve noted there is more to portfolio construction than simulating portfolio weights. We also need to simulate return outcomes given that our use of historical averages to set return expectations is likely to be biased.

Testing expectations

In our last post, we analyzed the performance of our portfolio, built using the historical average method to set return expectations. We calculated return and risk contributions and examined changes in allocation weights due to asset performance. We briefly considered whether such changes warranted rebalancing and what impact rebalancing might have on longer term portfolio returns given the drag from taxes. At the end, we asked what performance expectations we should have had to analyze results in the first place.