Thursday, March 17, 2005

Can we predict the market?

According to some economists, it is futile to try to predict what the stock market is going to do because markets are too efficient for any prediction to work. The argument goes like this: Markets are efficient. --> All information, facts, rumors, and expectations about a particular stock, an industry, and about the market in general, are already accounted for in the price. --> Any change in information is instantaneously reflected in the stock price. --> Any change in information has equal probability of affecting the stock positively or negatively, if this weren't the case, arbitrageurs could make money buying the stock if the probability was biased toward the positive, or shorting the stock if the probability was biased toward the negative, and their actions would make the stock move into a probability neutral position. --> Stock prices should only be modeled as a Markovian Random Walk, as Brownian Motion, or any other model that is purely random. --> Since one cannot predict randomness, trying to predict the market is as foolish as trying to predict the sequence of heads/tails produced by repeatedly flipping an unbiased coin.

On its face, the argument sounds convincing (I confess that my training in economics had me convinced of it for a long time), but there is a big problem with the argument. If markets are so efficient, the information that they are efficient should be embedded in them. In particular, markets should account for the fact that it is futile to try to predict them, and the value of trying to predict the market should be zero, or negative, because money would be wasted unnecessarily in a futile endeavors.

However, the fact is that Wall Street analysts, traders, and fund managers are very well compensated for their attempts at market prediction. This fact flies on the face of the argument above, whether markets are efficient or not. If markets are efficient, then the knowledge embedded on them seems to indicate that they in fact can be predicted. Therefore, we should trust that information and conclude that in fact they are predictable. If the above argument is right and markets cannot be predicted, the fact that those who make a living predicting them get compensated so well is a persistent market inefficiency. The observation of a market inefficiency shows that markets are not necessarily efficient. This calls into question the efficient market assumption on which the unpredictability argument rests, therefore, it calls into question the whole argument. If the argument is wrong, then we have no reason to believe that markets are inherently unpredictable. Thus, whether markets are efficient or inefficient, the argument against predictability is wrong.

One would expect that if markets were predictable we would have a good model by now on how the market works, given that it is a question that so many people want to answer. However, I think that the words of a former professor of mine describe best why we don't have any models of the market. I remember he said to me, "This is the reason why I don't trust published research on market prediction. If I tried to predict the market and failed, I would publish a paper. If I got some results that showed promise, I would turn it into a product and sell it. If I got good results, I would sell my services as an advisor or money manager, but I would not tell people how I do it. However, if I got really good results, I would not tell anybody and I would invest my own money". So there might be people out there that already figured out how to predict the market, they are just not telling anybody.

Friday, March 11, 2005

Scientific Knowledge is NP

When analyzing algorithms, problems are classified by how complex the best known algorithm to solve a particular problem is. The complexity of an algorithm is a formula of the problem size. For example, if a sorting algorithm takes 1 second to sort 1 million entries, 4 seconds to sort 2 million entries, 9 seconds to sort 3 million entries, etc. we can see that the time the algorithm takes to solve the problem depends on the square of the number of entries. This algorithm is said to have a complexity of n squared. As long as the problem can be solved with an algorithm that has a complexity which is a polynomial of n, the problem is considered easy (tractable in complexity lingo) and it said to be a P problem, which stands for polynomial. There are problems for which the best algorithm we know is worse than any polynomial (for example exponential), but which can be verified in polynomial time. These problems are said to be NP, which stands for non-deterministic polynomial.

The cool thing about NP problems is that while they are hard to solve, it is easy to check whether a tentative solution is an actual solution to the problem. Factoring a very large number, for example, is very hard, but given the factors it is easy to verify if they produce the number when multiplied.

I was thinking about how knowledge about nature is very hard to obtain but easy to verify, just like an NP problem. It took the kind of genius that exists once in a century to discover gravitation, but given that Newton discovered it, it is very easy for everybody else to understand it when we read it from our physics books. The idea of natural selection seems so obvious that one sometimes wonders if people before Darwin were just stupid, but again coming up with the idea was the hard part, whereas understanding it is easy.

Now, where my analogy gets interesting is relating it to NP complete problems. By definition of NP complete, any NP problem can be transformed into an NP complete problem in polynomial time. So if we were to find a solution for an NP complete problem in polynomial time, that would mean that P=NP. This is because all NP problems can be transformed to the NP complete problem in polynomial time, and the problem would be solvable in polynomial time also. After this, the only hard problem would be how to protect our secrets, since our current encryption schemes are based on the assumption that NP problems are hard to solve.

In science, people sometimes reason by analogy, transforming a new problem into an old problem that they know how to solve. For example, physics and accounting share the same conservation principle, in fact physics could be described as energy accounting. The no free lunch (no arbitrage) principle in economics uses the same kind of argument as the no perpetual motion principle in physics. So the transformations between one kind of problem and another are similar to the polynomial transformations between two NP problems. The thing that I am wondering is whether there is a set of NP complete problems in the world, that if we solve them we can then solve all problems that come our way? Would that be how a unified theory of everything would look like? I would think that a unified theory of everything, in order to be useful, would have to have polynomial transformations from any problem we encounter into it. We already know some members of the NP complete set in mathematics, now it is time to find them in physics.

Wednesday, March 09, 2005

Seattle

I was in Seattle this weekend, and I can see why the richest man in the world chose to live there! The first thing that I noticed is how beautiful the area is. The grass is green, the streets are clean, there are no bums on the streets, and even though I looked hard, I was not able to find the bad part of town. The town itself is very similar to San Francisco, but without the bums, and the inflated real estate prices. In fact, real estate was comparable to Denver. To buy a 3/2 house in Medina (the area where Bill Gates lives) is about 400K, and to rent a waterfront apartment by pike's market is $675 a month. Another good thing about Seattle is that Washington has no income tax. Of course, they have to make up the revenue from somewhere, but almost anything is better than income taxes. Another very good thing about Seattle is that you can buy liquor on Sundays, which means that the laws there were created by more rational people than those in Colorado. An interesting fact about Seattle is that it is a man-made peninsula, at least in its present form. The original land was very close to sea level, so the first settlers had problems with drainage, among other things, so after the city burned down they decided to add land to the streets and raise the level up to where it is today. The result? There is a town under the town, which is one of the main tourist attractions.

Monday, March 07, 2005

Blogspot or livejournal?

I've been posting in livejournal all this time, but it seems that blogspot is where more "serious" people come and post, being such a serious individual myself, I figured I'd start posting here.