A Look at Finance Part 5: Basic Portfolio Optimization
This post is a continuation of the previous one where we look at the basic idea of how to optimize the fractions $f_A$ and $f_B$ of the assets A and B (with corresponding returns $r_A$ and $r_B$) from the toy portfolio used by van de Wijst in his Chapter 3.
Most of the statistical tools used were developed in the previous blog but it is worthwhile summarizing and generalizing them here. Note that some of the notation is tweaked from what was used in the last post to make it more generalizable. The basic primitive terms (or building blocks) are:
- An asset $I_i$, where the I stands for financial instrument and the index $i$ (or $j$ or some other appropriate index) runs over the various assets available. For the toy model, $I_1 = A$ and $I_2 = B$.
- A possible future scenario ${\mathcal S}_m$ where the index $m$ (or $n$ or some other appropriate index) runs over the various possible futures we consider, which are usually a subset of the infinite possibilities that may come about.
- The rate of return of the asset in a given scenario $r_{i,m}$ where in the subscript notation, the first index (regardless of symbol used) refers to the asset and the second index (again, regardless of symbol used) refers to the scenario.
- The probability ${\mathcal P}({\mathcal S}_m)$ that a given scenario will occur. For convenience, this will almost always be denoted by the slightly shorter form ${\mathcal P}_m$.
In terms of these primitives, we define:
- Expected return of an asset: $E_i = \sum_{m} {\mathcal P}_m r_{i,m}$,
- The variance of an asset $I_i: \sigma^2_i = \sum_m {\mathcal P}_m (r_{i,m} – E_i)^2$,
- The covariance of an asset $I_i$ with asset $I_j$ : $\sigma_{ij} = \sum_m {\mathcal P}_m (r_{i,m} – E_i)(r_{j,m} – E_j)$,
- A portfolio $P = \sum_i f_i I_i$, where each asset is assigned a fraction of portfolio $f_i \in [0,1]$ subject to $\sum_i f_i = 1$,
- A portfolio return for a given scenario $R_m = \sum_i f_i r_{i,m}$.
Then the key parameters we will be optimizing are the expected return of the portfolio, given by
\[ E[P] = \sum_m {\mathcal P}_m R_m = \sum_m {\mathcal P}_m \sum_i f_i r_{i,m} = \sum_i f_i \sum_m {\mathcal P}_m r_{i,m} = \sum_m f_i E_i \]
and the portfolio variance
\[ \sigma^2[P] = \sum_m {\mathcal P}_m (R_m – E[P])^2 = \sum_{i,j} f_i f_j \sigma_{ij} \; , \]
which we will use directly, or indirectly in the form of the standard deviation, as a measure of risk.
A Brief Aside
Since the final form of the variance shown above will be one of the two central formulas we use below, I’ll supply the proof that was omitted in the last post (for reasons of clarity) in this post (for reasons of necessity). Start by defining the residual portfolio return as $\delta R_m = R_m – E[P]$ and then substitute in the definitions given above to express the residual portfolio return as
\[ \delta R_m = \sum_i f_i r_{i,m} – \sum_m {\mathcal P}_m \sum_i f_i r_{i,m} \; . \]
Now exchange the order of the sums in the second term and combine the terms to get
\[ \delta R_m = \sum_i f_i \left( r_{i,m} – \sum_m {\mathcal P}_m r_{i,m} \right) = \sum_i f_i \left( r_{i,m} – E_i \right) \; .\]
Defining $\delta r_{i,m} = r_{i,m} – E_i$, we get
\[ \delta R_m = \sum_i f_i \delta r_{i,m} \; ,\]
which we can immediately substitute back into the variance formula to get
\[ \sigma^2[P] = \sum_m {\mathcal P}_m \sum_{i,j} f_i f_j \delta r_{i,m} \delta r_{j,m} \; .\]
Exchange the sum over the m scenarios with the sums over assets to get
\[ \sigma^2[P] = \sum_{i,j} f_i f_j \sum_{m} \delta r_{i,m} \delta r_{j,m} = \sum_{i,j} f_i f_j \sum_m {\mathcal P}_m (r_{i,m} – E_i) (r_{j,m} – E_j) \; .\]
Recognizing that the last term is the definition of the covariance completes the proof.
Optimizing the Fractions
The key, remaining question is then: what values of the fractions $f_i$ should we pick? This question doesn’t have an unambiguous answer. Should we favor higher returns over lower risk? Lower risk over higher returns? Some blended measure? We’ll defer this question for a later post and we will content ourselves with ‘getting the lay of the land’ using the toy portfolio since we only have one free parameter $f_1$ (since $f_2 = 1-f_1$)
The simple, one-dimensional nature of this problem makes it easy to evaluate the expected portfolio return
\[ E[P] = \sum_m f_i E_i \]
and the portfolio standard deviation
\[ \sigma[P] = \sqrt{ \sum_{i,j} f_i f_j \sigma_{ij} } \; \]
parametrically as $f_1$ ranges over 0 to 1.
This is a simple matter to perform in a spreadsheet, which seems to be the primary tool in the world of finance. In the case that van der Wijst provides as a toy model a plot of expected return (which must, necessarily be between 8% and 9% as $f_1$ varies between 0 and 1) looks like
Note how the volatility is equal to either 2.82% when $f_1 = 0$, corresponding to the variance of 0.0008 for asset $I_2 = B$ or 4.90% when $f_1 = 1$, corresponding to the variance of 0.0024 for asset $I_1 = A$. What is desirable is that a blend of the two lowers the variance and hence the volatility (or standard deviation) due to their negatively correlations. The optimal point is approximately $f_1 = 0.4$. At this point, the expected return is 8.4%, down from the maximum possible value of 9% if we had committed to $I_1 = A$ completely. However, as this next plot shows the $\pm 1 \sigma$ envelope around the expected return shows

a total commitment to $I_1 = A$ can, very probably, give a return as low as 4.1% (even though it might be as high as 13.9%). The ‘throat’ of the envelope is narrowest at approximately $f_1 = 0.4$ meaning that if we pick this value we are willing to give up something on the upside return (9.4% v. 13.9%) in order to hedge against the ‘bottom dropping out’ (5.5% v. 4.1%). Indeed, if we were to look at the $\pm 3 \sigma$ envelope we see that blending the two assets in some degree is required to avoid negative returns in the event of a downturn on either asset. In this way, diversification puts up a stabilizer that prevents us from losing too much for the cost of giving up the ‘get rich’ position of a raw bet.









