Showing posts with label Models. Show all posts
Showing posts with label Models. Show all posts

Saturday, February 21, 2015

A Thought About Health Planning


I was a member of a health planning research project in the early 1970s. A WHO expert from Geneva at that time told me that for centuries after the fall of Rome, the largest cities were limited to about half a million inhabitants. At that size a city in the dark ages had a death rate that was so high that immigration and the birth rate could not be its equal, and the city would stop growing.

I don't know why Rome was so much larger at its peak that it was later or than were other European cities at a later date. There were possibly many reasons. The Romans were great engineers and had aqueducts that provided abundant water as well as sewerage to remove human wastes, leading to better hygiene than was possible in later centuries; perhaps the inhabitants of Rome were less often sick from water borne or water washed diseases. The Romans imported food in large amounts and distributed food to poor citizens, so perhaps the population was better nourished. The Romans brought slaves into Rome, and perhaps they brought in slaves faster than the slaves left and died.

In those days as a health planner I helped a small group of students do a senior project studying several alternative locations for a hospital to be built in Cali, Colombia -- the city in which we lived and the health planning project was located. The students developed a model based on the number of patients seeking cared for at each of the existing hospitals; the model was then used to predict how many would go to a new hospital were it located at each alternative place and what that flow would mean in terms of demand at the existing hospitals. (The study proved to be useful and used, and all the students involved were hired by the offices of the Ministry of Health in the Department of Valle.)

Cali, like many cities in developing countries, grew fast and had very different neighborhoods. I lived in one that had all the amenities of a U.S. or European city. There were neighborhoods that had minimal infrastructure, shacks, and high population density. (I remember someone calling those neighborhoods full of soil scrapers, making the word play on sky scrapers -- they had the population per acre you might expect in a neighborhood of sky scrapers, but the shacks barely rose above the soil on which they stood.)

It is too bad we didn't develop a model that would predict health status by neighborhood, leading to applications for prediction of demand on health service facilities (were they to be built), as well as an aid for the planning of infrastructure investment.

The epidemic of Ebola in West Africa suggests how useful a model might be that used housing quality, population density, a the availability of piped water and waste disposal facilities to enable quick prediction of the course of an epidemic and "hot spots".


Tuesday, February 10, 2015

On the Modelling of Ebola and Epidemics

There is an article in The Economist about the use that was made of quantitative models to forecast the incidence of Ebola in the current West African epidemic.
With more than 22,000 people infected, nearly 9,000 of whom died, this outbreak was the gravest ever. But it confounded experts who had feared much worse. In September the WHO predicted more than 20,000 cases by November (there were actually about 13,000). Around the same time, a worst-case prediction by America’s Centres for Disease Control and Prevention (CDC) of up to 1.4m cases (reported and unreported) by January 20th made the headlines. Others were similarly bleak. So where did models and reality diverge? 
For a start, the models relied on old and partial figures. These were plugged into equations whose key variable was the rate at which each case gave rise to others. But this “reproduction number” changed as outside help arrived and those at risk went out less, avoided physical contact and took precautions around the sick and dead. So difficult are such factors to predict that epidemiologists modelling a disease often assume that they do not change at all.
I suspect that the authors of this article misunderstand the nature of disease models. One interpretation of such models is as "if, then statements". If the parameters of the model are correct, and if the relations implemented in the equations of the model are correct, then the model's predictions are likely to be correct. A logician will tell you that in such statements, when the if statements are not correct, then no conclusions can be drawn.

Indeed, very often models are used with different parameters to show how different are the conclusions that follow from them. Thus
(For the CDC projections) it was the “very unlikely” worst-case scenario that grabbed the headlines. This assumed not only a stable reproduction number, but that known cases were just 40% of the total (based on the gap between the baseline model and figures for the number of people in treatment on a single day in August).
That is, the worst case scenario studied by the CDC was that each case of Ebola would generate as many new cases as the first ones did, continuing an exponential growth month after month. Moreover, it assumed that the origin of the epidemic in rural villages and the distrust of authority in those villages were such that the number of initial cases that actually came to the attention of medical authorities would only be three for every five people infected.

How does one obtain a parameter for the number of cases that officials don't know about? One guesses. Normally, one would run the model with different values to show a range of possible projections.

Similarly, epidemiologists are not naive; they know that over time people will learn to reduce the new infections per ill person. But how do the estimate the way this parameter will change over time? They guess. Again, it is common to do several projections with different scenarios for the reduction in the reproduction number -- the number of people on average to which each infected person passes his infection.

Indeed, one of the key uses for modeling of epidemics should be to help manage the public health effort in response to the epidemic. How much effort should be devoted to general health education? how much to keeping friends and neighbors from touching people sick with Ebola or their bodies after they die? How much to having teams bury the victims using full isolation and protective methods? The costs of each alternative can be compared with its likely effectiveness.

Ebola was poorly understood. There had been only a couple of dozen previous outbreaks, all in remote areas, all with small numbers of victims, and all with slightly different strains of the virus, one from another. Thus, it was only in this much larger epidemic was it learned that people ill from the disease became much more infectious as the disease progressed; thus only now can epidemiologists begin to quantify the advantage of early identification and isolation of people infected with Ebola.

The public health approach is now changing. At one point there were 1000 or more people being infected each week. The staff was still gathering and tooling up, and were running as fast as they could to educate the public, build trust, identify the new cases and get them into care, to train staff in procedures to limit infections in care facilities, and to bury the dead safely. Now that the incidence is much lower, the officials are going to greatly expand the effort to trace the contacts of each person who comes down with the disease, quarantine those contacts, and stop the chain of infections. As long as the disease is being transmitted, there is a possibility of an epidemic exploding again.

There was once a global campaign to eradicate malaria. It proved impossible to do so, and the small numbers of malaria victims in the countries from which it was not eradicated reinfected the world. Today we are near the global eradication of polio. However, there are a few focal spots left that could serve as the source to reinfect the world; indeed, we were very close to eradicating the disease a few years ago, but there was resistance to the immunization campaigns leading to continuing new cases; when some of these ill persons traveled, they reintroduced the disease into other countries.

Sunday, December 22, 2013

A thought on computer models


I find people responding to news articles about inferences that people have drawn from large scale computer models, and worry. I have debugged models, and it is hard to do. It is very easy for errors to creep in. Indeed, I spent time early in my career checking a linear programming package that had been supplied to our computer center, finding errors in the code. It is hard enough to check that a large system of equations adequately describes the situation of interest, and that the parameters have been correctly estimated, and correctly entered, without worrying that the solution software will enter its own errors.

Today software packages are more reliable than they were in the bad old days, but I suspect that many of the packages are also far more complex than they were in those days.

Essentially mathematical models extrapolate from basic assumptions. If one assumption is wrong, the extrapolation may well be wrong. A way to protect against wrong assumptions is to do sensitivity analysis, checking to see how sensitive the important results are to each assumption. If the accuracy of specific assumptions is especially important to the credibility of the result, those assumptions can be double and triple checked. But for that to be effective, the modeler has to be aware of all the assumptions in the model, and that is not always true.

Ideally one wants the theory on which a model is based to be correct. Unfortunately, correct theories are not always easy to come by. One possible use of modeling is to extrapolate from known conditions as if the theory is true, and look for situations in which the extrapolation is inaccurate.

An example that bothered me today is from an article in ScienceDaily: Scientists Discover Tipping Point for the Spread of Ideas. The article begins:h
Scientists at Rensselaer Polytechnic Institute have found that when just 10 percent of the population holds an unshakable belief, their belief will always be adopted by the majority of the society.
I would want a very good model, built on very strong theory with at most very modest assumptions, to justify such a sweeping generalization.  I would also want to be sure that the details were right. In this case, however, I doubt on the face of it that the statement is true.

Lets do a  thought experiment. I have been reading The Reformation by Diarmaid MacCulloch, so lets assume that 10 percent of the population has an unshakable belief that the teaching of the Catholic Church is right about the correct practice of Christianity. Let us also assume that 10 percent of the population has an unshakable belief that the position of Martin Luther is right about the correct practice of Christianity.  As the Pope and Luther would both affirm, it is not possible to believe both are correct simultaneously. Thus in this example, the prediction of the ScienceDaily article will not hold; but the article says it will always hold. Woops!

Tuesday, April 03, 2012

A conceptual model for borrowing among societies


Societies change. One of the major sources of change is the importation of things and ideas from other societies. Some some such changes are quite modest, some are larger and more important:
  • Individual rock and roll records made their way through the Iron Curtain and gained an audience, then local bands began to play their own rock and roll, and eventually the Communist society was changed more generally by those who saw rock and roll as a vehicle to political liberalization.
  • Asian nations began to assemble simple electronic devices under contract from Northern companies (competing on their low labor costs), moved up the value chain, and now some have relatively mature electronics industries capable of manufacturing complex products and inventing new ones.
  • Some African nations had essentially no college educated citizens at independence. They began to send students abroad for college educations, to obtain aid from abroad to create colleges, and eventually developed their own higher educational systems with several colleges, cadres of college teachers, large numbers of their own college students, etc.
Of course, not all imported things lead to systemic change. Sometimes a movie fails to find a local audience, or does find such an audience but fails to lead to a market for further movies. So too, inventions occur within societies. sometimes leading to major social changes -- the Internet developed in the United States leading to ecommerce and egovernment. However, I want to focus on the flow of things and ideas among societies.

The idea is similar to the idea of "meme" from Anthropology -- "an idea, behavior or style that spreads from person to person within a culture. However, I want to broaden the concept to include things and institutions that involve more than one person.

Product Spaces

There has been some work in this mode, analyzing how product space of a society changes over time. I quote the abstract of "The Product Space Conditions the Development of Nations" by C. A. Hidalgo1, B. Klinger, A.-L. Barabási1 and R. Hausmann published in Science magazine in 2007:
Economies grow by upgrading the products they produce and export. The technology, capital, institutions, and skills needed to make newer products are more easily adapted from some products than from others. Here, we study this network of relatedness between products, or “product space,” finding that more-sophisticated products are located in a densely connected core whereas less-sophisticated products occupy a less-connected periphery. Empirically, countries move through the product space by developing goods close to those they currently produce. Most countries can reach the core only by traversing empirically infrequent distances, which may help explain why poor countries have trouble developing more competitive exports and fail to converge to the income levels of rich countries.

While some of the new products that are developed and manufactured are internally invented, I would guess that in the large majority of cases those products, the technology for their manufacture, and the techniques for their marketing are obtained through transfer from abroad.

In this case we have sources of new industries from abroad, which are obviously societies that already have those technologies in place. We can also think of a communication process in which there is a source, a receiver and a channel. I would propose that:

  • the source would be described by a number of characteristics such as the magnitude and quality of the source industry, the magnitude of the effort to transfer out industrial activities, and the degree of cultural "fit" with the receiver;
  • the receiver would also be described by a number of characteristics such as the readiness to accept and utilize the new industry, the magnitude of the effort of transfer in new industrial activities, and the cultural "fit" with the source; and
  • the channel would also be described by characteristics such as the transaction cost, the availability of intermediaries, and the "fit" with both source and receiver.
For any one industrial product I can conceive of a global network of competing channels, and an evolutionary process by which the industrial product spaces add and grow product nodes in some countries while those in other countries shrink and disappear.

Here are a couple of resources for such analyses:
Extensions to other things

As I suggested earlier, the concepts developed for product specific industries and product cluster industries can also be applied to many other, perhaps all other, areas in which societies borrow from one another. 

If you think of the location of a shop or restaurant, a key issue is the expected number of customers that the business could attract. There are a lot of models that have been developed to make such estimates, based on the distribution of population around the proposed site, the difficulty of the route from each house to the proposed shop, the likelihood that householders will use such a facility, and the likely attractiveness of the facility to local customers. While the models suggested in this post might be much more complicated, there is a conceptual similarity with the business location models.

Perhaps indeed, the model is only a conceptual one in general, although perhaps possible for implementation in specific situations such as the product space model described above.

Friday, September 30, 2011

Why people make bad decisions about rare events



 Daniel Kahnemann and Nassim Taleb discuss biases, the illusion of patterns as well es the perception of risk and denial

These guys are very good, and it is very surprising to me that they know each other well and talk all the time. The key points here are:

  • Rare events occur.
  • It is generally easier to model common events than rare events.
  • People have two predictive systems, an intuitive one and an analytic system.
  • People have limited rationality.
  • If you provide a simple model that works almost all of the time, and you don't have a model that predicts both the common and the rare events, then people will use the simple model.
  • The intuitive predictive system will tend to expect things to continue; thus you will intuitively feel that a simple model that has worked successfully many times in the past will continue to work.
  • (Apparently) your intuitive system feeling that the future will continue as the past will tend to overpower your analytic system which tells you that a rare event may occur.
  • If you build fragile systems, when the rare event does occur things will break.
This analysis explains why people live in beach communities subject to hurricanes, why Tokyo is built in a place where it may be destroyed by earthquake and typhoon, and why the financial system crashed in 2008.

Nobel Laureate Kahnemann made the point that it is wrong to assume that the firms are agents with independent will. The decisions made for firms are made by people in those firms. The incentives, risks and time frames of firm executives are not those of "the firm", its investors nor the general public. The financial meltdown was in part due to executives making decisions that paid off in terms of their own objectives and time frames but bankrupt their firms. Talib points out that the result was that a lot of these firms were capitalist while the simple predictions were paying off (and executives went home with big pay envelopes) but became socialist when the rare event of the financial crash occurred (and the state was asked to pay the costs).

While the context of this talk given two and a half years ago was the financial crisis, the deep structure applies to many situations. I very much like Talib's point that one should build structures and systems where possible so that rare events do not cause human catastrophes. Build earthquake resistant houses, hurricane resistant buildings, and bubble safe financial institutions.

The problem of course occurs in Haiti where day to day survival is so tough, where people are living in a continuing state of disaster, that you can't really expect them to move to places safe from earthquakes and tsunamis nor build safe houses rather than the shacks that they can barely afford.

Thursday, March 03, 2011

Nassim Nicholas Taleb Angry



This is wonderful -- a talking head who states frankly that he doesn't know. He also tries to explain to reporters that no one knows, and that there are not two sides to the debate that make sense.
There are two types of people: those who try to win and those who try to win arguments,they ae never the same.
Nassim Nicholas Taleb
Taleb, in his book The Bed of Procrustes: Philosophical and Practical Aphorisms, makes the point as I understand it that we live in a world of which we are largely ignorant and thus we should devise strategies to protect us from the unexpected.

Risk management is usually based on models in which the alternatives are not only understood, but their probability is assumed to be known. Some experts go the next step and assume that they can not accurately define the probabilities. As I get Taleb, he is concerned with situations in which we don't even know what all the alternatives are. He suggests that a lot of important decisions are of this class. Taleb clearly knows a lot about formal models of decision making (especially in the field of investments), and I assume he finds them to be intellectually stimulating. He simply believes that they should not be taken to be factually accurate guides to action in most important circumstances, and that their misuse led us into the financial crisis we are now living.

I note that{

  • The new information and communications technology is making things work faster than ever before, and we depend on computer analysis even though we can not fully understand the programs which the computers are following.
  • Smart people are working to design new financial instruments all the time and many (most?) of the people using those instruments don't understand them well.
  • The rest of us have our wealth and our incomes affected by these people using financial instruments we are barely if at all aware of.
  • Firms hire public relations people to put their practices in the best possible light for the rest of us.
  • People in firms tend to hide their mistakes even if they recognize them, and hide their ignorance.
Ignorance multiplies and we reach the unknowable. And the Republicans think that we should not regulate markets and that the public servants who try to do so are overpaid and provided with too many benefits!

Thursday, July 29, 2010

Mathematical Modeling is an Art!


The Economist has an article challenging the use of dynamic, stochastic equilibrium models of the economy for economic forecasting and policy analysis. The point is not that such models are not useful, or even that they have been stretched from their original academic purposes for use in economic policy making, but that a variety of model types should be used to develop a more complete understanding of the economy. The article cites a recent Congressional hearing on the topic.

Any mathematical model is at best a representation of reality. There is always a trade-off between the complexity of the model and the cost of model development and data collection versus the verisimilitude of the model's results, a trade off which should be made on the basis of the uses intended for the model. Indeed, there is always a question of whether to use one or several models.

The idea that the economy is in equilibrium has been very powerful, and equilibrium models are often useful. On the other hand, they tend to fail when the economy is not in equilibrium, as is the case when there is an economic bubble and especially when the bubble bursts.

Monday, March 22, 2010

Math Models: From financial meltdown to global warming

Computer modeling allows experts to extrapolate the implications of complex sets of assumptions and data in a timely fashion. In a few decades they have become a fundamental tool of the analyst. The computer models amplify analytical efforts in a manner analogous to the way mechanical engines amplify muscle power. Indeed we would no more be able to check the computer analysis without computers than we would be able to replace the machines in a coal mine with manual labor.

News reports suggest that an important factor in the financial meltdown at the end of the last decade was the use of mathematical models for risk management by the financial industry and its regulators. While I worked on mathematical models in another context, I don't know enough about those used in finance to comment intelligently. Still, the models that were in use must have failed to provide their users with adequate warning of the risks they were running. I would bet that the chief executives and boards of directors of the major firms involved neither had the expertise to understand the details of the models being used nor that they had taken the time to make a detailed investigation of those models on which they were betting their firms. A lot of those firms lost those bets.

Climate change is a sufficiently complex subject that powerful models must be applied to its analysis. A lot of very good scientists and modelers are doing so. Again, I am not expert in these models, but it is clear that there exist several different very strong models, indicating both the fact that there is not now an agreement on the perfect form for such a model and that the models are sufficiently robust to agree generally in their predictions. I am sure than none of the heads of government or major legislative bodies are experts in climate change nor these models. I suggest that there is a possibility that the existing models might fail to predict radical, non-linear climatic effects of factors that are not fully included in the theory or parameterization of the existing climate models.

While the bigwigs of the financial firms that got into such troubles made a lot of money in salaries and bonuses during the period in which they failed to take into account the risks that their models were wrong, the rest of us are paying for their failure in risk management.

The politicians who deny the risks that the current climate models are fatally flawed may reap short term political benefits. Let us hope that our children and their children do not pay for the failure to act now to reduce the threat of climate change. Prudence suggests that we not bet the future of the planet and the human race that the models -- which already predict major climate changes -- are not too conservative in their predictions.

Tuesday, March 02, 2010

A comment on feedback control systems

There is an article in the New York Times today attacking the myth that reducing food intake by 100 calories a day will result in the loss of a pound a month. The body has homeostatic processes which interfere with such a simple relationship.

Would you believe that if the ambient temperature were to increase by one degree for a month, then your body temperature would increase? Of course not.

The point being that simple models fail to explain the functions of systems that include feedback control.

Fortunately, if you can increase your base metabolism rate, you can make it easier to lose weight or to eat more while not gaining weight.

Sunday, October 19, 2008

A thought on why we don't intuitively understand the current economic crisis

The human mind is not well equipped to understand the economy. The events of the last month should make that clear. We can understand how supply and demand curves determine the price at which goods are traded. We can understand how a market can clear at a price for which no remaining buyer will pay more for a good and no remaining seller will accept less.

Leontiev suggested the interconnectedness of economic activities, with the outputs of many economic activities forming inputs for other activities, and consumers siphoning off the final products. Assuming linearity, he was able to draw upon matrix algebra to calculate the equilibrium values for all the economic production activities.

Linear programming approaches in economics expand the approach to find solutions to economic systems that satisfy sets of inequalities and optimize some objective function, again assuming linearity.

In fact, economic systems are really complicated. A set of complex non-linear differential equations might be a better approximation of what is happening (linear approximations seem reasonable when changes are small, but as changes get large their approximation seems likely to fail). Moreover, issues of uncertainty and crowd psychology suggest simulations using complexity theory might have a place in modeling the economic interactions we have been seeing.

Our poor monkey brains did not evolve to allow us to intuit the behavior of such complex systems.

Saturday, October 04, 2008

Social Capitalism/Capitalist Socialism

The Bill Moyers Program had a guest, Emma Coleman Jordan, who made a very interesting point with regard to the experience of the past couple of weeks. We are seeing companies becoming so large that if they fail, their failure could trigger a chain reaction that will cause grave problems for not only the economy of the nation but of the world. Consequently, the government has to step in and save those enterprises if they get in sufficient trouble. The means of saving these companies this time has resulted in even larger companies being formed by mergers and acquisitions of the failing firms by others that are more sound.

This does not sound like the laissez faire capitalism, and indeed the federal government is taking ownership in the companies through warrants and other mechanisms, as well as regulating them to see that they don't fail. It has the authority to force top executives to resign and to force the sale of the firms. The financial capacity of the federal government in form backs these enterprises. At the same time the power of shareholders and their designated managers is weakened.

This does not sound like socializing the enterprises, as many nations have done to many key enterprises in the past. For most of the time and for most purposes the Board of Directors and the corporate managers are responsible for running the firms, the firms are run for profit, and investors share in those profits. Indeed, the firms through the political action of their executives and investors, through political action committees, and through trade associations have considerable influence over the political systems of government.

Perhaps we are seeing a new mixed system with features of both socialism and capitalism being created. Indeed, when five financial institutions have a combined portfolio of four billion dollars, the scale of activity is beyond that of historical capitalist enterprises.

In a previous posting I noted that the regulation of these companies required the use of computer models to assess the risk that they were incurring (and we now discover passing on to the federal government and to the taxpayer). There is a problem with such computer programs. They can fall into error"
  • If they are built on theory which proves to be incorrect or inadequate,
  • If they are parameterized with data which proves to be incorrect,
  • If they are run with data on initial conditions or current conditions which proves to be incorrect or insufficient,
  • If they embody assumptions that prove incorrect, or
  • If they are implemented incorrectly, containing for example programming errors.
These models are so large and complex that they are very hard to understand. Indeed, they may be the product of teams of people over time, such that no one fully understands the model as it is being used.

A part of the current problem is that the federal regulators did not construct independent models which they could run to make independent estimates of the risk in the portfolios of the largest financial firms, but rather depended on the models which the firms themselves operated and used for their decision making. Thus if, as proved to be the case, the firms made bad choices and accepted too much risk, the regulatory agency was unlikely to be able to perceive that risk in advance.

We have yesterday a government investment of nearly a trillion dollars in the financial sector. If the government is on tap to make such investments, albeit if only once a century, in order to try to save the economy from deep recession, then it better have independent means to understand and monitor the risks involved, and means to impose regulations to manage those risks.

Sunday, August 12, 2007

Does Not Compute - washingtonpost.com

Does Not Compute - washingtonpost.com:

"Lenders of Sowood Capital Management learned recently that the prices of senior and junior debt don't, in fact, always move in the same direction in the midst of a liquidity crisis. And investors in Campbell & Co. learned that the model investing their $11 billion never imagined that the yen carry trade might unwind at the same time as a stock market downturn. The secret trading strategies of a number of 'quant funds' were foiled by the fact that the other funds had pretty much the same strategies. Now that the failure of some of these models has caused huge trading losses, there is concern that turmoil on financial markets might spill over into the real economy. Not to worry, assures the Federal Reserve, citing its economic forecasting models."

Comment: First lesson of modeling is to get the theory right. (Then you want to get the data and the implementation right, then you want to be sure the users understand the use and limitations of the model.)

In The (Mis) Behavior of Markets: A Fractal View of Risk, Ruin And Reward, Benoit B. Mandelbrot points out that stock markets do not follow the Gaussian distribution, and that extreme events (price increases or decreases) are more common that the Normal Distribution would predict. Since investors make or lose lots of money in days of extreme volatility, I assume those are the days that the models are most important. They are also the days when the assumptions (such as that of the Gaussian distribution) on which models are built are most likely to be wrong, or at least seriously challenged. JAD