A quick guide on presenting the outcome of a 1000 simulations
A while ago, I was running some Monte Carlo simulations on portfolio allocations and trying to figure out how to make the graphs look better. Now, I’m not some graph expert of visualization master but I did figure out ways to make it look better and this will just be a short article to share that with you!
As mentioned, I ran a number of Monte Carlo simulations in order to figure out what my portfolio could look like in 30 years. If you’re interested, this is a snippet of the code (but the full code can be found on my github). I essentially had three different funds that I simulated over the next 30 years (using their mean and standard deviation). I weighted these funds differently and then ran 1000 simulations on them.

As you can see from the initial plot, it was not useful in the slightest. All 1000 outcomes had been plotted in full colour and there was really no useful information that could be gleaned from this. I could tell the rough range of outcomes but other than that, it wasn’t really particularly useful.
I decided that the most important portfolios to visualize would be (a) the 75th Percentile, (b) the Median, (c) the 25th Percentile, and (d) the base portfolio (i.e. pure savings without investing in the market)
In order to get the position of the 25th, 50th, and 75th Percentile portfolios, I combined the quantile and index function, converting them to strings so that I could use their column names later when plotting
When drawing the plot, I set all the plots to color grey. This would make them fade into the background and would allow me to highlight important portfolio outcomes (as per the aforementioned important ones)

Obviously nothing to write home about but now at least we have an empty canvas to work on!
The list of quantiles
were all strings. This allowed me to easily call the particular portfolio with .loc
and refer to the exact portfolio. I also created a list of colors to use as well as labels. I also added a legend to show the labels. With that, this was the final product!

Compared with the initial plot, the final result looked so much better. It gave the same background information (the rough range of possible outcomes) but also highlighted the important portfolios. What could perhaps have been even better would have been to remove the outlier outcomes. However, for the purposes of my study, I wanted to show the full range of outcomes and hence left it in there.
Data Visualization is such an important part of the data story. While we can have the coolest results and findings, a good graph that sends a clear message is also vital especially in today’s graphic-intensive culture.
Originally published at zachlim98.github.io/me.