Tableau + Vensim = ?

I’ve been testing a data mining and visualization tool called Tableau. It seems to be a hot topic in that world, and I can see why. It’s a very elegant way to access large database servers, slicing and dicing many different ways via a clean interface. It works equally well on small datasets in Excel. It’s very user-friendly, though it helps a lot to understand the relational or multidimensional data model you’re using. Plus it just looks good. I tried it out on some graphics I wanted to generate for a collaborative workshop on the Western Climate Initiative. Two examples:

Tableau state province emissions

Tableau map

A year or two back, I created a tool, based on VisAD, that uses the Vensim .dll to do multidimensional visualization of model output. It’s much cruder, but cooler in one way: it does interactive 3D. Anyway, I hoped that Tableau, used with Vensim, would be a good replacement for my unfinished tool.

After some experimentation, I think there’s a lot of potential, but it’s not going to be the match made in heaven that I hoped for. Cycle time is one obstacle: data can be exported from Vensim in .tab, .xls, or a relational table format (known as “data list” in the export dialog). If you go the text route (.tab), you have to pass through Excel to convert it to .csv, which Tableau reads. If you go the .xls route, you don’t need to pass through Excel, but may need to close/open the Tableau workspace to avoid file lock collisions. The relational format works, but yields a fundamentally different description of the data, which may be harder to work with.

I think where the pairing might really shine is with model output exported to a database server via Vensim’s ODBC features. I’m lukewarm on doing that with relational databases, because they just don’t get time series. A multidimensional database would be much better, but unfortunately I don’t have time to try at the moment.

Whether it works with models or not, Tableau is a nice tool, and I’d recommend a test drive.

http://www.ssec.wisc.edu/~billh/visad.html

Maya fall to positive feedback

NASA has an interesting article on the fall of the Maya. NASA-sponsored authors used climate models to simulate the effects of deforestation on local conditions. The result: evidence for a positive feedback cycle of lower yields, requiring greater deforestation to increase cultivated area, causing drought and increased temperatures, further lowering yields.

Mayan vicious cycle

NASA

“They did it to themselves,” says veteran archeologist Tom Sever.

A major drought occurred about the time the Maya began to disappear. And at the time of their collapse, the Maya had cut down most of the trees across large swaths of the land to clear fields for growing corn to feed their burgeoning population. They also cut trees for firewood and for making building materials.

“They had to burn 20 trees to heat the limestone for making just 1 square meter of the lime plaster they used to build their tremendous temples, reservoirs, and monuments,” explains Sever.

“In some of the Maya city-states, mass graves have been found containing groups of skeletons with jade inlays in their teeth – something they reserved for Maya elites – perhaps in this case murdered aristocracy,” [Griffin] speculates.

No single factor brings a civilization to its knees, but the deforestation that helped bring on drought could easily have exacerbated other problems such as civil unrest, war, starvation and disease.

An SD Conference article by Tom Forest fills in some of the blanks on the other problems:

… this paper illustrates how humans can politically intensify resource shortages into universal disaster.

In the current model, the land sector has two variables. One is productivity, which is exhausted by people but regenerates over a period of time. The other… is Available Land. When population exceeds carrying capacity, warfare frequency and intensity increase enough to depopulate land. In the archaeological record this is reflected by the construction of walls around cities and the abandonment of farmlands outside the walls. Some land becomes unsafe to use because of conflict, which then reduces the carrying capacity and intensifies warfare. This is an archetypal death spiral. Land is eventually reoccupied, but more slowly than the abandonment. A population collapse eventually hastens the recovery of productivity, so after the brief but severe collapse growth resumes from a much lower level.

The key dynamic is that people do not account for the future impact of their numbers on productivity, and therefore production, when they have children. Nor does death by malnutrition and starvation have an immediate effect. This leads to an overshoot, as in the Limits to Growth, but the policy response is warfare proportionate to the shortfall, which takes more land out of production and worsens the shortfall.

Put another way, in the growth phase people are in a positive-sum game. There is more to go around, more wealth to share, and population increase is unhindered by policy or production. But once the limits are reached, people are in a zero-sum game, or even slightly negative-sum. Rather than share the pain, people turn on each other to increase their personal share of a shrinking pie at the expense of others. The unintended consequence-the fatal irony-is that by doing so, the pie shrinks much faster than it would otherwise. Apocalypse is the result.

Making climate endogenous in Forest’s model would add another positive feedback loop, deepening the trap for a civilization that crosses the line from resource abundance to scarcity and degradation.

Dynamic Drinking

Via ScienceDaily,

A large body of social science research has established that students tend to overestimate the amount of alcohol that their peers consume. This overestimation causes many to have misguided views about whether their own behaviour is normal and may contribute to the 1.8 million alcohol related deaths every year. Social norms interventions that provide feedback about own and peer drinking behaviours may help to address these misconceptions.

Erling Moxnes has looked at this problem from a dynamic perspective, in Moxnes, E. and L. C. Jensen (in press). “Drunker than intended; misperceptions and information treatments.” Drug and Alcohol Dependence. From an earlier Athens SD conference paper,

Overshooting alcohol intoxication, an experimental study of one cause and two cures

Juveniles becoming overly intoxicated by alcohol is a widespread problem with consequences ranging from hangovers to deaths. Information campaigns to reduce this problem have not been very successful. Here we use a laboratory experiment with high school students to test the hypothesis that overshooting intoxication can follow from a misperception of the delay in alcohol absorption caused by the stomach. Using simulators with a short and a long delay, we find that the longer delay causes a severe overshoot in the blood alcohol concentration. Behaviour is well explained by a simple feedback strategy. Verbal information about the delay does not lead to a significant reduction of the overshoot, while a pre test mouse-simulator experience removes the overshoot. The latter policy helps juveniles lessen undesired consequences of drinking while preserving the perceived positive effects. The next step should be an investigation of simulator experience on real drinking behaviour.

Good modeling practices

Some thoughts I’ve been collecting, primarily oriented toward system dynamics modeling in Vensim, but relevant to any modeling endeavor:

  • Know why you’re building the model.
    • If you’re targeting a presentation or paper, write the skeleton first, so you know how the model will fill in the answers as you go.
  • Organize your data first.
    • No data? No problem. But surely you have some reference mode in mind, and some constraints on behavior, at least in extreme conditions.
    • In Vensim, dump it all into a spreadsheet, database, or text file and import it into a data model, using the Model>Import data… feature, GET XLS DATA functions, or ODBC.
    • Don’t put data in lookups (table functions) unless you must for some technical reason; they’re a hassle to edit and update, and lousy at distinguishing real data points from interpolation.
  • Keep a lab notebook. An open word processor while you work is useful. Write down hypotheses before you run, so that you won’t rationalize surprises. Continue reading “Good modeling practices”

Another Look at Limits to Growth

I was just trying to decide whether I believed what I said recently, that the current economic crisis is difficult to attribute to environmental unsustainability. While I was pondering, I ran across this article by Graham Turner on the LtG wiki entry, which formally compares the original Limits runs to history over the last 30+ years. A sample:

Industrial output in Limits to Growth runs vs. history

The report basically finds what I’ve argued before: that history does not discredit Limits.

Setting Up Vensim

I’m trying to adapt to the new tabbed interface in Office 2007. So far, all those pretty buttons seem like a hindrance. Vensim, on the other hand, is a bit too austere. I’ve just installed version 5.9 (check it out, and while you’re at it see the new Ventana site); my setup follows. Note that this only applies to advanced versions of Vensim.

First, I allow the equation editor to “accept enter” – I like to be able to add line breaks to equations (and hate accidentally dismissing the editor with an <enter>). You can do this anyway with <ctl><enter>, but I prefer it this way.

vensim1.png

Continue reading “Setting Up Vensim”

Writing an SD Conference Paper

It’s review time for SD conference papers again. As usual, there’s a lot of variance in quality: really good stuff, stuff that isn’t SD, and good ideas imprisoned in a bad presentation. A few thoughts on how to write a good conference paper, in no particular order:

  • Read a bunch of good SD papers, by browsing the SD Review, Dynamica, Desert Island Dynamics, or past conference plenary papers. You could do a lot worse than picking one as a model for your paper.
  • Start with: What’s the question? Why do we care? Who’s the audience? How will they be influenced? What is their prevailing mental model, and how must it change for things to improve? (If your paper is a methods paper, not a model paper, perhaps the relevant questions are different, but it’s still nice to know why I’m reading something up front.)
  • If you have a model,
    • Make sure units balance, stocks and flows are conserved, structure is robust in extreme conditions, and other good practices are followed. When in doubt, refer to Industrial Dynamics or Business Dynamics.
    • Provide a high-level diagram.
    • Describe what’s endogenous, what’s exogenous, and what’s excluded.
    • Provide some basic stats – What’s the time horizon? How many state variables are there?
    • Provide some data on the phenomena in question, or at least reference modes and a dynamic hypothesis.
    • Discuss validation – how do we know your model is any good?
    • Discuss “Which Policy Run is Best, and Who Says So?” (See DID for the reference).
    • Provide the model in supplementary material, if at all possible.
    • Use intelligible and directional variable names.
    • Clearly identify the parameter changes used to generate each run.
    • Change only one thing at a time in your simulation experiments (or more generally, use scientific method).
    • Explore uncertainty.
    • If your output shows interesting dynamics (or weird discontinuities and other artifacts), please explain.
    • Most importantly, clearly explain why things are happening by relating behavior to structure. Black-box output is boring. Causal loop diagrams or simplified stock-flow schematics may be helpful for explaining the structure of interest.
  • If you use CLDs, Read Problems with Causal Loop Diagrams and Guidelines for Drawing Causal Loop Diagrams and Chapter 5 of Business Dynamics.
  • Archetypes are a compact way to communicate a story, but don’t assume that everyone knows them all. Don’t shoehorn your problem into an archetype; if it doesn’t fit, describe the structure/behavior in its own right.
  • If you present graphs, label axes with units, clearly identify each series, etc. Follow general good practice for statistical graphics. I like lots of graphs because they’re information-rich, but each one should have a clear purpose and association with the text. Screenshots straight out of some modeling packages are not presentation-quality in my opinion.
  • I don’t think it’s always necessary to follow the standard scientific journal article format, it could even be boring, but when in doubt it’s not a bad start.
  • If your English is not the best (perhaps even if it is), at least seek help editing your abstract, so that it’s clear and succinct.
  • Ask yourself whether your paper is really about system dynamics. If you have a model, is it dynamic? Is it behavioral? Does it employ an operational description of the system under consideration? If you’re describing a method, is it applicable to (possibly nonlinear) dynamic systems? If you’re describing a process (group modeling, for example), does it involve decision making or inquiry into a dynamic system? I welcome cross-disciplinary papers, but I think pure OR papers (say, optimizing a shop-floor layout) belong at OR conferences.
  • Do a literature search, especially of the SD Review and SD bibliography, but also of literature outside the field, so that you can explain how the model/method relates to past work in SD and to different perspectives elsewhere. Usually it’s not necessary to report all the gory details of other papers though.
  • Can’t think of a topic? Replicate a classic SD model or a model from another field and critique it. See Christian Erik Kampmann, “Replication and revision of a classic system dynamics model: Critique of ‘Population Control Mechanisms’ System Dynamics Review 7(2), 1991. Or try this.
  • Rejected anyway? Don’t feel bad. Try again next year!

If your kids are boring, you're doing it wrong

The other day I ran across a blog post (undeserving of a link, though there is a certain voyeuristic fascination to be had in reading it) that described children as boring little wretches, unsuited to inhabit the cerebral stratosphere of their elders. The mental model seemed to be something like the following:

Bad parenting mental model

The policy response to the misfortune of having children implied by the above is to foist them off on TV and day care until they grow up enough that you can tolerate their presence. That leaves you plenty of time for more intellectual pursuits, like tweeting, or speculating about the romance of the person in the next cubicle.

This reminded me of an earlier perspective on children, now thankfully less prevalent:

Their Hearts naturally, are a meer nest, root, fountain of Sin, and wickedness; an evil Treasure from whence proceed evil things viz. Evil Thoughts. Murders, Adulteries &c. Indeed, as sharers in the guilt of Adam’s first Sin, they’re Children of Wrath by Nature, liable to Eternal Vengeance, the Unquencheable Flames of Hell. – Benjamin Wadsworth

Untitled, Ansel Fiddaman, Pastel

Continue reading “If your kids are boring, you're doing it wrong”