Minimum Variance Portfolio

Walks through how diversifying stocks makes individual risk basically vanish while covariance dominates, with a hands-on two-stock example using correlation coefficients 0, 1, and -1.

Picking up right from the previous post. No intro.

Alright so anyway… let’s see how “risk” goes down when you scatter your investments across this and that. Well, rather than saying risk goes down, I think what we can really show is that “the risk from individual stocks gets wiped out.”

When there are 2 stocks in the portfolio, the variance of the portfolio is

The variance of a two-stock portfolio: σ_p² = w_1² σ_1² + w_2² σ_2² + 2 w_1 w_2 Cov(R_1, R_2)

When $n = 3$,

The variance of a three-stock portfolio: the three terms w_i² σ_i² plus 2 w_i w_j Cov(R_i, R_j) for the pairs 1-2, 1-3 and 2-3

Up to here I can’t quite feel what’s going on, but if we look at $n = 4$,

The variance of a four-stock portfolio: four variance terms w_i² σ_i² plus six covariance terms 2 w_i w_j Cov(R_i, R_j)

What I’m getting at is… let me write out the case $n = k$.

The variance written out for n = k: the k variance terms in red, the covariance terms in blue, and so many written in the middle of the blue terms

There are $k$ terms where the risk from individual stocks affects the overall portfolio risk. But the number of terms where the covariance affects the overall portfolio risk is on the order of k squared terms. It’s going to be an overwhelming number….

So the more stocks there are, the more “the risk from individual stocks becomes meaningless.” But the risk related to covariance stays right where it is.

I haven’t checked yet whether the overall portfolio risk gets smaller or larger as the number of stocks grows, so I don’t know. However, in terms of proportion, I have at least confirmed that the covariance terms take up almost 100%. Of course, since this is the risk of a portfolio built with $w_1, w_2, \ldots, w_n$ all taken into account too, it’s somewhat complicated.

But once almost nothing is left except the covariance effect…… if we then tweak $w_1, \ldots, w_n$ to push that covariance risk as low as possible, we can build a ree~~ally excellent portfolio~~ I think that’s how you get the gist of it.

A two-stock example

So let’s take a very simple example and actually do the calculation ourselves. Let’s say there are 2 stocks, and each takes up 50% of the portfolio ($w_1 = w_2 = 50\% = 0.5$), and let’s say The mean returns: the average of R_1 is 20% and the average of R_2 is 30%, and σ_1 = 30%, σ_2 = 40% too.

And we’re going to look at when the correlation coefficient between the two stock returns is 0, 1, and -1. I’m expecting something really interesting to show up, heh heh heh

First, when the correlation coefficient between the two stock returns is 0,

The variance for ρ = 0: σ_p² = w_1² σ_1² + w_2² σ_2² + 2 w_1 w_2 Cov(R_1, R_2) = (1/4)(0.3)² + (1/4)(0.4)² + 0 = 0.25/4

so

The result: σ_p = √(0.25/4) = 1/4 = 0.25

Having seen it calculated this way, I could confirm that it comes out smaller than σ_1 = 30%, σ_2 = 40%, the standard deviations of the two individual stock returns.

But that was just now, with the correlation coefficient being 0, assuming the two stock returns have no correlation at all, so now we’ll look at the cases where there is a correlation. Let’s say they’re in a very extreme relationship. So I’ll do $\rho = 1$ and $\rho = -1$.

The case ρ_1,2 = -1: σ_p² = 0.0025, so σ_p = 0.05

The case ρ_1,2 = 1: σ_p² = 0.1225, so σ_p ≅ 0.35

Ah… so even if you diversify, σ_p σ_p can still be swayed depending on ρ_1,2 — that’s what this shows.

What this means is…

“Yoo~~~ I did some investing this time, and I diversified!!~~” “Oh really??? Show me, hehehe — how’d you do it?!?!?!”

“Look at this~~~ Hyundai cars, Kia cars, Renault cars, and Ssangyong!!!~~~” “Yeah, great diversification….;;;;;;”

After seeing this story, take another look at

The case ρ_1,2 = 1 once more: σ_p² = 0.1225, so σ_p ≅ 0.35

Doesn’t it seem kinda reasonable that the 0.35 in there comes out as the average of σ_1 = 30%, σ_2 = 40%, the standard deviations of the two individual stocks’ returns??? (since 50% went into each)

Then let’s conclude like this: only for w_1 = w_2 = 50%, $\sigma_p$ is the largest when ρ_1,2 = 1 and the smallest when ρ_1,2 = -1!!!

It came out as 0.35 → 0.25 → 0.05.

Varying the weights and plotting the points

From here on down, I’m going to vary the ordered pair w_1, w_2 and watch the trend in how it changes.

Ah, but I didn’t calculate the portfolio’s expected return above. That one, μ_p = w_1 μ_1 + w_2 μ_2, is just a weighted sum like this, so I didn’t treat it as a big deal. But from here on down, I’ll calculate the portfolio’s expected return together with the rest.

Anyway, now let’s vary the ordered pair w_1, w_2 and see what the expected value of the portfolio return and the standard deviation come out to in each situation. If I wrote out every single step of the calculation, it’d get insanely long, right? So I’ll just throw you a table. Trust me! hehe

The author’s handwritten table: for each pair (w_1, w_2) from (1.0, 0) down to (0, 1), the portfolio’s μ_p and σ_p in the three cases ρ = 1, ρ = 0 and ρ = -1

It comes out like this, they say.

Then I’ll bundle up the expected value and the standard deviation of the return in each situation as pairs,

Hand-drawn coordinate axes: μ going up, σ going right

and plot them as points, pop pop pop, on coordinate axes like this!! I’ll have the computer plot the points, pop pop pop.

The author’s spreadsheet and scatter chart: columns y-axis (μ_p) and x-axis 1, 2, 3 (σ_p for ρ = 1, 0, -1) with the nine points plotted; the chart title reads What is this?!

(blue: $\rho = 1$, orange: $\rho = 0$, gray: $\rho = -1$)

When I told it to plot the points, it plotted them like this. So I told it to connect them with lines here and there.

The same spreadsheet with the points connected by lines

(blue: $\rho = 1$, orange: $\rho = 0$, gray: $\rho = -1$)

Ah…. the points aren’t coming out the way I intended….lol

Right now I’ve split the ordered pairs (σ, μ) into 9 cases, but if I subdivide them really, really finely and take lots of cases into account, the gray one should get its points plotted like this:

The same spreadsheet and chart with one more gray point added at σ = 0

(blue: $\rho = 1$, orange: $\rho = 0$, gray: $\rho = -1$)

So I adjusted the data values a bit, and plotted one more point like this, rigging it so the graph gets drawn the way I intended!!!

When $\rho$ is 1 or -1, they have the property of being drawn as straight lines!!! But in that gray case, where the backward-bending part is drawn, there’s a point where risk becomes 0???? Let’s just pocket facts like this, so we can pull them out and use them when we need them^^

Anyway, let me summarize.

Handwritten note beside a sketch of curves on μ-σ axes: On the axes, the stock 1 and stock 2 portfolio’s μ-σ relation, ρ, depending on what the correlation coefficient is, what kind of (line) it is gets decided, and inside that line,

Handwritten note beside a dotted curve: Which point it sits at? The investment ratios w_1, w_2 decide it

I think it can be summarized like this.

Finding the minimum variance portfolio

Once the portfolio is decided as one holding $\text{stock}_1$ and $\text{stock}_2$, the correlation coefficient is decided as $\rho_{1,2}$ too. If it had been $\text{stock}_7$ and $\text{stock}_{13}$, we’d have gotten a different correlation coefficient, $\rho_{7,13}$, instead of $\rho_{1,2}$, but our choice was $\text{stock}_1$ and $\text{stock}_2$. So, in other words, right now

Hand-drawn μ-σ axes with one red curve and a blue circle on its left tip, the minimum variance point

on these axes, one particular line has been decided, and now we want to know the investment ratio $w_1$ for $\text{stock}_1$ and the investment ratio $w_2$ for $\text{stock}_2$.

That is, the moment the stocks are decided as $i$ and $j$, there should be exactly one pair of “$w_1$ and $w_2$ that make it the minimum variance portfolio”, right?? The ratio of $w_1$ to $w_2$ at that minimum variance portfolio will be represented by that blue point.

But where are the levels of $w_1$ and $w_2$ that give us that point!!!!! How do we find that!!!!!!

Since we’ve decided to build the portfolio out of 2 stocks, $\text{stock}_1$ and $\text{stock}_2$, it means $\rho_{1,2}$ has been decided, so the portfolio variance is

The two-stock portfolio variance: σ_p² = w_1² σ_1² + w_2² σ_2² + 2 w_1 w_2 Cov(R_1, R_2) = w_1² σ_1² + w_2² σ_2² + 2 w_1 w_2 σ_1 σ_2 ρ_1,2

and right now, everything in it except $w_1$ and $w_2$ is already decided!!!

Wow, damn, so that’s two variables?????

That’s No No ~~~ we can merge them into 1 hehehe since we have the condition $w_1 + w_2 = 1$

The same variance with w_2 replaced by 1 - w_1: w_1² σ_1² + (1 - w_1)² σ_2² + 2 w_1 (1 - w_1) σ_1 σ_2 ρ_1,2

like this, we’re down to one variable, and since all the other variables are now constants, we can find the $w_1$ that gives the minimum variance portfolio!!!

We just need to differentiate the variance $\sigma_p^2$ with respect to $w_1$ (it has the same minimum as $\sigma_p$), right?!?! All we need is the spot where the derivative hits 0

The derivative of the variance with respect to w_1 set to 0 and solved: w_1* = (σ_2² - Cov(R_1, R_2)) / (σ_1² + σ_2² - 2 σ_1 σ_2 ρ_1,2); the note on the right says To make this value 0, we look for w_1, that w_1 - I’ll call it w_1*

It only looks outrageously complicated — the arithmetic is about 11th-grade level.

Anyway, we found $w_1$ like this, but do we have to find $w_2$ like this all over again????

That’s No NO ~~~~ it’s simple

The other weight: w_2* = 1 - w_1* = (σ_1² - Cov(R_1, R_2)) / (σ_1² + σ_2² - 2 σ_1 σ_2 ρ_1,2)


Heads-up. The figures here are the original notes, slips and all. A few things to watch for:

  • In the handwritten table, the third group of columns is headed $\rho = 1$ but holds the values for $\rho = -1$: there $\sigma_p = |0.3w_1 - 0.4w_2|$, which is $0.05$ at $w_1 = w_2 = 0.5$.
  • In the picture where $w_2$ is replaced by $1 - w_1$, the left side should be just $\sigma_p^2$; the $\frac{d}{d}$ in front of it is a leftover, and the differentiation comes in the next picture.

Comments

Discussion happens via GitHub Discussions. You'll need a GitHub account to comment.