Code and Readme with more financial and technical details is located here
Recently, I've been feeling a lot of passion in the financial domain after reading a few interesting books. As a result, I started studying, learning technical terms and doing deep dives on financial news but as any good programmer will tell you, the best way to learn is by sinking your teeth into a problem and stumbling a few dozen times.
I decided to focus on Frontier and Emerging Markets because growing up in Cambodia, I frequently noticed a large dissonance between how media reported on both Cambodian politics and the economy compared to what was actually happening. Large, potentially groundbreaking events wouldn’t even become news. As a result, when following certain stocks such as NagaCorp Ltd, I wondered how much less efficient the market would be with far less information to work with and to what degree risk was accurately reflected.
Initially, I wanted to do a deep dive into how expected risk in these areas functions and how big the deviations were(or in more technical terms whether there are larger and more frequent divergences between ex-ante risk estimates and ex-post risk in developing countries) than lower-risk emerging markets compared to more developed countries but after some intensive research I noticed there were a lot of factors that made this research too ambitious for a first project where I lack deep domain knowledge.
Instead I decided to look at the hypothesis "There is no statistically significant difference in risk-adjusted returns between ETFs tracking high-risk and low-risk country indices."
One surprise that I had was how much I had to learn and research even to come up with a problem statement that was easy to examine. For instance, the reason I picked ETFs specifically was because if I didn't, I would have needed to manually group specific stocks and then I suddenly have problems such as survivorship bias or having to account for countries changing classification during my selected period.
The coding side of the project was honestly far easier than I expected. A great thing about using financial data is it was already perfectly cleaned. This meant it was a simple as creating a couple of Pandas dataframes, aligning them and then the data was ready to go!
My first surprise was the degree that the S&P500 outperformed both the Frontier Markets and the Emerging Markets: ~10% annually. This immediately made me wonder if there were any obvious uses for having these stocks in a diversified portfolio despite the underperformance so I started researching ways to dive deeper.
I found that while these markets don't move in perfect lockstep with the S&P (correlations of 0.70 and 0.61 suggest some independence), this diversification benefit largely disappears when it matters most. When the S&P drops, Frontier Markets actually tend to fall even harder despite their lower overall correlation. During the S&P's 10 worst months, both Emerging and Frontier Markets still experienced severe losses—about 85-91% as bad as the S&P itself. So while these markets offered some potential for diversification on paper, they failed to provide meaningful protection during actual downturns.
This means based on this analysis, I would keep all investments focused on established markets. However, doing this project I've learnt that things are rarely this simple and I'm excited to see where diving in on further nuance will eventually take me. This project also reminded me that often to really understand the pros and cons of different metrics and gain domain knowledge, it's sometimes best to have a problem and figure out the best ways to explore it.
I tried to keep too many financial terms out of this post to ensure readability for a wide array of audiences but if you're more interested on the financial side feel free to check my GitHub or send me a message!
I tried to keep too many financial terms out of this post to ensure readability for a wide array of audiences but if you're more interested on the financial side feel free to check my GitHub or send me a message!
Top comments (1)
Sent a message! Love the blog, can't wait to see where it goes