Thursday, August 28, 2014

"Well duh!" When sheepdog 'robots' fail

I always like having a bit of media coverage of what I do. Part of it is the purely narcissistic enjoyment of lots of other people simultaneously taking an interest in our work. But there is also a genuine insight to be had from reading what the wider world thinks about research.

Tracks of a simulated sheep dog (blue line) 'driving'
and 'collecting' sheep (black lines/ red dots)
Yesterday, Daniel Strömbom and Andrew King, together with myself and several other co-authors, published our paper on sheepdog and sheep interactions. The paper proposes a model for how a dog rounds up sheep. The basic idea behind the model is that in order to drive the sheep forward, the dog gets behind the flock and moves towards it. Then, if the herd becomes too wide it goes to a point which drives the furthest out sheep back towards the group. The result is a zigzagging motion as the
dog takes the sheep towards the pen.

The elegance, I think, of the result lies in the simplicity of the algorithm. Previous work had proposed more elaborate rounding up schemes, which were not as good at collecting large numbers of flocking individuals. And Daniel's algorithm also nicely matches the data which Andy had collected. The dogs use the same simple algorithm as we show works so well in computer simulations.

The media were also pretty interested in our results. Andy was on BBC radio, Daniel and Andy were quoted repeatedly in different newspapers and Jose Halloy stepped in did an interview for French radio. The reports were enthusiastic, talking about the possible development of autonomous robots inspired by our research. But looking at the comment sections of some of the newspaper articles, not all readers were completely convinced. One of the main points can be summarised by the following quote on the Guardian's website

"This is one of those "Well duh!" is discoveries, isn't it? I just don't know how farmers have managed for centuries without this research." 

Why the hell are scientists wasting time telling us something we have known for years?

The answer to this critique lies in the details. It is one thing to know that dogs go back and forward behind sheep, another to show that a simple 'collect' and 'drive' mechanism works properly. This is what is done in the paper, by showing when the algorithm works and when it doesn't. And it is when it fails that the insight are might be greatest. One thing not covered by the media is that when trying to round up very big groups of sheep our 'robot' sheepdog sometimes got confused. This is shown in the video below. The simulated dog gets caught between two groups and can't continue.
So we don't fully understand how sheepdogs solve large scale herding problems, and we still don't know how and to what extent real dogs can solve these problems. I can think of some plausible answers, such as dogs giving up and repositioning themselves after a time, but testing these requires more work and more experiments. In fact, there are lots of things neither scientists nor anyone else understands about flocking and herding in general, and there is certainly nothing obvious about the answers.


Saturday, August 16, 2014

Hamilton's rule as a tautology.

Wilson and Nowak have published a new 'perspective' on the evolution of sociality in ants. It combines "palaeontology, phylogeny, and the study of contemporary life histories" to try to give more insight in to this question. This is their latest addition to a long running debate, between these two Harvard professors and (it seems) almost everyone else in evolutionary biology, on whether Hamilton's rule explains social evolution. After earlier attempts to provide mathematical models of the evolution of sociality in ants, bees and wasps, Wilson and Nowak seem to have returned to a more natural history based description. However, as Iain Couzin pointed out on Twitter they "argue for the need for a mathematical description, but provide no mathematical description".

I have a love/hate relationship with literature on the 'evolution of co-operation'. It usually involves nice mathematics and undergraduate maths students enjoy doing projects on it. But my main problem is that it does not produce empirically testable predictions. In the past, many of the papers by Nowak, his co-workers and other mathematical biologists working on the evolution of co-operation problem don't really specify what type of biological system they are trying to represent. With the exception of the current paper, Nowak's group appear to have settled on humans and this is fine, but prior to this he proposed various abstract rules of co-operation that were fun, but lacked experimental prediction.

It was slightly ironic then that Nowak et al. (2010) decided to so forcefully attack Hamilton's rule on failing to make empirical predictions. Hamilton's papers are full of empirical predictions, and as the 100+ authors who replied to the 2010 paper point out, it is helpful in settings ranging from sex allocation to parasite vigilance.

BUT, and this is a capital letters 'but', the paper by Nowak et al. (2010) was not about these other settings, it was about the evolution of eusociality, as defined by Wilson himself. Explaining eusociality has to be done in terms of the social interactions of animals or other organisms. And Nowak et al. (2010) are correct in their key point. Hamilton's rule is not a general equation for evolution of mechanisms. It is the other way round. Once we have described the mechanism for gene flow and social interactions it is possible to find a Hamilton's rule that gives the condition for the evolution of co-operation.

At first sight, this might appear to make Hamilton's rule extremely powerful. Hamilton's rule shows us that properly calculating costs, benefits and relatedness between individuals tells us the course natural selection takes. Hamilton’s rule can then be thought of as a fundamental accounting rule that must hold in order for a particular behaviour to evolve. But the same thinking shows a serious weakness. Hamilton’s rule becomes a tautology, a statement of necessary truth. By summing up costs and benefits in the right way we can find a Hamilton’s rule for every biological system. Instead of producing fundamental understanding, discussing Hamilton’s rule becomes an argument like whether we should add the rows or columns first when summing all entries on an Excel spreadsheet.  Different methods give the same answer, and there is no reason to call either method fundamental.

To illustrate this, Nowak et al. reformulated Hamilton's rule as

'something' b>c

where the ‘something’ was whatever came out of making the world fit in to Hamilton’s rule. I think this equation makes the point extremely well. Relatedness is of course important in evolution, but Hamilton's rule is a meaningless equation.

Together with two Laurents (Lehmann and Keller) a few years ago, we showed that one of Nowak and co-workers much touted 'new' rules for co-operation was just

relatedness > 'something c'/'something b'

where we could find the 'something c' and 'something b' from the underlying social interaction. At that point, we were stressing that there can't be 5 or whatever number of rules for co-opertation that Nowak was promoting at the time. Depending on how you want to look at it, there is only one (Hamilton's rule) or infinitely many. In hindsight I would have laid more stress on the "infinitely many" part than we did then, and this is what Wilson and Nowak's new paper stresses (although I don't quite know how Nowak reconciles his current position with the 5 rules he found earlier). Hamilton's rule (used in the context of population genetics) is the ring that binds all these different explanations of co-operation together, but only because it always applies. There is no such thing as magic.

I should point out that, while the 'something' equation in the Nowak et al. (2010) is interesting, the rest of the paper seems to me to be hyperbole mixed with a standard group selection model. The reply by Boomsma et al. highlights a serious problem with the explanation provided: relatedness is high in clades that have evolved to be social. High relatedness gives a simple and convincing explanation consistent with the reasoning Hamilton may have offered. This is good empirically grounded science. I will now have to study Wlison & Nowak's latest perspective in more detail to see if they can adress this point.


Wednesday, August 6, 2014

Super fluid starlings and other physical analogies.

Last week a new article on starling flocks was published by the  COBBS group in Rome. This research group, led by physicist couple Irene Giardina and Andrea Cavagna, are a great example of the varied background of researchers working in collective behavior. They started as theoretical physicists, but wondered how their skills could be applied elsewhere. Such interdisciplinary thinking by physicists isn't uncommon. Physicists often think that their models and tools will be useful for a whole range of things, from voting and elections, to the structure of the brain and, of course, animal groups.

Droplet of super fluid helium.
Taken from talk by Adam Hokkanen.
The idea in the current study is that mathematical models are used to draw an analogy between starling flocks and liquid fluid helium. Waves of turning propagate through the whole group very quickly. So quickly that it can appear they change direction in unison. What the Rome physicists found out was that there is a clear ordering in the turning, with individuals successively copying the direction of their neighbours. The analogy between super fluidity and starlings can be found in a relation between alignment and speed of turning. The higher the alignment of the group, the faster turning propagates through it.
physics and biology.

How are we meant to interpret analogies like this? Should we take them seriously and think that helium and starlings are just the same types of particles? Or should we see the similarity as just a loose rhetoric device? A way of getting the readers attention? These are the sorts of questions that are important if our aim is to apply mathematical models to make analogies. But the answer you get if you ask a theoretical physicists and mathematicians can vary greatly. They can also vary if you ask the same person on different days of the week.

Some physicists take these analogies very seriously indeed. I have been told on quite a few occasions that an experiment on ants or fish is unnecessary because it is "already proved by trivial symmetries in the system". Other times the analogies are made too loosely. No-one could be expected to believe that what is true for magnets is equally true for opinions about upcoming elections, yet this pretty much the assumption in many 'voter' models. The argument is sometimes made that the two systems have "deep parallels" and that the differences between iron filings and people are surface properties!
Other times, the argument is made that these analogies "capture the public's imagination" and are useful for communication.

I wouldn't argue that there is more than one correct way to make an analogy.  However, there is a rule which I think should be followed and it is this:

Modelling analogies between a physical and biological systems should be based on empirical observations from both of the systems.


Flow of starlings in a murmuration.
From Cavagna & Giardina (2014)
This is where Andrea, Irene and the Rome team have excelled. Their starling and midge data has set new standards in 3D reconstruction of movement of animal groups. They aren't satisfied with just speculating on similarities, but check the details. And they have made big steps in collective animal behaviour along the way. They are very clear about the importance of statistical mechanics tools in the way they work, and use analogies like the superfluity and phase transitions, but always couple back to the biology.

This is when physical analogies are at there best. When we use mathematical tools, careful experiment and lateral thinking all mixed together.

Tuesday, July 29, 2014

Waves of insect sound

On Friday, James "Teddy" Herbert-Read will present our recent work on synchronized cicada calling at ISBE2014. This project started when Teddy's parents invited my family to stay at their house in Port Macquarie, about 4 hours drive north of Sydney. Teddy's parents are brilliant hosts, and each evening Lovisa (my wife), Teddy and myself would find ourselves sitting on their verandah, gin and tonic in hand, looking out on a beautiful sunset. Kangaroos hopped around on the lawn in front of the house.

Then the cicadas starting singing. At first they produced a low background hum, but as the evening went on the volume increased. It didn't increase steadily, but in waves. At first it was low, then it got louder and finally we could hardly hear ourselves speak. Suddenly it stopped again, and for a while the peace and tranquility was restored. But after about ten seconds or so it started up again. And on it went, loud chirping, followed by a pause and chirping again.

Lovisa, Teddy and I set off, gin and tonic in one hand iPhone in the other, to the edge of the bush and set up recording stations 100m apart. We left our phones in the forest and returned to enjoy dinner on the terrace. After dinner and night fall, we returned to look for our phones. After a bit of stumbling about with torches, and one close Kangaroo encounter for Teddy and my son Henry, we recovered them. We downloaded and looked at the sound files. The pattern was immediate and striking. First Lovisa's phone, from the top of the hill, had a peak in volume. A few seconds later, my phone from the middle of the hill peaked, and lastly Teddy's from the bottom of the hill peaked. It looked like a wave of sound was traveling down the hill.

Even for a mathematician like me, microphones placed out after a few evening drinks do not constitute an experiment. Luckily, Teddy volunteered to return to his parents and do the hard work, this time completely sober. He placed out microphones and measuring the waves of cicada sounds over different areas near his parents house. If you are in New York on Friday you can find out more. If not the video below gives a little taster. The size of the circles give the volume at different positions round the forest. Watch how the noise spreads from top to bottom.

Much of our analysis of this data will be inspired by earlier work on synchronized firefly flashing and the models by Steve Strogatz and others on coupled oscillators. You can also read more about these types of synchronization in chapter 6 of my book on Collective Animal Behavior. Teddy's talk is on  Friday at 3:20.

Friday, July 25, 2014

In memory of Dave Broomhead

I found out yesterday that my PhD supervisor Dave Broomhead has died.

Dave was an amazing person and academic. For me, the thing that summed up Dave was his enormous faith in the goodness and ability of other people. His belief that everyone was doing their best may seem foreign to the competitive world of academia, where so many of us think our own work is the most important. But Dave's faith in others meant, not only that he was universally liked and respected by everyone he met, but that he could do research in a clear, methodological and honest way. I have many examples of his approach to life and academia, but those I give below are the ones that are most special to me.

When I started my PhD, I couldn't write. I had studied science and computing at school and University and never really got the hang of grammar or style. Dave took one look at the first draft of a paper I wrote and said "This isn't an article, its written like a computer program!". My feeling was that I was doing a PhD in maths, and writing was for journalists. Dave saw it differently. He set in place a Tuesday evening routine. We would go out and eat dinner together. He always paid. Then we would go back to his office. I would sit at his computer and he would lie flat on the floor behind me. He would ask me to read, line after line of the stuff I had written and make suggestions and corrections, not letting me move on until he was happy. The first two paragraphs of the 'Introduction' took about a month to write. I just reread these paragraphs now and see that they sum up much of my research over the next 10 years. Through these evening sessions, Dave taught me not only to write, but to organize my thoughts and solve problems.

It wasn't just his PhD students, to whom Dave gave time and space. He always listened carefully to anyone who talked to him: family, friend, academic, cleaner, or random person in the pub. I once asked him to chair a session at a meeting at the Newton Institute in Cambridge. In many ways, Dave was the worst possible moderator. He never interrupted the speaker, even when they were 10  or 15 minutes over time. By the end of the session we were running 40 minutes late. Dave had asked if there were any last questions for the final speaker. He looked around. No takers. Finally, after a long pause he said the speaker"…..OK, could you put up your 5th slide again….as you said I think there could be an interesting consequence if you took in to account…." and so it went on. When I asked about it afterwards he lightly reprimanded me for my impatience: "if people have come all this way to give a talk then we have to let them tell us everything that is on their mind, otherwise we'll never understand anything."

This faith in others pervaded his thinking about how academia should be run. He was opposed to all the forms of evaluations, rankings and assessment exercises that went on during his time in Manchester. His basic assumption was that anyone working in academia was doing it because they loved it as much as he did. If his colleagues failed to publish anything, it was because they hadn't yet found something worth telling other people about. Why publish a paper unless you really has something worthwhile to say? Better to wait until you had really solved the problem, and no point harassing those who hadn't got there yet.

His own research was grounded in a patient respect for what others had done combined with an extremely deep thinking of his own.  He invented a whole new field of radial basis neural networks, because he was carefully going through  and "spotted a simplification which the authors seemed to have missed". His influential work on time series analysis, took an abstract part of topology, in the form of Taken's embedding theory, and solved problems in detecting and understanding chaotic signals. Last time I saw him present his research he was using abstract algebra to solving computer communication timing problems. He used to joke that it didn't matter how 'pure' a mathematician thought their work was, he could take their work and make a useful application.

I last saw Dave three years ago, at home in Malvern with his wife Eleanor. I have seldom met two people with so much love and compassion for one another. I felt so much at home sitting in their house, talking to them both about their time as PhD students together in Oxford and their pride in their son Nathan. It is difficult for everyone when such an amazing person as Dave is lost, but his wonderful way of seeing life will never disappear.

Drawing by Dave, stolen by me from his Facebook page.

Sunday, July 13, 2014

The mystery of nothingness

Yesterday evening, arriving home from a few days away, my wife found I package addressed to me. I don't get real post very often so this was quite exciting. I opened it up to find two identical gift wrapped packages. Opening them up I found two almost  identical books, entitled 'Being or Nothingness'. I say almost identical, because one of the books had a wax seal and string round it, and came in a box with my name and the number 1260 on it. The other could be opened easily, and had number 0027 and name Alvar Ellegård on it.

I opened the unsealed book this morning and read it through. It consisted of 21 pages of quotations and mysteries relating to Sherlock Holmes, Douglas Hofstadter,  Satre, Hermann Hesse, Kafka. the Bible, various philosophers, Hitchhikers Guide to the Galaxy and other literature. It claimed to be a riddle that could only be solved through careful study. I couldn't really see the answer, but it was written down the lines of Hofstedter's other work (he wrote Gödel, Esher and Bach), and I concluded that it could be some kind of part of his work. I heard Hofstedter talk in Uppsala a few years ago about the importance of analogy, and thought he could be trying to experiment down those lines.

I thought it might be a birthday present and I should solve it myself, so I didn't look it up on the Internet. But when I got nowhere my wife Lovisa looked it up. Apparently this is the second time it has come out. The first was in 2008 and there were various theories, from viral marketing, Christians trying to convince scientists of the error of their ways to it being the work of a mad psychiatrist from Gothenburg (where the package was sent from). Lovisa thinks its an art project. Jon Ronson apparently wrote about the mystery in a book on psychopaths. There is also a strange video about a student's encounter with Hofstadter that relates to the book. But no real answers. It appears that in the latest release it has been sent to Swedish media people and academics, and they have now made a Facebook group (in Swedish) to document what is known.

What is remarkable about the whole thing is the quality of the book. I get emails every day telling me that the sender has shown that pi is a rational number or solved the mystery of quantum physics or something. But his book is of extremely high quality print, with a very professional feel that gives no clear indication of what it is trying to achieve. You can see it online here, but this doesn't capture the way the whole package was constructed. It also gives the aura of a genuine mystery, with clues going in different directions. The small number of details on the internet also seem to lead in very diverse directions. I don't know the answer to the mystery, but it was certainly a fun thing to get in the post.


Monday, June 30, 2014

Despite emotions, Facebook is not contagious

I am not one of those researchers who are "outraged" by Facebook's emotional manipulation study. Facebook, Google and Twitter make their living by manipulating our emotions. These companies continually manipulate  what we see when we go online, usually so we keep coming back for more. In this context, it doesn't seem so terrible that they sometimes use their power to make new interesting scientific findings.

Figure from Kramer et al. showing effects
measured in 'social contagion' study.
I am however doubtful about aspects of the result presented in the new PNAS article. The authors claim to provide "experimental evidence for massive-scale contagion via social networks" and "first experimental evidence to support the controversial claims that emotions can spread throughout a network". What is actually provided is a rather weak effect. In the experiment, the authors removed between 10% and 90% of positive posts from people's news feed and found that the percentage of positive words used dropped from around 5.25% to just over 5.1%. I show the results figure from the paper on the right so you can see the results yourself.

So what does this result mean in terms of social contagion?  Imagine I have 100 friends on Facebook and 50 of them stop writing positive things online. If I write 100 words a day on Facebook, then according to the experimental results, during one week I will write a total of one less positive word. Maybe on Wednesday I'll write 'OK' instead of 'Good'. This lost 'good' will have almost no effect on my friends. Of the 70000 words they might read in a week (assuming everyone is like me and writes 100 words a day and has 100 friends)  one of them will be less positive. There is no way that this type of effect will turn in to a "contagion". My potential 'good' will be lost in a noise of 'likes' and smiley faces. Quite quickly everyone will recover from negative thinking and the balance of happy and sad words will return to normal levels.

The authors partially acknowledge my point saying that "the effect sizes from the manipulations are small" but claim that "the massive scale of social networks such as Facebook, even small effects can have large aggregated consequences". While this statement is true, my argument above shows that the aggregation works against contagion, not in favor of it. I could make this argument more thorough, accounting for interactions between individuals and calculating R0, but the result will be the same. The Kramer et al. study show that emotions are negligibly contagious on Facebook.

Overall, the Facebook study is a useful contribution to the literature and I am glad to see it published. What concerns me is how quickly an idea like 'online emotions are contagious' can spread without anyone checking the basics. Scientific ideas are contagious and often spread unchecked (although maybe I should check how strong this effect actually is before I make such claims :-) ).