Friday, July 24, 2009

The Federal Government Should Not Fund Research

The growth rate of the Chinese economy is astounding: something like 9 % per year. This compares to a growth of more like 2 % in industrialized Western countries. What, if anything, are we doing wrong?

Terence Kealey's The Economic Laws of Scientific Research analyzes how government involvement affects scientific research. This topic is of immense importance: science in the United States is in great part done by academic scientists, who must take time out of research and advising the junior scientists in their care, to write grant proposals. These proposals are usually submitted to the National Institutes of Health or the National Science Foundation, but sometimes the Department of Energy or the Department of Defense and other agencies. The proposals are judged by a panel of scientists (taking time out of their research and advising) to be worthy or not of funding; some of the worthy proposals are funded. Thus the submitting scientist can fund further research by purchasing equipment, recruiting graduate students, and hiring research scientists.

Kealey claims that this model is the philosophical descendant of Baconism, where the flow of government money fuels basic research, which then fuels applied science, which then generates technological innovation that makes everyone wealthier and our lives better. He points out that the Baconian idea is not the only possible model; in fact, another possibility is that the free market can drive scientific research. In this model, companies and individuals see possible profit in applied science; for instance, if some innovation can make the company more efficient, then the company can make more money. At times, learning the applied science requires funding basic research, so capitalists will fund that as well.

As a good scientist should, Kealey proposes these two models, in the form of two hypotheses: which system is better at producing innovation, and thus creating wealth? He then examines the available evidence to decide between the two hypotheses. There are several issues implicit in this test, however.
  1. Usually, in science, when we want to test between two alternatives, we need to do an experiment. In the case of deciding between government-funded and industry-funded science, the experiment would be setting up two countries which are the same in all ways, except the way that science is funded. Since this is impossible, we are left with historical evidence only: the data available is the progress of science in the past couple of centuries. This might seem like a drawback, but geologists do this kind of thing all the time! (In a few days, I'll be posting a description of how evidence--derived from experiments or from historical sources--is rationally used to test hypotheses.)
  2. The evidence available is usually only economical. The easiest things to look at are correlations between how much government funds science (in total dollars or as a fraction of total funding), and things like wealth and economic growth (for example, gross domestic product per capita). We really want to know which system is makes peoples' lives better, but "better" is subjective. I'll get back to this point further along.
  3. "Government funding" and "industrial funding" may not be the only possibilities. For instance, wealthy people might give money to scientists for the fun of it, or because they might find the results interesting. For instance, Mary Herbert (nee Sidney) did this kind of thing. But since government and industry are the biggest, it's a good approximation that there are only two possibilities.
However, in examining historical economic evidence, Kealey finds several trends that he describes as the economic laws of scientific research:
  1. "[T]he percentage of national GDP spend on science increases with national GDP per capita" (italics original) regardless of the source of funding, government or industry.
  2. "[P]ublic and private funds displace each other." This means that if the government increases money spent on research, then industry will decrease its spending.
  3. "[P]ublic and private displacements are not equal: public funds displace more than they do themselves provide."
Number 3 is the kicker. Kealey has found evidence that the more government spends on science, the disproportionately less that industry spends on it. Taken to its logical conclusion, if government spend nothing on science then industry would spend the maximum amount it ever would on research--after all, it's how they're going to make more money! And it would mean more money for scientists, too. Furthermore, since individuals and industry are taxed so that the government can fund science, taxes would be lower, meaning more immediate wealth, and, for industry, the ability to hire more people.

There is actually an analogy to welfare that makes me extremely angry. Some people (possibly my hero, Walter E. Williams) believe that a rule like Kealey's #3 happens with welfare. This would read: the more that government spends on welfare, the disproportionally less that individuals spend on it. You can believe that supporting government-sponsored social programs helps poor people, but I doubt it would help as much as helping them your own damn self.

Now, Kealey has assumed that wealth is a measure of scientific success, but there may be other reasons beyond wealth for doing science that justify government intervention. Like, science is cool, it can be fun, it can teach kids to think critically in school. It can generate culture by allowing cultural achievements (perhaps, maybe, possibly NASA is a good example, but doesn't it really seem more like comparing penis size with the Soviets?). The government may have better control over things like environmental policy. However, as Kealey argues, economic arguments cannot support government funding of science. Libertarian philosophy would go further, saying that government funding should not be involved in culture or environmental policy, and what's more actually diminishes the ability of individuals (who are really what make up culture) to contribute to these kinds of achievements.

Oh, and China? Kealey figured that one out, too, although his book was published (1996) before the Chinese economy achieved those huge growth rates. The explanation is the same one that includes the observation of the "slow" growth of first the British economy, then the US economy, starting in the 19th century. These were the economic and scientific powerhouses. Their scientists were doing basic (industry-sponsored) research. When you have to invent brand new things, of course your economy will grow slowly, compared to those that can copy your old innovations! This explains the fast growth of French, Swedish and Japanesse economies in the middle of the 20th century, until they saturated at the same old "slow" growth rate of 2 %, the same as the British and American economies. Kealey: "the countries that emerge into capitalism late enjoy higher rates of growth than do the pioneers [Britain and the United States]," until they saturate at the natural growth rates of innovative countries.

So it's not that Western countries are doing something wrong, it's that China is doing something right: copying, and adopting more free market approaches to technology. If they continue this trend, and peel away the central planning, then the Chinese will benefit, as will the rest of the world. Go China!

Sunday, July 19, 2009

What is Temperature? The Zeroth Law of Thermodynamics

Physical chemistry can be complicated and hard to understand. Fully grasping canonical partition functions, Gibbs samplers, or quantum mechanical anharmonic oscillators, can take years. These are very detailed, interesting subjects, but their direct application to the understanding of all, my ultimate goal for Free Range Science, can unfortunately be extremely difficult.

However, reaching back into the 19th century, chemists and physicists developed a set of theories for understanding some aspects of the everyday: thermodynamics. From a 21st-century perspective, the early thermodynamicists seemed obsessed with steam engines--understandably, because most of scientific progress reflects the desire to improve the technological innovations of the day. But what they leared about engines, which are devices that turn heat flow into work, has consequences for a myriad of seemingly different topics. Today, we use thermodynamics less to understand engines, and more to understand modern issues such as how tightly a drug molecule binds to a protein molecule, how much light energy is required to drive a photocatalyst, and a myriad of other issues. (Although these days the discussion focuses more upon the microscopic manifestation of thermodynamics, called statistical mechanics.)

Thermodynamics deals with everyday objects as well as extraordinary ones, and it can answer a question that has to do with almost everything there is: what is temperature?

Everyone is familiar with the use of a thermometer to test the temperature of an object. Simply, the thermometer is placed in suitable contact with the object, then we wait a while, and after some time the thermometer registers what we call the "temperature" of the object.

In order to understand what measuring a temperature really means, we will make an analogy. At a very deep level, the analogy is exact, since the way we understand, mathematically, what happens when we try to measure temperature with a thermometer exactly the same way we understand the process I'm about to introduce: the stretching of rubber bands.

Imagine two rubber bands hooked, each hooked over its own nail. Both nails are pounded partway into a board. Then we stretch the rubber bands until they meet, and we tie them together or to some connector.

We should be careful to state some conditions that we think might matter in the situation at hand, since if they don't hold the analogy fails. Let's assume that the rubber bands are strong enough so they won't break, we've attached the ends together so that they won't slip apart, and that the nails are firmly implanted in the board. If there is breakage or slippage then the way we understand this situation will be much less helpful to our ultimate goal, to make an analogy to temperature and heat flow.

The next imporant concept is of equilibrium, the state in which nothing changes. In the rubber band situation, this is called mechanical equilibrium, where all of the forces balance out. Because they're stretched out and tied to one another, the rubber bands exert forces on one another. In the situation where the knot is not moving, the system is at mechanical equilibrium; each rubber band pulls on the other one, but the force each rubber band exerts on the other is the same.

If the forces didn't balance out, such as the situation where we pull the knot towards one nail or the other and let it go, then there would be motion. If we let the motion of the system evolve, then eventually it would find the state of mechanical equilibrium. While not in equilibrium, one rubber band is pulling harder than the other one. This leads to motion in the form of the overstretched band shrinking some, whereas the understretched rubber band extends a little. Since the distance between the nails is fixed, this can be described as the rubber bands exchanging lengths with one another: if the length of one rubber band decreases by 1 cm, then the length of the other increases by 1 cm.

It should be obvious that the exchange of length doesn't necessarily occur until both rubber bands are the same length; what if one were just shorter than the other? On the contrary, the exchange of length occurs until the forces balance out--until mechanical equilibrium is reached.

A similar process occurs when we bring a thermometer into contact with an object--a little kid, the outside air, or a pot of boiling sugar--in order to say something about its temperature.

Temperature is like the forces in the rubber band situation: something will be exchanged between two objects of different temperatures just as length will be exchanged between two rubber bands. This "something" will be exchanged until the temperatures of the two objects are the same, just as in the rubber band case length is exchanged until the forces are equal. Once the exchange is complete, for temperatures, the objects will have reached thermal equilibrium. The thing exchanged is often called "entropy," but it is useful to think of probability being exchanged instead. Probability and entropy are deeply related, but probability is much simpler to understand, physical scientist or not.

The probabilities in question are those for the different possible arrangements of particles and energy in the two objects. There are huge numbers of states for particles to arrange themselves in. A good analogy is a bag of rice; there are thousands of rice grains, and each one can be oriented in any direction. The rice grains also "interact" with each other; since they're solid, they can't overlap, which limits the number of orientations of any rice grain, much like microscopic particles in a very dense system. Opening a bag of rice reveals one of the possible states that the system can be in. Not all arrangements of rice grains are equally probable: for instance, a jumbled-up arrangement is much more likely than an arrangement where all of the rice grains are pointing in the same direction.

The analogy of probability flowing to the exchange of length in the rubber band situation is even deeper. Like the total length of the rubber bands, which is a constant, the probability has a fixed total value for two objects brought into contact--it has to add up to 1, or 100 %. Each of the possible arrangements of particles and energy in each system has some probability; the probability that the particles and energy are arranged in some way is 1. How the probability is partitioned among all of the immense number of arrangements--how some states are more probable than others--depends upon the details of how the particles interact, which can get very complicated, and upon the temperature.

When two objects at two different temperatures are not in contact, they tend to spontaneously arrange the matter and energy that constitute them into the most probable ways. This spontaneous arrangement is summarized by the Second Law of Thermodynamics, which says that entropy cannot decrease in an isolated object, but it really just means, quite trivially, that one is more likely to find matter and energy arranged in probable ways than in improbable ways.

However, when two objects of different temperatures, themselves having attained their most probable arrangements, are brought into contact, the two objects considered together are no longer in a probable arrangement, even though they were in their most probable states before being brought into contact. There is more energy per particle in the hotter object than in the colder object, so the particles of the hotter object will tend to transfer their energy to the particles of the colder object. (This happens because the objects are in contact, so it happens where the objects are in contact. Surface area matters--the energy transfer will be faster if the contact surface is larger.) As the two objects exchange energy, the arrangement spontaneously evolves until it's in a more probable state. In consequence, the originally hotter object assumes a less probable state, from its point of view, in order that the originally cooler object can assume, from its point of view, a more probable state. This is all done in such a way that, considering the probabilities of different arrangements of both objects together, the ultimate arrangement--both objects the same temperature--is more probable than the initial state with different temperatures.

So temperature is the force that causes probability to flow, until thermal equilibrium is reached, when the temperature-forces balance. But this really only explains thermal equilibrium, rather than temperature. To finally understand temperature, however, we consider what is called the Zeroth Law of thermodynamics, which states that if object A is in thermal equilibrium with object B, and that C is in thermal equilibrium with B, then A and C are also in thermal equilibrium with each other. This might sound trivially silly, almost as silly as calling something "zeroth," but the reason for the law was one of logical consistency; thermodynamicists realized that the mathematical structure of thermodynamic theory, already well-developed, required an assumption that is logically prior to the other three laws in order to make the theory more consistent. This is also why it's called the "zeroth" law: the first, second, and third laws had already been invented.

(We have now seen the zeroth, first, and second laws of thermodynamics. The third law is not very interesting.)

We call an object like object B, above, a thermometer. We can look at the behavior of the thermometer as it interacts with objects of different temperature, and use our results to define a numerical scale. Put into contact with A, until thermal equilibrium is reached, we obtain a numerical value of the temperature of A. If we repeat with object C and we find that the numerical value of the temperature is the same, then we say A and C are the same temperature (obvious, right?), without actually having to put them into contact to see if any heat flows. This is effectively a prediction that if we put A and C into contact, that no heat would be exchanged--they would already be in their most probable states, without having to exchange any probability.

Wednesday, July 15, 2009

Accepted paper: Bayesian single-exponential rates

Happy news for me today: a (very, very long) paper of mine was accepted for publication today in the Journal of Physical Chemistry B. The impact on science is small, even as important as I think the topic is, but the impact on my career could be huge.

The paper describes a method for estimating the rate of some process essentially by counting the number of times the process occurs. The analogy I like to use is of a road: one plants by the side of the road (lawn chair and cooler are mandatory, just as for those computing rates in molecular simulation) and counts the number of cars that pass in some time period. One estimate of the rate is to take the number of cars that pass and divide by the time period. For instance, if the number of cars was 120 and the time period was 12 hours (this is not a busy road), then one might say the rate is 10 cars per hour.

This could be the same with molecular simulation. My real job is to direct computers to run simulations of protein folding. We make models of the proteins in unfolded states, then let them evolve according to Newton's laws of motion; with the luck of statistical mechanics, some of them reach folded states. Say that I observed 10 folding events in 100 microseconds; then an estimate of the rate would be 1 folding event every 10 microseconds, same as with the cars.

Interestingly, the division method (in this case also known as a maximum likleihood estimate) is not necessarily the best method for estimating a rate. For one thing, this and similar methods provide only point estimates of the rate and do not reflect our uncertainty as to how good the estimate is. To illustrate, imagine observing a road for 1 second and seeing no cars pass; clearly a rate of 0 cars per second (minute, hour) is not a good estimate of the rate. We would prefer a way to know how good our point estimate is.

For this purpose, we can compute a probability distribution of the rate, which describes our beliefs about the rate. That is, we assign a probability to each possible value of the rate. These probabilities in turn describe how surprised we would be, after making an observation, that the true rate would turn out to be any number. If we had made lots of observations (many cars in some long time period) then the probability distribution would be very sharp: we would and should be very surprised to find that the true value is different from the maximum likelihood estimate (number of observations divided by time period) if we have lots of data.

In contrast, if we have a little bit of data--no cars in 1 second--then our probability ends up being not sharp but broad. With silly data like this, we would not be surprised to find that the true rate is anything. This is because the maximum likelihood estimate should not be taken seriously given such a small amount of data.

The manner in which probability distributions of the rate are built is Bayesian inference, that method of statistics that allows things with "true" values like protein folding rates to take on probabilities which reflect our belief that the true value is within some range. As I show in the paper, these methods quite naturally show what is intuitive above: that lots of data gives sharp, reliable estimates and that a tiny bit of data gives poor estimates. Intuition can be made systematic.

Most fun, I can use the methods in the paper to calculate my future performance. I have three papers this year (so far, anyway). If everything stays the same, the probability that I publish between 2 and 5 papers next year is about 59 %. (I call this state "quantitative professional scientific happiness," or QPSH, come up with your own pronunciation) What's more, the probability that I publish less than 2 papers next year is only 14 %. The probability that I publish more than 5 papers is a little more than 26 %.

So you should be more surprised, if everything stays the same, if I publish more than 5 papers next year than if I publish between 2 and 5. You should be even more surprised if I publish less than 2. But who knows if everything will stay the same? Perhaps we should always be surprised?