Multi-Objective Evolutionary Portfolio Optimization-A Practical Guide with Kenyan Equities Data
Introduction
Portfolio optimization has come a long way since Harry Markowitz introduced his groundbreaking mean-variance model in 1952.His model gave investors something powerful: a way to mathematically balance return and risk.
For decades, this framework shaped how portfolios were constructed across global markets.But it came with an important assumption that risk could be fully described by variance alone.
In reality, investors experience risk differently. Losses hurt more than volatility statistics suggest. Extreme events happen more often than theory predicts. And in emerging markets like those traded on the Nairobi Securities Exchange, these effects are even more pronounced.
This realization led me down a path of research: could we construct portfolios that balance not just return and variance, but multiple competing objectives simultaneously?
This write-up documents some part of that exploration and what happens when evolutionary algorithms are used to design portfolios using Kenyan equity market data.
The Evolution of Portfolio Theory
From Variance to Reality
Markowitz’s insight was revolutionary: diversification reduces risk.But markets evolved. Researchers began to recognize that variance does not distinguish between upside and downside volatility. Investors or even majority of the homo sapiens do not fear gains they fear losses.
This led to new risk measures, including the listed below which will be our focus:
- Conditional Value-at-Risk (CVaR), which focuses on extreme losses
- Risk-adjusted performance metrics like the Sharpe ratio
- Multi-objective optimization frameworks that balance competing goals
These developments shifted portfolio design from a single-objective problem into a multi-objective one.
Instead of asking:
“What portfolio minimizes variance?”
We now ask:
“What portfolio best balances return, stability, and protection against extreme losses?”
but again take note this would vary depending on the investors\individuals risk averseness.
Why Multi-Objective Optimization Matters
Portfolio construction is inherently a balancing act.
Improving return often increases risk.
Reducing risk often sacrifices return.
Protecting against extreme losses introduces additional constraints.
Instead of optimizing for one objective, multi-objective optimization allows us to consider several simultaneously:
- Maximize expected return
- Maximize risk-adjusted return (Sharpe ratio)
- Minimize variance
- Minimize extreme loss risk (CVaR)
This produces portfolios that are balanced not extreme.
Mathematical Formulation
Let’s formalize our portfolio selection problem. We define the portfolio weight vector as:
\[w = (w_1, ..., w_n), \\ where\space w_i ≥ 0 \\ and\space Σw_i =1\]Each portfolio produces measurable outcomes:
Maximize:
- Expected Return: $R_{(w)} = w^Tμ$
- Sharpe Ratio: $R_2(w) = (w^μ)/\sqrt(w^T \sum{w})$
Minimize:
- Variance: $R_3(w) = w^T \sum{w}$
$CVaR_{\alpha}(w) = E[L L \geq VaR_{\alpha}$, where L is portfolio loss
These objectives naturally conflict, improving one often worsens another. This creates the Pareto frontier a surface of optimal trade-offs.
The Knee Solution Concept
When dealing with many Pareto-optimal solutions, we need a way to identify portfolios that offer the best trade-offs. This is where knee points come in - a portfolio where improving one objective would require sacrificing significantly more in another.
Mathematically, this is the portfolio closest to the ideal point across all objectives.
We identify knee solutions by minimizing the distance to the ideal point after normalizing objectives:
\[i* = arg min ||F̃_i||₂\]This yields a portfolio that balances return maximization against risk minimization in a preference-free manner.
Implementation: Learning From the Market First
Before optimizing, we first asked a simple question, What is realistically achievable in the Kenyan market? Instead of assuming targets, we explored the feasible space.
Stage 1: Feasibility Exploration
We simulated thousands of random portfolios using Kenyan banking and commercial sector equities.
For each simulation
1
2
3
4
5
6
7
8
9
for i in n
Select random portfolio of 5 securites
Compute:
return
variance
Sharpe ratio
CVaR
Store results
END
This analysis gives us realistic targets - we use the 75th percentile for return and Sharpe objectives, and the 25th percentile for risk measures again we are balancing here not getting the extremes as they might be black swans.
This gave realistic boundaries.
Observed ranges:
| Metric | Range |
|---|---|
| Daily Return | -0.0574% to 0.0162% |
| Sharpe Ratio | -0.0586 to 0.0071 |
| Variance | 0.00326% to 0.0257% |
| CVaR | 1.46% to 3.44% |
Stage 2: Evolutionary Search
Instead of solving directly, we used a genetic algorithm.This algorithm mimics natural selection.We formulated our problem as weighted goal programming, where we minimize deviations from targets:
1
2
3
4
5
6
7
8
Initialize random portfolios with equal weights
WHILE not converged:
Evaluate portfolios across objectives
Select best-performing portfolios
Generate new portfolios via mutation and crossover
END
Return best portfolio
The genetic algorithm searches for the optimal combination by ensuring weak portfolios disappear.Strong portfolios survive over generations and ultimately balance emerges.
The Optimal Selection of securites
The genetic algorithm converged to a 5-security portfolio consisting of:
- CFC Stanbic Holdings Ltd
- Co-operative Bank of Kenya Ltd
- Equity Bank Ltd
- Kenya Airways Ltd
- Standard Chartered Bank Ltd
Remarkably, this portfolio achieved all target objectives, demonstrating the effectiveness of the goal programming approach.
Multi-Objective vs. Classical Approaches
We compared our MOOP results with classical mean-variance optimization:
| Portfolio | Return (ann%) | Variance (ann%) | CVaR (%) | Sharpe (%) |
|---|---|---|---|---|
| MOOP | 0.474749 | 13.693256 | 2.036745 | -0.7017 |
| Min Variance | 0.381198 | 15.017555 | 2.074948 | -0.6790 |
| Max Sharpe | 3.253843 | 24.276668 | 3.588984 | 0.3254 |
The MOOP portfolio achieved a balanced profile - lower variance and CVaR than the maximum Sharpe portfolio while maintaining positive return.
Visualizing the Pareto Frontier
The Pareto frontier visualizations reveal important trade-offs:
- Return vs. Variance: Shows the traditional efficient frontier
- Return vs. CVaR: Highlights downside risk trade-offs
- Sharpe vs. Volatility: Risk-adjusted performance across portfolios
- 3D Pareto Surface: Complete picture of the objective space
The knee solution (selected portfolio) consistently appears at the “elbow” of these frontiers - where the trade-off intensity is maximal.
Why This Matters for the Kenyan Market
Kenyan equities exhibit:
- volatility is arguably high but again this is seasonal.
- Non-normal returns like any
- Structural instability
- Limited diversification opportunities
This makes single-objective optimization unreliable, multi-objective optimization adapts better, it accounts for reality not assumptions.
Key Takeaways
Beyond Mean-Variance: Modern portfolio optimization must consider multiple objectives beyond just risk and return.
Evolutionary Algorithms Work: Genetic algorithms effectively navigate the complex search space of portfolio selection, finding optimal security combinations that meet multiple criteria.
Target-Based Approach: Setting achievable targets based on empirical data ensures realistic optimization outcomes.
Knee Solutions Provide Balance: When faced with many Pareto-optimal portfolios, knee points offer a preference-free way to select well-balanced solutions.
Emerging Markets Need Tailored Approaches: The unique characteristics of emerging markets make multi-objective optimization particularly relevant and effective.
Conclusion
Portfolio optimization is no longer just about maximizing return or minimizing variance.It is about balance.By applying evolutionary multi-objective optimization to Kenyan equity data, we observed that the most effective portfolios were not those that pursued extremes.Again frfor the equites market I’d expect more return that what was offered with the algorithm well its positive but i’d expect something more than 5% given the level of risk.
This approach provides a more realistic, robust foundation for portfolio construction particularly in emerging markets where uncertainty is not the exception, but the norm. Evolution did not produce the fastest portfolio.we could call it a resilient one.
This is a research in its early stages in regards to implementation, there more adaptions we could add to it to see if we could improve the returns ultimately in a practical sense but in theory it does grant us the equilibrium.