09 January 2011

Fun with Artificial Intelligence

I have been having a ball for the past week playing with Eureqa, an AI I mentioned in an earlier post. Eureqa is the brainchild of Profs. Schmidt and Lipson at Cornell. When it comes to data, my main fascination has always been economic data, so I have been toying with trying to find models that best account for why equities markets move in one direction or another. As I said in that previous post, there are far too many irrational factors involved in the movement of equities markets to come up with the S&P 500's answer to E=MC². Even if you managed to come up with a more or less reasonable predictive model, the theoretical economic characteristic of so-called 'perfect knowledge' eventually becomes not-so-theoretical economic reality; people begin operating under this new spotlight; next thing you know, the model is dead precisely because everyone knows about it and therefore behaves in ways not predictable by the model (since this new knowledge and resulting behavior are themselves major new variables).

Quite aside from the fact that eventual knowledge of a good model would itself make the model obsolete, is the fact that there is a HUGE difference between an equation that explains data and an equation that reveals cause and effect for data. Just ask all the people who have wasted good time and money 'data-mining' the history of equities markets. A perfect example is O'Shaughnessy's 'What Works on Wall Street'. The author dug through decades of data on the stock market and came up with elaborate models showing what would have been extremely effective ways of making money....assuming one had the knowledge of the entire period, but had gained that knowledge at the beginning of the period studied. It's amazing to me that an internet search of this man still pulls up almost universally positive, glowing articles and interviews, despite the fact that the mutual funds that he opened in the 1990s, funds entirely built on his 'research', were abject failures. He managed to spin this somehow, get out of mutual funds, and open a private wealth management company. This allowed him to continue making money and claiming he was right all along, but in fact freeing him to use completely unrelated methods of investing (since he isn't required to divulge his techniques). So he is undoubtedly a gifted marketer, and obviously even a good money manager...as long as he isn't following his own advice.

If this is all still (quite understandably) rather abstruse, I'll illustrate with a metaphor. Imagine you stand outside on the street corner and observe the weather and the passing of cars and people. Three out of ten days it rains. On those days, you notice people wearing raincoats. You also notice there are no open convertibles. Data-mining your way to 'good' equations tells you that an absence of convertibles and a presence of raincoats cause it to rain. That's an example of mixing up cause and effect. In another example, imagine that you observe that on the days it rained, you observed ten percent more people named Jane. Aha! An excess of Janes is causing rain! No, this is just coincidence.* I could go on, but for more examples of these kinds of problematic reasoning, there's a far better resource: read Crimes Against Logic by Jamie Whyte. This book is one of my top fifteen all-time favorites, not so much because it taught me anything I didn't already know (though it did that, too), but because he so eloquently and clearly expressed ideas I had known well but that I had been unable to articulate.

However, an inability to find well-performing predictive models for equities markets, doesn't mean that feeding such data in Eureqa is itself useless. By watching how Eureqa treats all the different variables, you start to see how they interact and which ones haven't even a correlative relationship with equities market performance. For example, Eureqa rarely seems to 'care' much for inflation. There appears to be very little correlation. BUT, it does 'care' quite a lot about the Fed Funds rate, which is essentially the public policy reaction to inflation. It also 'likes' CD rates, which might be a decent stand-in for opportunity costs, though that implies some cause-and-effect (CD rates are low -> opportunity cost of foregoing them in favor of equities is low -> I will buy equities -> everyone does same -> equity prices rise)**, which requires a heavier burden of proof, one that I am far from meeting. And employment? Almost always tosses that out as irrelevant very quickly. But it 'loves' consumer confidence, which suggests that while the markets don't 'care'*** about how many people are out of work, they care very much about how confident people feel in the economy (which is presumably in turn driven by how many of them have jobs, though not directly). But again, there is no straight cause-and-effect here. You can't say Consumer Confidence = y ergo stock performance will = z as an exact function of y.

Early days yet, but so far, so fun! After I get bored with this round of experiments, I think I'll move on to GDP.
-----------------------------------------------------------------------------------
Footnotes:

*Don't even get me started on people who say 'I don't believe in coincidences.' Do you have ANY idea what kind of universe we would live in WITHOUT A HUGE LOT OF COINCIDENCES? Randomness permeates the very fabric of existence. The 'problem' is that our human brains have evolved with this incessant need to find patterns. I say this facetiously because of course that very same 'problem' is doubtless one of the very core elements of our intelligence, not to mention a key explanation to our very survival as a species. But it does have the unfortunate side-effect of making us see Jesus in breakfast food far too often.

**This introduces an intriguing interplay itself. Perhaps the opportunity cost (in form of CD rates or T-bills) must reach a certain threshold before prompting consideration of equities, but that consideration is in turn colored by the confidence one has in the markets and the overall economy (as measured by U of M consumer confidence index?), and that interplay in turn drives the degree to which investors commit to equities, thus determining the demand for (and therefore value of) those equities. Add in a dash of price-to-earnings data (i.e., the 'real' cost of 'buying' the earnings behind an equity) and you might just have some soup worth tasting.

***Please forgive the anthropomorphic words here. And if you are a lefty like me, do not fall into the temptation of attributing 'feelings' to markets. That a market does not move in reaction to a tragedy like high unemployment, does NOT mean that the people who make up those markets do not care about unemployed people. The phenomenon is merely an observed outcome of the aggregate behavior of the people acting in the market, not the 'evil' intent of any group of people within the market. I enjoy demonizing Wall St fat-cats as much as the next liberal, but do so for their individual behaviors, not those of the markets in which they act.

No comments:

Post a Comment