Portfolio optimization is often presented as a problem of deciding which investments to buy.
But mathematically, it can be viewed as an optimization problem:
Given a set of constraints, how can we allocate capital to maximize expected return?
This week, let's solve a simple portfolio allocation problem using the Simplex Method.
The Problem
Suppose an investor has $100,000 to allocate among three investment strategies:
- Conservative Fund: 4% expected annual return
- Balanced Fund: 7% expected annual return
- Growth Fund: 11% expected annual return
Let:
The investor wants to maximize expected annual return:
Subject to:
In other words:
- At least $30,000 must be invested in the Conservative Fund.
- At least $20,000 must be invested in the Balanced Fund.
- At most $40,000 can be invested in the Growth Fund.
- All investments must be nonnegative.
Now let's solve this using the Simplex Method.
Converting the Constraints
This is where the mechanics of the Simplex Method become important.
For the equality constraint, we need an artificial variable to establish an initial basic variable:
For the greater-than-or-equal-to constraints, we subtract a slack variable and add an artificial variable:
For the less-than-or-equal-to constraint, we simply add a slack variable:
Because artificial variables are present, we use the Two-Phase Simplex Method.
Phase I will find a feasible solution while removing the artificial variables from the basis.
Phase I
Our Phase I objective is to minimize the sum of the artificial variables:
Since our tableau convention uses maximization, we can instead write:
For tableau convenience:
Our initial tableau is therefore:
Choosing the First Pivot
We select the most negative entry in the objective row.
There are two tied choices:
When there is a tie, either column is valid. I'll choose:
Now we use the ratio test to determine the pivot row.
Only positive entries in the pivot column are eligible:
And:
The smallest nonnegative ratio is 30,000, so the pivot is in row 2:
The pivot is already 1, so we only need to eliminate the other entries in the pivot column.
After row reduction:
Second Pivot
The most negative entry is:
The ratio test gives:
And:
So the pivot is in row 3:
After row reduction:
We now have three possible entering columns:
I'll choose slack 1 because it allows us to remove artificial 1 from the basis efficiently.
After the pivot and row reduction:
Now notice something important.
There are no negative entries in the Phase I objective row, and the optimal value is:
This means the original problem is feasible.
Even better, all the artificial variables are no longer in the basis, so we can move to Phase II.
If the minimum value of the Phase I objective had been greater than zero, the original problem would have been infeasible.
Phase II
Now we return to the original objective:
We can remove the artificial-variable columns and replace the Phase I objective with our original objective:
The most negative entry is:
So we enter with that column.
The ratio test identifies row 4 as the pivot row.
After pivoting:
The next most negative entry is:
So it remains in the basis.
After pivoting:
We now have the most negative coefficient:
So it enters the basis.
After pivoting:
Finally, the only negative entry remaining is:
So it remains in the basis.
After the final pivot:
There are now no negative entries in the objective row, so the Simplex Method terminates.
The optimal expected annual return is:
This is because we let:
Which leads to:
The Optimal Portfolio
The investor should therefore allocate:
- $30,000 to the Conservative Fund
- $30,000 to the Balanced Fund
- $40,000 to the Growth Fund
This produces an expected annual return of:
or $7,700 per year.
The interesting part is that the optimal solution pushes the Growth Fund all the way to its 40% maximum, while keeping the Conservative and Balanced investments exactly at their required minimums.
That's the power of linear optimization:
Rather than simply choosing the investment with the highest expected return, we can mathematically determine the best allocation while satisfying all of our constraints.
In a real portfolio, we would typically add additional constraints for risk, volatility, diversification, liquidity, correlation, and other factors.
And that's where portfolio optimization gets much more interesting.
Next week, I'll cover how row reductions work and the fundamentals of Reduced Row Echelon Form (RREF).
I used row reductions throughout this example to transform our Simplex tableau, but what exactly are we doing when we perform those operations, and why do they work?
That's what we'll explore next week.
