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 StockPillow 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  (1x)A  $A 
1  After a Stock return of U%  x*A(1+U)  (1x)*A  $A(1+xU) 
2  After a rebalancing  x*A(1+xU) = x*(previous Total)  (1x)*A(1+xU) = (1x)*(previous Total)  $A(1+xU) same Total ... reallocated 
3  After a Stock return of D%  x*A(1+xU)(1D) only the Stock component gets hit  (1x)*A(1+xU) stays under the Pillow  $A {1 + (UD)x  UDx^{2}} 


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)(1xD) 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)(1D) = (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 R_{1}, R_{2} ... R_{n}
(rebalancing after each return) you'd have a $1.00 portfolio worth:
[1] P = (1+xR_{1})(1+xR_{2})...(1+xR_{n}).
What's the maximum value of that?
>Uh ...
It's a rhetorical question.
Take logs and get:
[2] log(P) = log(1+xR_{1}) + log(1+xR_{2}) + ... + log(1+xR_{n}).
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{R_{1}+R_{2}+...+R_{n}}
 (x^{2}/2){R_{1}^{2}+R_{2}^{2}+...+R_{n}^{2}}
+ (x^{3}/3){R_{1}^{3}+R_{2}^{3}+...+R_{n}^{3}}
 ...
 Figure 1 log(1+z) versus z  (1/2)z^{2}

Okay, let's put:
M[R] = (1/n){R_{1}+R_{2}+...+R_{n}}
... the Mean (or Average) of the returns
and
SD^{2}[R] = (1/n){R_{1}^{2}+R_{2}^{2}+...+R_{n}^{2}}
 M^{2}[R] ... another magic theorem: SD^{2} = (average square)  (square of average)
See SD stuff
Then we'd get:
[4] log(P) = x {n M[R]}
 (x^{2}/2){n SD^{2}[R] + n M^{2}[R]} + ...
Divide by n and look carefully:.
[5] (1/n)log(P) = log(P^{1/n}) = log(annualized portfolio return)
= x {M[R]}
 (x^{2}/2){SD^{2}[R] + M^{2}[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 rightside 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] P^{1/n} ≈ EXP[x M[R]
 (x^{2}/2)(SD^{2}[R] + M^{2}[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} / (SD^{2}[R] + M^{2}[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) M^{2}[R] / { SD^{2}[R] + M^{2}[R] } ]
putting x ≈ M[R] / (SD^{2}[R] + M^{2}[R]) into the Stock
... or x = 0 or x = 1 if the above prescription gives an xvalue 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 (1x)% to the Bank and, after a year, it changes to
[A] $xA(1+R) + $(1x)A(1+r) = $A [ 1+r + x(Rr) ]
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(R_{1}r)] + log[1+r + x(R_{2}r)] + ... + log[1+r + x(R_{n}r)]
Rewrite each term like so: log[1+r + x(Rr)] = log[ (1+r){ 1+x(Rr)/(1+r) } ] = log(1+r) + log[1+x(Rr)/(1+r)].
Then [B] becomes:
[C] log(P)  n log(1+r) = n log[ P^{1/n}/(1+r) ] = log(1+xK_{1}) + log(1+xK_{2}) + ... + log(1+xK_{n})
where K_{j} = (R_{j}  r) / (1 + r).
Since 1+r is constant, the maximum CAGR occurs when the series on the rightside is maximized and that's just like the problem we had originally.
We conclude that:
Maximum CAGR ≈ EXP[((1+r)/2) M^{2}[K] / { SD^{2}[K] + M^{2}[K] } ]
putting x ≈ M[K] / (SD^{2}[K] + M^{2}[K]) into the Basket
where M[K] = Mean of K_{j} = (R_{j}  r) / (1 + r) and SD[K] = Standard Deviation of (R_{j}  r) / (1 + r)
... or x = 0 or x = 1 if the above prescription gives an xvalue outside 0 < x < 1.

>zzzZZZ
Don't you see? That (Rr) / (1+r) is like an inflationreduced return, where r plays the role of the annual inflation rate.
( See Real returns. )
>zzzZZZ
Okay, let's look at M[K] = M[(Rr)/(1+r)] = (M[R]  r)/(1+r).
Further, using Σ to represent summing (for sanitary reasons):
SD^{2}[K] = (1/n) Σ(K  M[K])^{2} = (1/n)Σ{ (Rr)/(1+r)  (M[R]  r)/(1+r) }^{2}
= (1/n)Σ(R  M[R])^{2}/(1+r)^{2} = SD^{2}[R] /(1+r)^{2}.
Our "best" allocation, namely x ≈ M[K] / (SD^{2}[K] + M^{2}[K]), becomes:
[D] x ≈ (1+r)(M[R]  r) / { SD^{2}[R] + (M[R]  r)^{2} }
Or, to give it a position of some importance:
Maximum CAGR ≈ EXP[((1+r)/2) (M[R]  r)^{2}/ { SD^{2}[R] + (M[R]  r)^{2} } ]
putting x ≈ (1+r)(M[R]  r) / [ (SD^{2}[R] + (M[R]  r)^{2} ] into the Basket of stocks
where M[R] = Mean of R_{j} and SD[R] = Standard Deviation of R_{j}
... or x = 0 or x = 1 if the above prescription gives an xvalue outside 0 < x < 1.

Note that these magic formulas reduce to our earlier ones when r = 0.
Here are some pretty pictures:
>Where's the spreadsheet?
You can play here:
There's a fun spreadsheet (with one stock) that looks like this:
Click on the picture to download the spreadsheet
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
2p1 where p is the probability of the asset achieving your investment objective
... and there's the Kelly Ratio.
