# On the possibility of optimal investment

## I Introduction

Non-equilibrium statistical mechanics, especially the theory of stochastic processes, finds recently wide applicability in economics. First area, intensively studied in the last several years, is the phenomenology of the signal (price, production, and other economic variables) measured on the economics system . Scaling concepts proved to be a very useful tool for such analysis.

Second area concerns optimization. In the competitive economics, agents should maximize their survival probability by balancing several requirements, often mutually exclusive, like profit and risk . Third area comprises creation of models which should grasp particular features of the behavior of real economics, like price fluctuations .

We focus here on an aspect of optimization, discussed recently by Marsili, Maslov and Zhang . In a simplified version of the economy, there are two possibilities where to put a cash: to buy either a risky asset (we shall call it stock, but it can be any kind of asset) or a riskless asset (deposit in a bank). In the latter case we are sure to gain each year a fixed amount, according to the interest rate. On the contrary, putting the money entirely to the stock is risky, but the gain may be larger (sometimes quite substantially). We may imagine, that increasing our degrees of freedom by putting a specified portion of our capital into the stock and the rest to the bank may lead to increased growth of our wealth. This way was first studied by Kelly and followers  and intensively re-investigated recently .

The point of the Kelly’s approach is, that if we suppose that the stock price performs a multiplicative process , the quantity to maximize is not the average value of the capital, but the typical value, which may be substantially different, if the process is dominated by rare big events. It was found that given the probability distribution of the stock price changes, there is a unique optimal value of the fraction of the investor’s capital put into the stock.

The purpose of the present work is to investigate the practical applicability of the strategy suggested in . Let us first briefly summarize this approach. We suppose that the price $`p_t`$ of the stock changes from time $`t`$ to $`t+1`$ according to a simple multiplicative process

$$p_{t+1}=p_t\mathrm{e}^{\eta _t}$$
(1)   
where $`\eta _t`$ for different $`t`$ are independent and equally distributed random variables. The angle brackets $`<>`$ will denote average over these variables.

We denote $`W_t`$ the total capital of the investor at the moment $`t`$. The fraction $`r`$ of the capital is stored in stock and the rest is deposited in a bank. We will call the number $`r`$ investment ratio. The interest rate provided by the bank is supposed to be fixed and equal to $`\rho `$ per one time unit. The strategy of the investor consists in keeping the investment ratio constant. It means, that he/she sells certain amount of stock every time the stock price rose and sell when the price went down.

If we suppose that the investor updates its portfolio (i. e. buys or sells some stock in order to keep the investment ratio constant) at each time step, then starting from the capital $`W_0`$, after $`N`$ time steps the investor owns

$$W_N=\underset{t=0}{\overset{N1}{}}(1+\rho +r(\mathrm{e}^{\eta _t}1\rho ))W_0.$$
(2)   
The formula can be simply generalized to the situation when there is a non-zero transaction cost equal to $`\gamma `$ (see also ) and the update of the portfolio is done each $`M`$ time steps. We assume for simplicity that $`N`$ is a multiple of $`M`$.

$$W_N=\underset{t=0}{\overset{N/M1}{}}\frac{(1+\rho )^M+r(\mathrm{e}^{\overline{\eta }_{Mt}}(1+G)(1+\rho )^M)}{1+rG}W_0$$
(3)   
where we denoted $`\overline{\eta }_{Mt}=_{i=Mt}^{Mt+M1}\eta _i`$ and $`G=\gamma \mathrm{sign}(M\mathrm{ln}(1+\rho )\overline{\eta }_{Mt}).`$

We can see that like the stock price itself, the capital performs a multiplicative process.

$$W_{t+1}=e_t(r)W_t$$
(4)   
where the random variables $`e_t(r)`$ depend on the investment ratio as a parameter.

For $`N`$ sufficiently large the typical growth of the capital $`(W_{t+1}/W_t)_{typical}`$ is not equal to the mean $`<e(r)>`$ as one would naively expect, but is given by the median , which in this case gives

$$g(r)=\mathrm{log}((W_{t+1}/W_t)_{typical})=<\mathrm{log}e(r)>.$$
(5)   
Therefore we look for the maximum of $`g`$ as a function of $`r`$, which in the simplest case without transaction costs leads to the equation

$$<\frac{\mathrm{e}^\eta 1\rho }{1+\rho +r_{\mathrm{opt}}(\mathrm{e}^\eta 1\rho )}>=0.$$
(6)   
for the optimum strategy $`r_{\mathrm{opt}}`$. If the solution falls outside the interval $`[0,1]`$, one of the boundary points is the true optimum, based on the following conditions. If $`g^{}(0)<0`$ the optimum is $`r_{\mathrm{opt}}=0`$. If $`g^{}(1)>0`$ the optimum is $`r_{\mathrm{opt}}=1`$.

If $`\eta `$ is a random variable with probability density

$$P(\eta )=\frac{1}{2}\left(\delta (\eta md)+\delta (\eta m+d)\right)$$
(7)   
the solution of (6) is straightforward:

$$r_{\mathrm{opt}}=\frac{1}{2}\left(\frac{1+\rho }{1+\rho \mathrm{e}^{m+d}}+\frac{1+\rho }{1+\rho \mathrm{e}^{md}}\right).$$
(8)   
In more complicated cases we need to solve the equation (6) numerically. However, for small mean and variance of $`\eta `$ approximative analytical formulae are fairly accurate . We found, that equally good approximation is obtained, if we set $`m=<\eta >`$ and $`d=\sqrt{<\eta ^2><\eta >^2}`$ in the Eq. 8.

In the next section we investigate the method with real data. Section III shows the influence of the transaction costs. In Sec. IV a generalization of the method for the case of time-correlated price is shown. Finally, in Sec. V we discuss the obtained results.

## II Two-time optimal strategies

In the previous section we supposed the following procedure: the investor takes the stock price data and extracts some statistical information from them. This information is then plugged into theoretical machinery, which returns the suggested number $`r`$. However, we may also follow different path, which should be in principle equivalent, but in practice it looks different.

Namely, suppose we observe the past evolution of the stock price during some period starting at time $`t_1`$ and finishing at time $`t_2`$ (most probably it will be the present moment, but not necessarily). Then, we imagine that at time $`t_1`$ an investor started with capital $`W_{t_1}=1`$ and during that period followed the strategy determined by certain value of $`r`$. We compute his/her capital $`W_{t_2}(r)`$ at final time and find the maximum of the final capital $`W_{t_2}(r)`$ with respect to $`r`$. We call the value $`r_{\mathrm{opt}}`$ maximizing the final capital two-time optimal strategy. Optimum strategy in the past can be then used as predicted optimal strategy for the future.

The capital at time $`t_2`$ is again

$$W_{t_2}(r)=\underset{t=t_1}{\overset{t_21}{}}(1+\rho +r(\mathrm{e}^{\eta _t}1\rho ))$$
(9)   
and its maximization with respect to $`r`$ leads to equation

$$g^{}(r_{\mathrm{opt}})=\underset{t=t_1}{\overset{t_21}{}}\frac{\mathrm{e}^{\eta _t}1\rho }{1+\rho +r_{\mathrm{opt}}(\mathrm{e}^{\eta _t}1\rho )}=0$$
(10)   
which gives the optimal investment ratio $`r_{\mathrm{opt}}(t_1,t_2)`$ as a function of initial time $`t_1`$ and final time $`t_2`$. Note that it is an analog of the equation (6) but we deal with time averages here, not with sample averages as before. This is also another justification of the procedure of maximizing $`<\mathrm{log}(W_{t+1}/W_t)>`$ instead of $`<W_{t+1}/W_t>`$.

For comparison with reality we took the daily values of the New York Stock Exchange (NYSE) composite index. The time is measured in working days. The period studied started on 2 January 1990 ($`t=0`$) and finished on 31 December 1998 ($`t=2181`$). The time evolution of the index $`x(t)`$ is shown in Fig. 1. The values of $`\eta `$ are determined by $`\mathrm{exp}(\eta _t)=x(t+1)/x(t)`$.

The data of NYSE composite index were analyzed by calculating the two-time optimal strategies $`r_{\mathrm{opt}}(t_1,t_2)`$. As a typical example of the behavior observed, for initial time $`t_1=300`$ we vary the final time $`t_2`$ up to 2180. We used the interest rate 6.5% per 250 days (a realistic value for approximately 1 year). In this case we neglect the transaction costs, $`\gamma =0`$. The influence of non-zero transaction costs will be investigated in Sec. III. The results are in Fig. 2(a). We investigated also the possibility that the investment ratio goes beyond the limits 0 and 1, which means that the investor borrows either money or stock. We imposed the interest rate 8% on the loans and calculated again the optimal $`r`$. The results are in Fig. 2(c). We can see several far-reaching excursions above 1 and some also below 0, which indicates that quite often the optimal strategy requires borrowing considerable amount of money or stock.

An important conclusion may be drawn from the results obtained: the optimal strategy $`r_{\mathrm{opt}}(t_1,t_2)`$ as a function of the final time $`t_2`$ does not follow any smooth trajectory. On the contrary, the dependence is extremely noisy, as can be seen very well in the Fig. 2. Moreover, the strategy is very sensitive to initial conditions. If we compare the strategy $`r_{\mathrm{opt}}(t_1,t_2)`$ and $`r_{\mathrm{opt}}(t_1+\mathrm{\Delta }t,t_2)`$ for slightly different initial time, big differences are found in regions, where the strategy is non-trivial $`(0<r_{\mathrm{opt}}<1)`$. In Fig. 3 we show for $`\mathrm{\Delta }t=1`$ the average difference in optimal strategy

$$\mathrm{\Delta }r_{\mathrm{opt}}(t)=|r_{\mathrm{opt}}(t_1,t_1+t)r_{\mathrm{opt}}(t_1+1,t_1+t)|$$
(11)   
where the average is taken over all initial times $`t_1`$ with the constraint, that we take into account only the points where both optimal strategies $`r_{\mathrm{opt}}(t_1,t_1+t)`$ and $`r_{\mathrm{opt}}(t_1+1,t_1+t)`$ are non-trivial.

Due to poor statistics, the data are not very smooth. We can also observe apparent two branches of the dependece, which is caused by superimposing data from different portions of the time evolution of the index. However, despite of the poor quality of the data, we can conclude, that even after a period as long as 1000 days (approximately 4 years) the difference of 1 day in the starting time leads to difference in optimal strategy as large as about 0.2. This finding challenges the reliability of the investment strategy based on finding optimal investment ratio $`r`$.

Moreover, we can see that if loans are prohibited, there are long periods where the optimal strategy is trivial ($`r_{\mathrm{opt}}=0`$ or $`r_{\mathrm{opt}}=1`$). We investigated the whole history of the NYSE composite index shown in Fig. 1 and determined, for which pairs $`(t_1,t_2)`$ the optimal strategy $`r_{\mathrm{opt}}(t_1,t_2)`$ is non-trivial. In the Fig. 4 each dot represents such pair. (In fact, not every point was checked: the grid $`5\times 5`$ was used, i. e. only such times which are multiples of 5 were investigated.)

We can observe large empty regions, which indicate absence of a non-trivial investment. In order to understand the origin of such empty spaces, let us consider a simple model. Suppose we have the random variable distributed according to (7), and $`\rho =0`$. Then the conditions for the existence of non-trivial optimal strategy between $`t_1=0`$ and $`t_2=N`$ are

$$g^{}(0)=\underset{t=0}{\overset{N1}{}}(\mathrm{e}^{\eta _t}1)>0$$
(12)   
and

$$g^{}(1)=\underset{t=0}{\overset{N1}{}}(1\mathrm{e}^{\eta _t})<0.$$
(13)   
Let us compute the probability $`p_{\mathrm{nt}}`$ that both of these conditions are satisfied. We have

$$g^{}(0)=N(\mathrm{e}^m\mathrm{cosh}d1)+\mathrm{e}^m\mathrm{sinh}d\underset{t=0}{\overset{N1}{}}z_t$$
(14)   
and

$$g^{}(1)=N(1\mathrm{e}^m\mathrm{cosh}d)+\mathrm{e}^m\mathrm{sinh}d\underset{t=0}{\overset{N1}{}}z_t$$
(15)   
where $`z`$’s can have values +1 or -1 with probability 1/2. The sum $`_{t=0}^{N1}z_t`$ has binomial distribution, and for large $`N`$ we can write

$$p_{\mathrm{nt}}=_{\sqrt{N}(\mathrm{coth}d\mathrm{e}^m/\mathrm{sinh}d)}^{\sqrt{N}(\mathrm{coth}d\mathrm{e}^m/\mathrm{sinh}d)}\frac{\mathrm{d}\zeta }{\sqrt{2\pi }}\mathrm{exp}(\frac{\zeta ^2}{2}).$$
(16)   
We can see immediately that $`p_{\mathrm{nt}}`$ has a value close to 1 for the number of time steps at least

$$Nd^2.$$
(17)   
For the data in Fig. 1 we found $`d0.01`$, which means $`N10000`$ days, or 40 years. This is thus an estimate of how long we need to observe the stock price before a reliable strategy can be fixed. However, during such a long period the market changes substantially many times. That is why no simple strategy of the kind investigated here can lead to sure profit.

## III Transaction costs

We investigated the influence of the transaction costs $`\gamma `$ and time lag $`M`$ between transactions. We found nearly no dependence on $`M`$, but the dependence on $`\gamma `$ is rather strong. It can be qualitatively seen in Fig. 2(b). When we compare the optimal strategy for $`\gamma =0`$ and $`\gamma =0.005`$, we can see, that already transaction costs $`0.5\%`$ decrease substantially the fraction of time when the strategy is non-trivial. We investigated the dependence of the fraction $`f_{\mathrm{nontrivial}}`$ of time pairs $`(t_1,t_2)`$ between which a nontrivial strategy exists on the transaction costs. We have found that it decreases with $`\gamma `$ and reaches negligible value for $`\gamma 0.006`$. This behavior is shown in Fig. 5.

The explanation of this behavior lies in the fact, that the transaction costs introduce some friction in the market, which means that large changes of the investment ratio are suppressed. Because the investment ration is mostly 0 or 1 even for $`\gamma =0`$, this implies that changing $`r`$ from 0 or 1 to a non-trivial value is even harder for $`\gamma >0`$ and a non-trivial investment becomes nearly impossible for large transaction costs.

## IV Investment in presence of correlations

In order to improve the strategy based only on the knowledge of the distribution of $`\eta `$, we would like to investigate a possible profit taken from the short-time correlations.

Imagine again the simplest case, when $`\eta `$ can have only two values, $`\eta ^+=m+d`$ and $`\eta ^{}=md`$. However, now $`\eta _t`$ and $`\eta _{t1}`$ may be correlated and we suppose the following probability distribution $`P(\eta _{t1},\eta _t)=1/4+c`$ if $`\eta _{t1}=\eta _t`$ and $`P(\eta _{t1},\eta _t)=1/4c`$ if $`\eta _{t1}\eta _t`$. The parameter $`c`$ quantifies the short-time correlations.

At time $`t`$ the strategy $`r(\eta _{t1})`$ should depend on the value of $`\eta `$ in the previous step. In our simplified situation we have only two possibilities, $`r^+=r(\eta ^+)`$ and $`r^{}=r(\eta ^{})`$. The problem then reduces to maximization of the typical gain

$$g(r^+,r^{})=<\mathrm{ln}(1+\rho +r(\eta _{t1})(\mathrm{e}^{\eta _t}1\rho ))>$$
(18)   
which leads to decoupled equations for $`r_{\mathrm{opt}}^+`$ and $`r_{\mathrm{opt}}^{}`$

$`{\displaystyle \frac{g(r_{\mathrm{opt}}^+,r_{\mathrm{opt}}^{})}{r^+}}=`$ $`({\displaystyle \frac{1}{4}}+c){\displaystyle \frac{\mathrm{e}^{m+d}1\rho }{1+\rho +r_{\mathrm{opt}}^+(\mathrm{e}^{m+d}1\rho )}}+`$ (19)   
$`({\displaystyle \frac{1}{4}}c){\displaystyle \frac{\mathrm{e}^{md}1\rho }{1+\rho +r_{\mathrm{opt}}^+(\mathrm{e}^{md}1\rho )}}=0`$ (20)   
$`{\displaystyle \frac{g(r_{\mathrm{opt}}^+,r_{\mathrm{opt}}^{})}{r^{}}}=`$ $`({\displaystyle \frac{1}{4}}+c){\displaystyle \frac{\mathrm{e}^{md}1\rho }{1+\rho +r_{\mathrm{opt}}^{}(\mathrm{e}^{md}1\rho )}}+`$ (21)   
$`({\displaystyle \frac{1}{4}}c){\displaystyle \frac{\mathrm{e}^{m+d}1\rho }{1+\rho +r_{\mathrm{opt}}^{}(\mathrm{e}^{m+d}1\rho )}}=0.`$ (22)   
The solution is a straightforward generalization of Eq. (7).

The above procedure works equally well even in the case of more complicated time correlations. For example we may imagine that the price evolution is positively correlated over two time steps, i. e. $`\mathrm{Prob}(\eta _{t2}=\eta _t)>1/2`$, while $`\mathrm{Prob}(\eta _{t1}=\eta _t)=1/2`$. Generally, we have some joint probability distribution for the past and present $`P(\eta ^<,\eta )`$, where we denote $`\eta ^<=[\mathrm{},\eta _{t3},\eta _{t2},\eta _{t1}]`$ and $`\eta =\eta _t`$. The typical gain becomes a functional depending on the strategy $`r(\eta ^<)`$ which itself depends on the past price history.

However, maximizing this functional by looking for its stationary point leads to very simple set of decoupled equations for the strategies

$$d\eta P(\eta ^<,\eta )\frac{\mathrm{e}^\eta 1\rho }{1+\rho +r_{\mathrm{opt}}(\eta ^<)(\mathrm{e}^\eta 1\rho )}=0.$$
(23)   
In the simplest case, when we assume that the strategy depends only on the sign of $`\eta `$ in the previous step, we performed the analysis on the NYSE composite index shown in the Fig. 1. We found optimal pairs $`[r_{\mathrm{opt}}^+,r_{\mathrm{opt}}^{}]`$. Contrary to the case when correlations were not taken into account, no non-trivial investment strategy was found. So, instead to improve the method of Ref. , the applicability of this method is further discredited.

## V Conclusions

We investigated the method of finding the optimal investment strategy based on the Kelly criterion. We checked the method on real data based on the time evolution of the New York Stock Exchange composite index. We found, that it is rarely possible to find an optimal strategy which would be stable at least for a short period of time. There are several reasons, which discredit the method based on the Kelly criterion. First, the optimal investment ratio fluctuates very rapidly in time. Second, it depends strongly on the time, when the investment strategy started to be applied. The difference of 1 day in the starting moment makes substantial difference even after 1000 days of investment. Third, the fraction of days, for which a non-trivial investment strategy is possible, is very low. This fraction also decreases with transaction costs and reaches negligible values for transaction costs about $`0.6\%`$. Taking into account possible correlations in the time evolution of the index makes the situation even less favorable, reducing further the fraction of times, when a non-trivial investment is possible.

We conclude, that straightforward application of the investment strategy based on the Kelly criterion would be very difficult in real conditions. The question remains, whether there are other optimization schemes, which would lead to more certain investment strategies. It would be also interesting to apply the approach used in this paper in order to check the reliability of the option-pricing strategies.

###### Acknowledgements.

I am obliged to Y.-C. Zhang, M. Serva, and M. Kotrla for many discussions and stimulating comments. I wish to thank to the Institut de Physique Théorique, Université de Fribourg, Switzerland, for financial support.