News for hackers. Stuff that matters.
Re:What is ergodicity? (2016) by mturmon on Wednesday June 26, 2019 @11:24AM (#20285894)
The twitter thread gives a nice example of a failure of ergodicity that I was not aware of:

"Now consider a gamble with multiplicative dynamics.

Win 50% of your current wealth for heads, lose 40% of your current wealth for tails.

Changes in wealth now are non-ergodic, so calculating the expectation value is not informative of the time average growth rate of wealth.

This exact gamble has a positive expectation value, but it has a negative time average growth rate. We call it the Peters coin game."

Clearly the expectation of return at a fixed time is > 0, but they give an example time series with obvious negative drift.

Re:What is ergodicity? (2016) by dr_dshiv on Wednesday June 26, 2019 @11:35AM (#20285991)
I'm confused. My takeaway was that dice rolls and coin tosses are ergodic because flipping one coin 20 times or flipping 20 coins is meaningfully equivalent. Whereas following an individual person for 1000 days is different from following 1000 people for 1 day.

Is that not the right heuristic?

Also -- why is it called ergodicity? I keep thinking it has something to do with work or thermodynamics, but I'm missing it...

Re:What is ergodicity? (2016) by ska on Wednesday June 26, 2019 @11:44AM (#20286080)
You are remembering the ergodic hypothesis in thermodynamics, whereI think the name originated and then was generalized.
Re:What is ergodicity? (2016) by dr_dshiv on Wednesday June 26, 2019 @04:00PM (#20288552)
Is there a relationship?
Re:What is ergodicity? (2016) by ska on Wednesday June 26, 2019 @07:16PM (#20290273)
In a sense. Ergodic hypothesis is basically that the phase space is explored "equally" (in a precise sense), over time. Ergodic random processes are pretty much independent of their initial state. So at a hand-wavy level its a very similar idea.
Re:What is ergodicity? (2016) by gowld on Wednesday June 26, 2019 @05:33PM (#20289436)
How does this work?

By binomial theorem, the expectation at time t is ((1.5 + 0.6)^n)/2^n) = 1.05^n so the "annualized" return per unit time is 1.05, exactly the same as the expectation.

What is "time average growth rate"? Web search turns up lots of references do it by Peters, but no definitions.

Re:What is ergodicity? (2016) by yellowstuff on Wednesday June 26, 2019 @05:45PM (#20289531)
You have the wrong model. You're betting a different amount each time. Say you start with $1 and get a heads then a tails:

($1 * 1.5) * .6 = $.90

What if you get a tails then a heads?

($1 * .6) * 1.5 = $.90

Doesn't seem like such a great game now, does it?

The Kelly Criterion sets a limit for how much of your total wealth you should bet when the odds favor you. If you bet more than that limit you increase your odds of losing everything without improving your expected return.

So imagine a better game where you could bet any amount, and you still got paid $5 for every $4 you risked and had a 50% chance of winning. The correct amount to bet is 10% of your bankroll. If you bet more than that in the long run you will go broke.

Re:What is ergodicity? (2016) by gowld on Wednesday June 26, 2019 @07:49PM (#20290492)
You are ignoring half of the possible outcomes. If you get HH or TT, that's $2.25 and 0.36, which averages to $1.25.

50% of ($1.25 + $.90) for a $1 bet seems like a great game to play.

Re:What is ergodicity? (2016) by yellowstuff on Friday June 28, 2019 @12:13PM (#20305840)
This is actually an awesome illustration of why a lot of famous results in academic finance were wrong in the 70s and 80s. Returns don't average, they multiply. If you get HHTT or TTHH you're in terrible shape:

2.25 * .36 = .36 * 2.25 = .81

You started with $1 and now have 81 cents. I recently learned that a lot of early computer-era academic finance actually made the same error of averaging returns, as described in Finding Alpha:

http://falkenblog.blogspot.com/2016/08/finding-alpha-pdf.htm...

Re:What is ergodicity? (2016) by zawerf on Thursday June 27, 2019 @10:32AM (#20294710)
After many rounds, you expect to see half heads and half tails. In that case your outcome at n rounds would be around 1.5^n/2 * 0.6^n/2 = 0.9^n/2 which trends towards zero.

You would need around 26% more heads than tails just break even (0.6*(1.5^1.26)=1). But even if you were lucky at first, you will always "regress toward the means" in terms of head to tails ratio if you kept playing.

Re:What is ergodicity? (2016) by kgwgk on Wednesday June 26, 2019 @06:06PM (#20289723)
> If you bet more than that in the long run you will go broke.

The optimal bet is not the same as the critical bet separating the positive growth and negative growth regions.

Re:What is ergodicity? (2016) by yellowstuff on Thursday June 27, 2019 @04:08PM (#20298142)
You're correct. Betting more than double the Kelly amount results in negative expected growth:

https://wizardofodds.com/gambling/kelly-criterion/

Re:What is ergodicity? (2016) by mjollnir on Wednesday June 26, 2019 @06:48PM (#20290055)
This is assuming additive growth, not multiplicative growth. The expectation is relevant when you have additive growth, but multiplicative growth is the relevant model here because you are increasing by 50% of your wealth vs. decreasing by 40% of your wealth (not adding fixed amounts, e.g., +$0.50 vs. -$0.40). Multiplicative growth also returns 0.95 per unit time, whereas the (irrelevant) expectation value is 1.05 (hence the violation of most people's intuition). Here is some R code demonstrating it:

set.seed(123)

# simulating multiplicative growth

n <- 1e4

init_wealth <- 1

x <- sample(c(0.6, 1.5), n, replace=TRUE)

init_wealth * prod(x)

# analytic model

n1 <- length(x[x==0.6])/n

n2 <- length(x[x==1.5])/n

rate <- (0.6^n1) * (1.5^n2)

init_wealth * (rate^n)

(Edit: formatting, and wording for clarity)

Re:What is ergodicity? (2016) by mr_toad on Thursday June 27, 2019 @06:20AM (#20293132)
>calculating the expectation value is not informative

Well, only if you use a linear estimator, i.e. the arithmetic mean. Any accountant would know to use a geometric mean (the annualised rate of return).

Re:What is ergodicity? (2016) by mturmon on Thursday June 27, 2019 @11:28AM (#20295269)
It is still an interesting example. Following your suggestion, which is a good one, the player's holdings at time N, starting with $1, are:

   H = [1.5 or 0.6] * [1.5 or 0.6] * ... } for N factors
To make it into a more familiar process, take logs:

   log H = log([1.5 or 0.6]) + log([1.5 or 0.6]) + ...
Now we have a familiar random walk with drift, and our intuition is much better-developed for this process. In particular, the mean

  E log H = Sum{1..N} E log([1.5 or 0.6])
          = Sum{1..N} [-0.023]
          = -0.023 N 
          < 0
So the expectation of the log earnings is negative. In fact, because of the drift, sample paths of log H will be unbounded below with probability 1. This nontrivial fact (from the basic theory of random walk) will determine how the process sample paths (even outside the log domain) "look" - they will always eventually squash towards 0. Every single one.

But the expectation of the earnings themselves (as several comments have shown) is > 1. Apparently, without the compression given by the log, the upward excursions given by lucky bets outweigh the unlucky ones.

We can look at this discrepancy ("good game in original units, bad game in log units") the other way. Even though the sample paths eventually go to zero, in that case, you only lose $1. Whereas many other sample paths will make large excursions upward before coming to zero. So the expectation of the non-logged process adds up over many losses of $1, and a few low-probability gains of much more.

Re:What is ergodicity? (2016) by heavenlyblue on Wednesday June 26, 2019 @11:38AM (#20286020)
They're simply calculating expectation incorrectly. Expectation is a probability-weighted sum over every attempt. While the game of 50/40 is based on a probability-weighted product over every attempt.

Basically "average expectation" for that game is 0.95 (and they give a false name to it).

Tl;dr: it's got nothing to do with ergodicity.

More importantly, they quote "Peters coin game" which has no results in Google whatsoever.

Re:What is ergodicity? (2016) by fasteo on Wednesday June 26, 2019 @11:52AM (#20286145)
>>> More importantly, they quote "Peters coin game" which has no results in Google whatsoever.

Maybe a reference to this paper [1] ?

[1] The time resolution of the St. Petersburg paradox, by Ole Peters

https://arxiv.org/pdf/1011.4404.pdf

Re:What is ergodicity? (2016) by monktastic1 on Saturday June 29, 2019 @07:27PM (#20315480)
> they quote "Peters coin game" which has no results in Google whatsoever.

As he says in the Twitter thread anyway, they are coining this name.

Re:What is ergodicity? (2016) by Sahhaese on Wednesday June 26, 2019 @12:14PM (#20286343)
The expectation of a single flip is 'positive' ( > 1 ), the expectation of n flips is 'negative' ( < 1).

My layman reading of this is that this 'appears' to be a violation of martingale theory because this 'should' be a sub-martingale but martingale theory requires finite variance so I suspect the variance of this must go infinite as n tends to infinity?

Re:What is ergodicity? (2016) by kgwgk on Wednesday June 26, 2019 @12:28PM (#20286493)
Why do you say that the expectation of n flips is negative?

For 2 flips there are 4 equiprobable cases with gains +125%, -10%, -10%, -64% and the expectation is 10.25%. The expected gain for n flips is 1.05^n-1

Re:What is ergodicity? (2016) by pfortuny on Wednesday June 26, 2019 @12:41PM (#20286656)
AFAIK (am reading quickly) mean values of COMPOUND interest rates (which is what you are doing) are not useful.

If you earn 10% and then lose 10% you are worse off than before. Start with 10: (11-1.1 < 10).

Re:What is ergodicity? (2016) by yorwba on Wednesday June 26, 2019 @03:10PM (#20288154)
Earning 50% and then losing 40% is equivalent to losing 10%. The naïve calculation you're arguing against would yield a gain of 10%. kgwgk didn't make that mistake.
Re:What is ergodicity? (2016) by kgwgk on Wednesday June 26, 2019 @01:09PM (#20286941)
The definition of expectation is what it is :-)

I agree that expectation may not be the most meaningful number here, in the long run is almost sure that we lose everything but there is a zero probability of infinite gains that makes up for it!

Re:What is ergodicity? (2016) by gowld on Wednesday June 26, 2019 @05:39PM (#20289482)
1.05^n is > 1, with positive finite expectation at every finite time step.

Why do you say almost sure to lose everything?

Re:What is ergodicity? (2016) by kgwgk on Wednesday June 26, 2019 @05:56PM (#20289648)
For any threshold (say $1, assuming you start with $1mn) and any confidence level (say 99%) there is a number of flips n such that you have over 99% probability of holding less than $1 after playing n times. On the other hand, the expected value of your wealth at that time is 1.05^n million dollars.
Re:What is ergodicity? (2016) by mturmon on Thursday June 27, 2019 @03:18PM (#20297627)
This is well-stated.

In fact, an even stronger statement is possible: If you start with $1MM, eventually you will fall below $1 and never go above $1 again no matter how long you keep playing.

And all of that not just on a fraction of sequences, but with probability 1.

Re:What is ergodicity? (2016) by kgwgk on Thursday June 27, 2019 @03:37PM (#20297805)
True, as I said in a previous comment we have “almost sure” convergence to zero (i.e. the sequence will converge to zero with probability one).
Re:What is ergodicity? (2016) by Sahhaese on Thursday June 27, 2019 @03:41AM (#20292447)
You're right, I screwed up the arithmetic making it look like something it's not.

It's just a regular sub-martingale with 'positive' expectation as you say.