## Thursday, January 16, 2014

### Markets that outsmart themselves

I believe financial markets outsmart themselves. I'm not talking about the Efficient Market Hypothesis, but something more meta. This idea probably has a proper name, but I don't know what it is.

Here's the gist of it: There is money to be made predicting financial markets, so people are motivated to predict them. However, once someone acts on a prediction, they alter the market, causing it to become an additional degree more complex. The end result is that the market, which had previously fit a model, no longer fits any model.

Being the geek that I am, of course I have always wanted to simulate this behavior. Tonight I finally sat down and did it.

In my simulation, I have a pool of market actors, each of which has its own algorithm for predicting a market with a single stock. Every day the actors use their models to predict the future price of the stock, and buy and sell shares according to their predictions.

Learning behavior is simulated in two steps. First, random, sporadic mutations occur in the pool of models. If the resulting model is unfit to survive in the market, the other models will naturally eat its lunch. In addition, a certain number of actors are randomly selected to copy the most successful algorithm, so winning algorithms prosper.

Here is a sample of the resulting stock price history. In this case, I had 200 market actors, and the graph shows days 100-200 of a simulation.

Interestingly, while the stock price remains generally in a consistent range, there are periods of irrational exuberance, including a five-day period in which the stock price leaps to 1000, then returns to normal.

In the lead-up to the period of irrational exuberance, the winning algorithms grew progressively simpler, going from six-term polynomials down to a single-term polynomial. If this were to occur in the real world, it would be something like a single wealthy individual getting a crazy idea, and everyone following suit until the market crashes.

Note that I don't assume the stock has any kind of real value here. My market actors are trying to outguess each other. Each actor in the market is trying to predict
how the aggregate of actors in the market will predict
how the aggregate of actors in the market will predict
how the aggregate of actors in the market will predict
...
how the market will behave.