Sunday, January 24, 2010

Cycles of Explanation in Economics

In areas of science such as physics and biology our successive theories developed over time are better and better explanations of the observed facts. Think heliocentrism versus geocentrism, or natural selection versus Lamarckism. But in economics I suspect this is not always the case. Traumatic events like the Great Depression, or (hopefully) the current crisis can force a brief period of clarity. But over time economic forces will result in the mainstream replacement of the theory which most closely matches the observed facts of the previous crisis with a theory which maximizes short term profits for powerful actors. The time-frame over which this shift occurs is probably a generation, in which those with first-hand memories of the previous crisis leave power.

Here are two exhibits for my point. The first is a quote I have been re-sending for years:

"When business in the United States underwent a mild contraction in 1927, the Federal Reserve created more paper reserves in the hope of forestalling any possible bank reserve shortage. More disastrous, however, was the Federal Reserve's attempt to assist Great Britain who had been losing gold to us because the Bank of England refused to allow interest rates to rise when market forces dictated (it was politically unpalatable). The reasoning of the authorities involved was as follows: if the Federal Reserve pumped excessive paper reserves into American banks, interest rates in the United States would fall to a level comparable with those in Great Britain; this would act to stop Britain's gold loss and avoid the political embarrassment of having to raise interest rates.

The "Fed" succeeded; it stopped the gold loss, but it nearly destroyed the economies of the world in the process. The excess credit which the Fed pumped into the economy spilled over into the stock market -- triggering a fantastic speculative boom. Belatedly, Federal Reserve officials attempted to sop up the excess reserves and finally succeeded in braking the boom. But it was too late: by 1929 the speculative imbalances had become so overwhelming that the attempt precipitated a sharp retrenching and a consequent demoralizing of business confidence. As a result, the American economy collapsed. Great Britain fared even worse, and rather than absorb the full consequences of her previous folly, she abandoned the gold standard completely in 1931, tearing asunder what remained of the fabric of confidence and inducing a world-wide series of bank failures. The world economies plunged into the Great Depression of the 1930's."


Gold and Economic Freedom, Alan Greenspan, 1967.

Here the Greenspan of 1967 believed holding Fed rates too low caused a bubble that could not be cleaned up afterwards. But the Greenspan of the late 1990s and again early 2000s no longer believed low rates caused bubbles, or that a bubble could be too large for the Fed to clean up afterwards. Why the shift? I think the earlier theory fits the facts of the 1920-30s (and our current situation now) better. But note his successor Ben Bernanke still denies low rates cause bubbles.

A second exhibit is the presentation I wrote in 2006 and posted as Black Swans in the Market in 2008. I showed that any Statistics 101 student could easily demonstrate that daily stock prices changes are not normally distributed. This makes people like the CFO of Goldman Sachs, who claimed in 2007 "We were seeing things that were 25-standard-deviation events, several days in a row" look extra-silly. Why were they using such bad models? Is finance in general so ignorant of basic statistics[*]? No, they are simply choosing models which maximize their short-term profits -- and bonuses.

[*] OTOH, a Google Books search on "which shows a histogram of the daily returns on Microsoft stock" shows that as of 2005 Brealey et. al. were still peddling this nonsense to unsuspecting MBA students in their Principles of Corporate Finance and related texts. A 2005 edition apparently shifted the MSFT date range from 1986-97 to 1990-2001 (omitting the crash of 1987!). Later editions don't hit on the search terms; no idea if they have cleaned up their act.

Sunday, January 3, 2010

Multi-Core Ant Colony Optimization for TSP in Go

Go is a new statically typed, garbage collected, concurrent programming language. It is native compiled and offers near-C performance. Like Erlang it uses a CSP model of lightweight processes ("goroutines") communicating via message passing. Messages can be synchronous (unbuffered) or asynchronous. Go supports multi-core processors.

On my usual ACO TSP test case Go is the best performing language so far. On a single core it was 2.8x slower than C, beating the previous best Shedskin Python. Go's speedup from 1 to 2 cores was 1.9, matching previous best Erlang. With 4 cores Go exceeds C's single core performance -- the first tested language to achieve this goal.



Go's lightweight processes are scheduled onto OS threads by the Go runtime system. This allows the system to support many more processes. I was able to run ACO TSP with 100,000 ant processes. The runtime system scheduler appears to treat these processes somewhat like futures, lazily scheduling them when another process is blocking on receipt of a message from a shared channel. This is inefficient for the type of parallel processing used in ACO (many seconds of parallel computation ending with a single message send), as only a single process (and thus a single core) is active at a time. This is a known issue, and the simple solution suggested on the golang-nuts mailing list is to add runtime.Gosched() calls to yield the processor. For my case this was insufficient, and adding additional heartbeat messages to each process helped force maximal multi-core usage.

See here for code and more details.

Sunday, December 20, 2009

Science Fiction Physics, and Biology

The January 2010 Scientific American article "Looking for Life in the Multiverse" analyzes how much the laws of physics might differ while some form of life is still possible. It specifically shows that carbon-based life is still possible when the weak nuclear force is eliminated. The authors are less supportive of non-carbon-based life popular in science fiction, and still find support for the anthropic principle ("conditions that are observed in the universe must allow the observer to exist") in the precise value required for the cosmological constant.

Also, in an earlier post I claimed that all life on earth is dependent on the sun for energy. This is incorrect. The black smoker sea vents on the ocean floor support complete ecosystems including archaea, clams, and tubeworms. Here the energy comes from the interior of the earth instead of the sun.

Monday, December 14, 2009

Science Fiction Morality

In an earlier post I questioned the existence of atheist essentialist philosophers. I had been looking in the area of Philosophy of Science. Turns out a better place to look is Moral Philosophy. Moral Philosophy presents a moral spectrum, from Moral Nihilism (nothing is moral or immoral), to Moral Relativism (morals are relative to individual, social, cultural, or historic circumstances), to Moral Universalism (applies to "all similarly situated individuals") to Moral Realism (moral statements can be objectively true, and subject to rules of logic). In Moral Realism moral rules are similar to Platonic Forms or Ideals. Moral Realism is often grounded in religion, but is also supported by some atheist philosophers (example: Quentin Smith).

The boundaries between the positions are often fuzzy, with various proponents subtly repositioning other prominent philosophers. A historical stumbling block has been determining how a Universal Morality can be possible without recourse to a deity (and this is the basis of the "argument from morality", a proof of God's existence). More recently, based on research in Evolutionary Psychology, Steven Pinker wrote a great essay on how a human moral sense or instinct may have evolved. He presents many rules which are specific to the evolved nature of humans, and some which may be more universal. He says:

"Two features of reality point any rational, self-preserving social agent in a moral direction. And they could provide a benchmark for determining when the judgments of our moral sense are aligned with morality itself... One is the prevalence of nonzero-sum games. In many arenas of life, two parties are objectively better off if they both act in a nonselfish way than if each of them acts selfishly... The other external support for morality is a feature of rationality itself: that it cannot depend on the egocentric vantage point of the reasoner..."

It is interesting to consider how many rules the Moral Realist propose are universal, versus specific to the evolved nature of humans. I wonder how much science fiction Moral Realists read. A common theme in science fiction is the presentation of different alien races, and the different moral imperatives which naturally arise from their different evolutionary heritage. Examples are the K'kree (herbivores) and Hivers (one sex) from Traveller. And aside from other planets, we can similarly consider how morals would differ if radically different earth species (sharks? praying mantis? naked mole rats?) had evolved sentience. The Moral Realists imply that all creatures, regardless of evolutionary heritage, will always converge on the same universal morality (or that creatures which are unable to meet the standard can't achieve sentience). This may be a realistic assumption for a few of the meta-universals proposed by Pinker, but I don't think it applies to the much larger set of rules proposed by the Moral Realists. And without this universality the attempt to use rules of logic falls apart.

Sunday, December 6, 2009

The Fish Balance of Hobbiton

Like everyone else I've been trying to make sense of the arguments between the Keynesians, Austrians, etc. over the financial crisis. Lately I've been trying to puzzle out the National Financial Balance Accounting Identity:

Household FB + Business FB + Government FB + Foreign FB = 0

Described here. The importance of this equation is its use in justifying government deficits:

"We’ve said it before and we’ll say it again. As a matter of national accounting, the domestic private sector cannot increase savings unless and until foreign or government sectors increase deficits. Call this the tyranny of double entry bookkeeping: the government’s deficit equals by identity the non-government’s surplus." Marshall Auerback

From the first linked article, some definitions:

Financial Balance FB = income - expenditures, or saving - investment
income = profits + wages = P + W
spending = investment + consumption = I + C
normally (when FB=0) total income = total spending, so P +W = I + C

In discussing households we simplify by assuming no profits, so P=0

savings = W - C
FB = (W - C) - I

The author of the first linked article criticized an earlier author who claimed it was possible for all sectors Financial Balance to be simultaneously positive, so the Accounting Identity would not have to sum to zero. He claimed this would only be true in a primitive barter-based "Hobbit Shire".

Let's build one. Assume our world economy only consists of Hobbit households. No businesses, no government, no foreigners, no money, no outside investment. One primary resource: deep sea fish. Household "Wages" are the daily catch of fish. "Consumption" is eating fish. "Savings" is storing fish in the snow (Eskimo Hobbits :-) for later. So in good times (summer?) the net FB "Fish Balance" of all the Hobbit households is positive, while in bad times (winter?) the FB can be negative. This doesn't match the original Accounting Identity, but we can make it sum to zero by adding a new often-negative "Natural Resources" term to the equation.

Hobbit Household FB + Natural Resource FB = 0

This forms an interesting analogy to arguments against evolution based on the Second Law of Thermodynamics. Life on earth is not a closed system. It depends on a constant supply of energy from an outside source -- the sun. Life on earth is also dependent on heavier elements produced in prior supernovas. Similarly human economics is dependent on many raw material inputs which are not initially generated by (or often even owned by) humans. For the above Hobbit example I chose deep sea fish as a renewable resource owned by no-one. Other renewable resources include timber, food crops, textile crops, livestock, etc. Non-renewable resources include oil and minerals. Think AH Civilization or Settlers of Catan. And note these raw materials also ultimately come from the sun or supernovas.

This introduces the question of why the real Accounting Identity doesn't include a Natural Resources term. Obviously the real one is about money, not about resources. But if gathering natural resources creates value within the system, shouldn't it be represented? It is also not clear how many other aspects of value creation (such as a household purchasing an income-generating asset, rather than investing in the business sector) are represented.

This also brings up how new money is injected into the system. If the currency were gold-backed, money would be a resource. But a fiat currency is created by central banks. I assume the government deficit spending advocated in the quote above is fiscal spending, and the Government FB is budgetary spending. Alternately could they be advocating monetary stimulus, and the Government FB is that of the Federal Reserve? Does inflation matter in the equation, or is it irrelevant?

I think some of these questions are at the heart of the debates between the Keynesians and the Austrians. The Austrians focus on productive versus wasteful uses of resources, like my Hobbiton Fish Balance (to the extent they recognize the Financial Balance version they see it as an argument for returning to the resource-based gold standard). The Austrians claim recessons are caused by misallocation of resources. Keynesians are more focused on the flow (especially velocity) of money inside the Financial Balance Accounting Identity. Some claim our current problems are due to government not carrying out its proper role: running deficits.

Saturday, October 31, 2009

What's really wrong with Ayn Rand

Ayn Rand was the author of the novels The Fountainhead and Atlas Shrugged and the founder of the philosophy of Objectivism. Recently several humorous articles have made fun of adolescent enthusiasm for Rand, and pointed out the real dangers of retaining this enthusiasm into adulthood [see Alan Greenspan]. But critics often miss the fundamental flaw in Objectivism: the attempt to combine essentialism with atheism. Rand claimed her favorite philosophers were Aristotle and Saint Thomas Aquinas, both of whom placed God at the core of their essentialist philosophies. Rand also wanted to be an essentialist, to help her derive axiomatic proofs of her absolutist moral and economic theories. Essentialism (and the related ideas of universals and Platonic forms) was strongly criticized by more recent scientifically-minded philosophers such as Hume, Popper, and Quine. Rand has never gotten much respect in academic philosophy, and I am unable to find an academically respected philosopher who is both an atheist and an essentialist. I suspect the combination just doesn't work.

As implied in the linked articles, this combination of essentialism and atheism is probably also key to Rand's appeal to a very specific type of adolescent: one who has recently left their absolutist religious faith behind.

Tuesday, October 6, 2009

Dawkins on Essentialism

For the mind encased in Platonic blinkers, a rabbit is a rabbit is a rabbit. To suggest that rabbitkind constitutes a kind of shifting cloud of statistical averages, or that today's typical rabbit might be different from the typical rabbit of a million years ago or the typical rabbit of a million years hence, seems to violate an internal taboo. Indeed, psychologists studying the development of language tell us that children are natural essentialists. Maybe they have to be if they are to remain sane while their developing minds divide things into discrete categories each entitled to a unique noun. It is no wonder that Adam's first task, in the Genesis myth, was to give all the animals names.

And it is no wonder, in Mayr's view, that we humans had to wait for our Darwin until well into the nineteenth century. To dramatize how very anti-essentialist evolution is, consider the following. On the 'population-thinking' evolutionary view, every animal is linked to every other animal, say rabbit to leopard, by a chain of intermediates, each so similar to the next that every link could in principle mate with its neighbors in the chain and produce fertile offspring. You can't violate the essentialist taboo more comprehensively than that. And this is not some vague thought experiment confined to the imagination. On the evolutionary view, there really is a series of intermediate animals connecting a rabbit to a leopard, every one of whom lived and breathed, every one of whom would have been placed in exactly the same species as its immediate neighbors on either side in the long, sliding continuum. Indeed, every one of the series was the child of its neighbor on one side and the parent of its neighbor on the other...


Richard Dawkins, The Greatest Show on Earth: The Evidence for Evolution, p. 23-24.