<p>OP's Python code is computing one path in time and is not averaging over the paths. So it is not the value shown in the plot. In fact what the OP's Python code computes is <span class="math-container">$(1+\Delta x_H)^h(1-\Delta x_T)^t$</span> where <span class="math-container">$h$</span> denotes the number of heads and <span class="math-container">$t$</span> the number of tails tosses. It is closer to the red line which is the most likely path where <span class="math-container">$h=t$</span>.</p>
<p><span class="math-container">$$\mathbf E[x_{t+1}|x_t] = \big[(1+\Delta x_H)p_H+(1-\Delta x_T)p_L\big]x_t=(1+p_H\Delta x_H-p_L\Delta x_T)x_t=:ex_t,$$</span>
and
<span class="math-container">$$\mathbf E[x_{t+1}|x_{t-1}]=\mathbf E[\mathbf E[x_{t+1}|x_t]|x_{t-1}]=e^2x_{t-1}.$$</span>
So <span class="math-container">$\mathbf E[x_t|x_t]=e^tx_0$</span> exactly as shown in the paper plot. This can also be derived directly through the generating function of the expected <span class="math-container">$\frac{x_t}{x_0}$</span> which is, due to the independence of each toss, simply the product of all the dot product of payoff and its associated probability, i.e., <span class="math-container">$e^t$</span>.</p>

CC BY-SA 4.0
2021-02-07T08:04:07.327Z
2021-02-07T18:34:55.557Z
2021-02-07T18:34:55.557Z
Hans
<p>Disclaimer: I'm not well read in economics but am mathematically literate (PhD in Mech Eng)</p>
<p>Recently I was sent a paper from Nature Physics, <a href="https://www.nature.com/articles/s41567-019-0732-0" rel="nofollow noreferrer">&quot;The ergodicity problem in economics&quot; by Ole Peters</a>.</p>
<p>I was discussing this with a friend who also isn't an economist but has more than just a passing interest.</p>
<p>He made the claim that in <a href="https://www.nature.com/articles/s41567-019-0732-0/figures/2" rel="nofollow noreferrer">figure 2</a> of the paper the graph is wrong i.e. that the expectation values (the blue line) are wrong in that they should be plotting a plot of <code>0.9^(number of rounds/2)</code>, which would have a negative slope. He then goes on to say that this renders the paper garbage.</p>
<p>Now obvioulsy this paper was published in Nature Physics which currently has an impact factor of 22.8 so I find it hard to believe that this would have slipped past peer review.</p>
<p>So my question, is the paper wrong or is my friend?</p>
<p><strong>EDIT #1:</strong></p>
<p>One of the comments was where did the expectaion equation derive from. I'm not sure of my friends derivation but if you run the model proposed in equation 2 of the paper then you do indeed get an ever decreasng return. I used the following Python code to run the model...</p>
<pre><code>from matplotlib import pyplot as plt
import numpy as np

wealth     = 1000
num_tosses = 1000
h_t        = np.random.randint(1, high=1000, size=num_tosses)
x          = []
acc_wealth = []

for idx, toss in enumerate(h_t):
    
    if toss % 2 == 0:
        wealth = wealth + (0.5*wealth)
    else:
        wealth = wealth - (0.4*wealth)
        
    x.append(idx)
    acc_wealth.append(wealth)
         
fig = plt.figure()
plt.plot(x, acc_wealth, &quot;o-&quot;, lw = 2)
</code></pre>
<p>A typical plot of accumulated wealth v toss number....</p>
<p><a href="https://i.sstatic.net/wYaSc.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wYaSc.png" alt="enter image description here" /></a></p>
<p>This is clearly not what we're seeing in figure 2 of the paper...</p>
<p><a href="https://i.sstatic.net/KJ6mP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/KJ6mP.png" alt="enter image description here" /></a></p>
<p>Here the blue line is the accumulated wealth (log scale on the y axis) v toss number. It is increasing!!!</p>
<p><strong>EDIT #2</strong></p>
<p>I'm going to post an amended version this on the Statistics Exchange page too.</p>
<p><strong>EDIT #3</strong></p>
<p><a href="https://stats.stackexchange.com/questions/440573/the-ergodicity-problem-in-economics/440617#440617">Answer from Cross Validated (Statistics Stack Exchange)</a></p>

CC BY-SA 4.0
2019-12-11T14:02:24.277Z
Could you please try to make the question a little more self contained?  I am not sure if this is possible, perhaps it would require quoting most of the paper.
Giskard
CC BY-SA 4.0
2019-12-11T14:08:32.610Z
@Giskard which is why I've linked to the paper itself & the relevant figure. Also I'm unsure about copyright restrictions. The part of the paper in discussion can be easily culled as the figure points to the equations/models used in its construction.
DrBwts
CC BY-SA 4.0
2019-12-12T04:59:05.387Z
I just glanced but do you know where you friend gets that $0.9^{round/2}$ from ?
mark leeds
CC BY-SA 4.0
2019-12-12T12:09:40.487Z
I believe he derives it from model in equation 2. I'll edit the question for clarity of what's been tried.
DrBwts
CC BY-SA 4.0
2019-12-12T16:40:50.270Z
@DrWbts: Thanks for the explanation. I'll try to read the paper and see if I agree with you and your friend.
mark leeds
CC BY-SA 4.0
2019-12-14T16:33:49.037Z
Hi: I don't think the plot is wrong. The author assumes that wealth, $x_t$ can be modelled as  brownian motiion. If the model is : $dx_t=γ dt+σ dW_t$ then the slope of the trend is equal to γ. So, the blue line is $\gamma \times t$. But this assumes that $W_t=0$ $\forall t$ which is why the blue line has a constant slope. I agree though that both lines shouldn't be in the same plot because the red line plot represents something totally different. A lot of what the author says is covered by kelly and thorpe in their idea to maximize growth RATE rather than wealth.
mark leeds
<randomized-experiment>
Question about an ergodicity in economics paper
DrBwts
# Question about an ergodicity in economics paper

(Asked by: username_0 on 2019-12-11)

Disclaimer: I'm not well read in economics but am mathematically literate (PhD in Mech Eng)
Recently I was sent a paper from Nature Physics, "The ergodicity problem in economics" by Ole Peters.
I was discussing this with a friend who also isn't an economist but has more than just a passing interest.
He made the claim that in figure 2 of the paper the graph is wrong i.e. that the expectation values (the blue line) are wrong in that they should be plotting a plot of 0.9^(number of rounds/2), which would have a negative slope. He then goes on to say that this renders the paper garbage.
Now obvioulsy this paper was published in Nature Physics which currently has an impact factor of 22.8 so I find it hard to believe that this would have slipped past peer review.
So my question, is the paper wrong or is my friend?
EDIT #1:
One of the comments was where did the expectaion equation derive from. I'm not sure of my friends derivation but if you run the model proposed in equation 2 of the paper then you do indeed get an ever decreasng return. I used the following Python code to run the model...
from matplotlib import pyplot as plt
import numpy as np

wealth     = 1000
num_tosses = 1000
h_t        = np.random.randint(1, high=1000, size=num_tosses)
x          = []
acc_wealth = []

for idx, toss in enumerate(h_t):
    
    if toss % 2 == 0:
        wealth = wealth + (0.5*wealth)
    else:
        wealth = wealth - (0.4*wealth)
        
    x.append(idx)
    acc_wealth.append(wealth)
         
fig = plt.figure()
plt.plot(x, acc_wealth, "o-", lw = 2)

A typical plot of accumulated wealth v toss number....

This is clearly not what we're seeing in figure 2 of the paper...

Here the blue line is the accumulated wealth (log scale on the y axis) v toss number. It is increasing!!!
EDIT #2
I'm going to post an amended version this on the Statistics Exchange page too.
EDIT #3
Answer from Cross Validated (Statistics Stack Exchange)

**Tags:** randomized-experiment
> **Comments:**
> **username_1**: Could you please try to make the question a little more self contained?  I am not sure if this is possible, perhaps it would require quoting most of the paper.  
> **username_0**: @Giskard which is why I've linked to the paper itself & the relevant figure. Also I'm unsure about copyright restrictions. The part of the paper in discussion can be easily culled as the figure points to the equations/models used in its construction.  
> **username_2**: I just glanced but do you know where you friend gets that $0.9^{round/2}$ from ?  
> **username_0**: I believe he derives it from model in equation 2. I'll edit the question for clarity of what's been tried.  
> **username_2**: @DrWbts: Thanks for the explanation. I'll try to read the paper and see if I agree with you and your friend.  
> **username_2**: Hi: I don't think the plot is wrong. The author assumes that wealth, $x_t$ can be modelled as  brownian motiion. If the model is : $dx_t=γ dt+σ dW_t$ then the slope of the trend is equal to γ. So, the blue line is $\gamma \times t$. But this assumes that $W_t=0$ $\forall t$ which is why the blue line has a constant slope. I agree though that both lines shouldn't be in the same plot because the red line plot represents something totally different. A lot of what the author says is covered by kelly and thorpe in their idea to maximize growth RATE rather than wealth.  

---

## 1 answers

### Answer by username_3 on 2021-02-07. Score: 2

OP's Python code is computing one path in time and is not averaging over the paths. So it is not the value shown in the plot. In fact what the OP's Python code computes is $(1+\Delta x\_H)^h(1-\Delta x\_T)^t$ where $h$ denotes the number of heads and $t$ the number of tails tosses. It is closer to the red line which is the most likely path where $h=t$.

$$\mathbf E[x\_{t+1}|x\_t] = \big[(1+\Delta x\_H)p\_H+(1-\Delta x\_T)p\_L\big]x\_t=(1+p\_H\Delta x\_H-p\_L\Delta x\_T)x\_t=:ex\_t,$$
and
$$\mathbf E[x\_{t+1}|x\_{t-1}]=\mathbf E[\mathbf E[x\_{t+1}|x\_t]|x\_{t-1}]=e^2x\_{t-1}.$$
So $\mathbf E[x\_t|x\_t]=e^tx\_0$ exactly as shown in the paper plot. This can also be derived directly through the generating function of the expected $\frac{x\_t}{x\_0}$ which is, due to the independence of each toss, simply the product of all the dot product of payoff and its associated probability, i.e., $e^t$.


---

