The Stock and the Pillow
motivated by email from Ralph J.

I recently got email from Ralph with an interesting comment.
If you own a Stock that increases by 100% then decreases by 50%, it's cause for a coronary mishap ... even though you end up with the same number of dollars.
However, if you put only 50% of your money into that Stock and the rest under the Pillow, you can end up with a gain of 12.5%.

>And if your put 100% under the pillow ... what then?
Yes, that's the question. How much of your money do you invest in that Stock and how much to put under the Pillow.
Ralph says that if the Stock is expected to go Up by U = 100% and Down by D = 50% you should invest a fraction equal to: x = (U - D) / (2 UD).
For our example, where U = 1.0 and D = 0.5 (that's a 100% gain and a 50% loss), then x = 0.5 or 50% in the Stock.

>And how do you get that?
I didn't get it, Ralph did, assuming you rebalance to maintain your Stock-Pillow allocation. (That may mean moving money from under the Pillow.)
Assuming you started with \$A, it'd go like so:
 Comment \$Amount of Stock \$Amount under the Pillow Total Amount 0 Initially xA (1-x)A \$A 1 After a Stock return of U% x*A(1+U) (1-x)*A \$A(1+xU) 2 After a rebalancing x*A(1+xU)= x*(previous Total) (1-x)*A(1+xU)= (1-x)*(previous Total) \$A(1+xU)same Total ... reallocated 3 After a Stock return of -D% x*A(1+xU)(1-D)only the Stock component gets hit (1-x)*A(1+xU)stays under the Pillow \$A {1 + (U-D)x - UDx2}
See the chart? That's your final portfolio with A = \$1 invested. The maximum portfolio occurs for x = 0.5 for U = 1 and D = -0.5.

In general, the maximum final portfolio, after a U% gain and D% loss is just A(1+xU)(1-xD) and the maximum occurs at x = (U - D) / (2 UD).

>And what if U and D are different? What if you stick in expected Gains and Losses? What if ...?
Here's a few more:

>Aha! Big losses compaired to gains and you stick nothing into stocks, right?
Yes, x = 0 and you end up with your \$1 under the Pillow.
However, big gains compared to losses and x = 1 (the middle chart), so everything goes into the Stock and you end up with (1+U)(1-D) = (1.2)(0.9) = 1.08 for each dollar invested.
But then what should you use for U and D?

>Uh ... I give up.
Notice that, after a return of U and rebalancing, we're at step #2 with a portoflio of \$A(1+xU).
In general, if you have a gain (or loss!) of R% then you rebalance then each dollar of your portfolio gets multiplied by (1+xR).
After successive returns of R1, R2 ... Rn (rebalancing after each return) you'd have a \$1.00 portfolio worth:

[1]       P = (1+xR1)(1+xR2)...(1+xRn).
What's the maximum value of that?

>Uh ...
 It's a rhetorical question. Take logs and get: [2]       log(P) = log(1+xR1) + log(1+xR2) + ... + log(1+xRn). Let's assume that the xRs are small, then log(1+xR) = xR - (1/2)(xR)2 + (1/3)(xR)3 - ...     (that's a magic theorem) That'd give: [3]       log(P) = x{R1+R2+...+Rn} - (x2/2){R12+R22+...+Rn2} + (x3/3){R13+R23+...+Rn3} - ... Figure 1log(1+z)   versus   z - (1/2)z2

Okay, let's put:
M[R] = (1/n){R1+R2+...+Rn} ... the Mean (or Average) of the returns
and
SD2[R] = (1/n){R12+R22+...+Rn2} - M2[R]     ... another magic theorem: SD2 = (average square) - (square of average)   See SD stuff

Then we'd get:

[4]       log(P) = x {n M[R]} - (x2/2){n SD2[R] + n M2[R]} + ...

Divide by n and look carefully:.

[5]       (1/n)log(P) = log(P1/n) = log(annualized portfolio return) = x {M[R]} - (x2/2){SD2[R] + M2[R]} + ...

and we're trying to maximize that.

>I could have told you that! I mean, if we ...
Pay attention!
Let's just consider the first two terms on the right-side of [5]. (See Figure 1?)
Then we ...

>Huh? You can just toss them out? They're just ...?
Well, if x = 1 (that's the largest we consider, meaning 100% allocation) and R = 20% (so R = 0.2, a rather large annual return), then we'd get:
log(1+xR) = log(1+0.2) = 0.2 - 0.02 + 0.0023 - 0.0004 + ...   so I think we can safely toss all but the first two terms.

Okay, now we exponentiate each side of [5]:

[6]       P1/n ≈ EXP[x M[R] - (x2/2)(SD2[R] + M2[R])]
Here are some plots of the annualized return for various Mean returns M and Standard Deviations SD:

If we want to maximize the right side of [6] (which approximates our Compound Annual Growth Rate = CAGR), we'd choose

[7]       x ≈ M[R} / (SD2[R] + M2[R])   so long as x lies between 0 and 1, else we'd put everything into the Stock or under the Pillow

>I've lost track of what we have. How do we interpret ...?
We look at historical annual returns of a Stock, calculate the Mean and Standard Deviation of those returns, then invest a fraction x of your money in that Stock.
In the first chart, it says you should invest x = 0.62 or 62% in the Stock and in the second chart ...

>Yeah, I can read! And do you invest that way?
You kidding? All my money stays under my pillow.

Note that, of you REALLY believe in this stuff, your Maximum CAGR would be:
 Maximum CAGR ≈ EXP[(1/2) M2[R] / { SD2[R] + M2[R] } ]   putting x ≈ M[R] / (SD2[R] + M2[R]) into the Stock ... or x = 0 or x = 1 if the above prescription gives an x-value outside 0 < x < 1.

Okay, now suppose the single Stock is a Basket of stocks with annual returns that have an Expected Mean and Standard Deviation of M[R] and SD[R].
The above prescription still holds, giving (hopefully) the precentage of your bankroll that should be invested in that Basket.
In addition, instead of putting the rest of your money under the Pillow, it's put in a Bank at a fixed annual interest rate, r.

As before, we start with \$A allocated x% to the Basket and (1-x)% to the Bank and, after a year, it changes to

[A]       \$xA(1+R) + \$(1-x)A(1+r) = \$A [ 1+r + x(R-r) ]   which, for r = 0, agrees with step #2, above.

Now consider a sequence of Basket returns and subsequent rebalancings. A \$1.00 portfolio would become P where:

[B]       log(P) = log[1+r + x(R1-r)] + log[1+r + x(R2-r)] + ... + log[1+r + x(Rn-r)]

Rewrite each term like so: log[1+r + x(R-r)] = log[ (1+r){ 1+x(R-r)/(1+r) } ] = log(1+r) + log[1+x(R-r)/(1+r)].
Then [B] becomes:

[C]       log(P) - n log(1+r) = n log[ P1/n/(1+r) ] = log(1+xK1) + log(1+xK2) + ... + log(1+xKn)   where Kj = (Rj - r) / (1 + r).

Since 1+r is constant, the maximum CAGR occurs when the series on the right-side is maximized and that's just like the problem we had originally.
We conclude that:
 Maximum CAGR ≈ EXP[((1+r)/2) M2[K] / { SD2[K] + M2[K] } ] putting x ≈ M[K] / (SD2[K] + M2[K]) into the Basket where M[K] = Mean of Kj = (Rj - r) / (1 + r)   and   SD[K] = Standard Deviation of (Rj - r) / (1 + r) ... or x = 0 or x = 1 if the above prescription gives an x-value outside 0 < x < 1.

>zzzZZZ
Don't you see? That (R-r) / (1+r) is like an inflation-reduced return, where r plays the role of the annual inflation rate. ( See Real returns. )
>zzzZZZ

Okay, let's look at M[K] = M[(R-r)/(1+r)] = (M[R] - r)/(1+r).
Further, using Σ to represent summing (for sanitary reasons):
SD2[K] = (1/n) Σ(K - M[K])2 = (1/n)Σ{ (R-r)/(1+r) - (M[R] - r)/(1+r) }2 = (1/n)Σ(R - M[R])2/(1+r)2 = SD2[R] /(1+r)2.

Our "best" allocation, namely x ≈ M[K] / (SD2[K] + M2[K]), becomes:

[D]       x ≈ (1+r)(M[R] - r) / { SD2[R] + (M[R] - r)2 }

Or, to give it a position of some importance:
 Maximum CAGR ≈ EXP[((1+r)/2) (M[R] - r)2/ { SD2[R] + (M[R] - r)2 } ] putting x ≈ (1+r)(M[R] - r) / [ (SD2[R] + (M[R] - r)2 ] into the Basket of stocks where M[R] = Mean of Rj   and   SD[R] = Standard Deviation of Rj ... or x = 0 or x = 1 if the above prescription gives an x-value outside 0 < x < 1.

Note that these magic formulas reduce to our earlier ones when r = 0.

Here are some pretty pictures:

You can play here:

 Mean Stock Return: M[R] = % Standard Deviation: SD[R] = % Bank Rate (or Risk-free Rate): r = % Stock Allocation: x = %

There's a fun spreadsheet (with one stock) that looks like this:

P.S.
I asked, on a couple of investment forums, for other "magic formulas" that suggest stock allocations ... and got these:

S = D * 2     where D = maximum allowable decline to portfolio and S = stock allocation

and
18 x dividend yield

and
2p-1   where p is the probability of the asset achieving your investment objective

... and there's the Kelly Ratio.