My First 'Optimal' Portfolio
Updated 17 May 2026
Key takeaways
- Our first portfolio optimization project turned modern portfolio theory into Python tools that interested practitioners could understand and modify.
- The historical comparison reduced volatility from about 14.4% to 5.6% without lowering returns, illustrating how portfolio allocation can reduce risk.
- Tests covering the 2018 bear market and 2019 bull market found lower average losses in severe scenarios and better returns for the risk taken.
My introduction to quantitative portfolio optimization happened during my undergraduate years, inspired by Attilio Meucci’s Risk and Asset Allocation and the convex optimization teachings of Diamond and Boyd at Stanford. With enthusiasm and perhaps more confidence than expertise, I created my first “optimal” portfolio. What struck me most was the disconnect between theory and accessibility. Modern Portfolio Theory had been established since 1990, yet the optimization tools remained largely locked behind proprietary software.
Nevertheless, only a few comprehensive software models are available publicly to use, study, or modify. We tackle this issue by engineering practical tools for asset allocation and implementing them in the Python programming language.
This gap led me to publish A Python integration of practical asset allocation based on modern portfolio theory and its advancements.
My approach centered on a simple philosophy:
The focus is to keep the tools simple enough for interested practitioners to understand the underlying theory yet provide adequate numerical solutions.
Today, projects like PyPortfolioOpt and Riskfolio-Lib offer open-source alternatives with far greater scope than my early efforts. Here are the results of my project:
First, I set out to visualize Modern Portfolio Theory’s fundamental principle—the risk-return tradeoff that drives optimization decisions. This scatter plot showing the efficient frontier demonstrates this core concept.
The results of my first optimization: maintaining a 9.386% return while reducing volatility from 14.445% to 5.574%, effectively tripling the Sharpe ratio from 0.650 to 1.684.
Varying the risk aversion parameter (gamma) produces different allocations for different investor risk preferences, as shown in the efficient frontier plot.
Out-of-sample testing across diverse market conditions—including the 2018 bear market and 2019 bull market—demonstrated consistent CVaR reduction and improved risk-adjusted returns.
We demonstrate how even in an environment with high correlation, achieving a competitive return with a lower expected shortfall and lower excess risk than the given benchmark over multiple periods is possible.
Looking back, the project feels embarrassingly naive—and surprisingly foundational. It earned some recognition at the time.