Showing posts with label games. Show all posts
Showing posts with label games. Show all posts

Thursday, September 13, 2018

Simulating basic economies


[Hayek 1961]: "[economics] has become too ambitious by applying standards of rigorousness ... to the empirical science of economics where there are definite limits to what we can positively now; that we shall see more clearly what economics can do if we separate that logical groundwork – the economic calculus as I have called it – from its use in the empirical science of economics; and that, though this science is of great help in all-important issues of the choice of an economic order and of the general principles of economic policy, its power of specific prediction is inevitably limited – limited by the practical impossibility of ascertaining all the data – those very data whose utilization in the allocation of resources is the great merit of the market system"

[Jaffé]: agent-based simulations, allow us to explore complex economic phenomena.

It seems that python mesa could be a very interesting tool to explore economic interactions.


Sunday, January 8, 2017

On the relevance of the probability distribution.

Some time ago, I had already presented some results on simple games. Now, a friend of mine has started to trade and I want to help him understand something.

Imagine you have a game where you bet 100 and can get either 110 or 90 with 50% probability. 

Suppose you play this game 200 times and in each game you bet a fraction f (0<f<1) of your whole equity. What happens to your equity after 200 games?

The simple answer is: you get the initial equity because you win 10 or lose 10 with equal probability. But a more detailed answer is given in the next figure, which shows a simulation of 100k experiments:

As there are probabilities involved, we only can get statistical results. The green line depicts the mean value of the equity, which is 100 irrespective on the fraction that you bet. But the shades of blue also indicate the distribution! They are chosen so that the light blue area represents 90% of the population and so on, as given in the legend. The blue line represents the median: the separation between the top 50% and the bottom 50%. (The frontiers between shades of blue are the percentiles 95, 87.5, 75, 62.5, 50, 37.5, 25, 12.5 and 5)

So, the interesting thing is that even if the mean is 100, in 75% of the experiments your final equity is less than the initial one if you bet your full equity (f=1). If you bet 40% of your equity (f=0.4) you are under the mean only in 62.5% of the cases.

So, be careful with the probability distribution of your equity. The mean may look important, but is meaningless in these long tailed cases!