Saturday, January 9, 2016

Amaral and Mayer: food chains, co-extinction, power laws - part 1

We're living in period of rapid change: changing climate, species extinction, species transported by humans changing food webs, landscapes changed by farming, forestry, mining, urbanisation, and more. Sometimes the impact of these changes can be small and other times it has been unexpectedly large. There's a lot we just don't know.

An important area of modelling and research comes from looking at historic patterns and finding simple models that behave in the similarly. Then exploring their robustness and perhaps using them for planning and prediction or at least refining our intuition about what the consequences of our actions in the world might be.

One domain that is important now is the historical record of extinctions of species. We know that there are bigger and smaller extinction events. For perfectly human reasons we expect big extinction events to have big causes, like the meteorite strike that contributed so dramatically to the extinction of the dinosaurs. But for some big extinction events we can't seem to find such smoking guns. And there are events like the meteorite strike that formed Chesapeake Bay 35 million years ago, comparible in size to the K-T boundry event, but with nothing like the same impact on species extinction.

What we see when we analyse the size of extinction events in the fossil record is that they follow a power law.

A lot has been written about power laws and they have some important properties if you find a system that follows one. It doesn't make sense to analyse them in terms of averages and deviations as you would for a normal distribution; your intuition and training about statistics are going to be wrong when applied to things that are organised according to a power law. They are scale invariant, look at all the events from size 10 to size 100 and you'll get a histogram with with same shape as all the events from size 1 to size 10. There's a precise number called a power law exponent that characterises the shape of that histogram. The predictions you can make fit a template like this: over the next period of time I expect N events in size range X and M events in that size range Y, but I can't tell you what will happen tomorrow given the history of events.

One intuition about extinction events is that if a species goes extinct then species that are closely connected to it as prey or predator are suddenly affected as well, they go extinct together, which we call co-extinction.

Sneppen and Bak have a simple model of webs of species and co-extinction: use a graph to model a web of species each connected to two other species. Represent fitness as a number randomly assigned to each species. Iteratively replace the least fit species and the two connected to it with three new randomly fit species. An interesting effect happens with the over all fitness: because you are eliminating the least fit, the new randomly fit species are initially likely to be fitter on average, but after a time that stabilises out so that most species are above the average random fitness. Then, in that phase, the random fitness of new species can put old very fit species at risk leading to a cascading effect of reduced fitness across the whole network. Measuring the size of those cascades, for example through the distribution of species ages, demonstrates a power law, apparently, but I haven't implemented the model and tested it for myself. That something so simple displays a power law at all is an important foundation. But we're told that it has the wrong power law exponent compared to the fossil record so in some important way the model is wrong.

From foundations like that many more elaborate food webs and fitness models can be imagined and compared to details of the fossil record. Hopefully such models give us insight into which features of food webs make them resilient or what states of food webs might make them prone to particular patterns of extinctions.

Amaral and Mayer focus on an intuitively reasonable extra detail in their model: trophic layering. Trophic levels represent the idea that there are predators and prey in a food web, and that there are classes of species with similar trophic roles, (carnivorous predators, photosynthetic food producers, strict herbivores, etc). They introduce a few new ideas to the model: speciation events split a random species by introducing a new species at the same or an adjacent trophic level but with a different random assignement of predators and prey, (always just from the layers above and below respectively). There is no numeric fitness but there are random extinction events that remove species from the lowest trophic layer. If all of a species' prey go extinct then that species also goes extinct. Falling overall number of species represent our extinction events.

Apparently, this again leads to a model with extinction events with sizes that follow a power law. And, apparently, for seeming reasonable numbers of trophic levels and seemingly reasonable numbers of preditor and prey connections, this model produces extinction events that show a power law distribution with an exponent very like that seen in extinction events in the fossil record.

Amaral and Mayer's model has appealed to me since I first read about it. It seems to me to be both concise but also to represent things that intuitively seem very important in the real world.

So, I'm going to implement something like the Amaral and Mayer model. An important thing to realise is that it shouldn't have to be exactly their model. If their model is robust then most implementations should have the same sorts of properties.

There's a lot that I'm not in any position to verify: what power laws are typical of the fossil record, how many trophic levels are reasonable, how many prey and predators are reasonable. But I can see that it does produce a series of extinction events with sizes following a power law distribution. And I can explore it's robustness by seeing how the power law exponent changes with the number of trophic levels and the respective rates of speciation and extinction.

I'm also looking forward to seeing how a very strict functional implementation might be work out. The first stage will produce an infinite list of food web states. Each successive state representing a time step with the effect of just one speciation event or one extinction event (and it's possible cascade). This will give us a chance to make use of functional data structures for efficient memory use sharing the unchanged parts of the web between each time step. That allows us to separate out the analysis as a separate module operating over that list of states; a neat separation of concerns that is hard to get with an iterative implementation manipulating a single state data structure. It also makes it much easier to analyse sets of adjacent states. I'm really quite excited by the clarity that this type of implementation could bring to this class of models.

The implementation will once again be in Java with Javaslang for the functional data structures and infinite series. If it's interesting to anyone we could in future look at implementations in other languages or with other programming styles. I'm very curious to see if the choice of programming tools and idioms could influence the choice of questions researchers ask, (and hope that a menu of implementation choices will one day make researchers feel even more free to ask new questions).

Further reading: