Studying social transmission using STbayes

Post provided by Michael Chimento.

When studying animal culture, it’s important to establish whether novel behaviours or information have spread through social contact, or are rather innovated or personally discovered. Unfortunately, we can’t give animals a survey asking how they learned something! While many methods for studying social transmission have been proposed over the years, network-based diffusion analysis (NBDA), first introduced in Franz and Nunn 2009 and Hoppitt, Boogert & Laland 2010, has emerged as a leading framework.

What are NBDA models?

NBDA models share similarities with survival models that an ecologist might use to estimate survival and its correlates. However, rather than mortality events, we measure learning events, where individuals are observed producing a novel behaviour, or exploiting useful information, for the first time. From this, we can estimate a learning rate that results from from two components, an asocial “intrinsic” component that accounts for individual learning, and a social component, that accounts for social learning by exposure to other knowledgeable individuals. If you have data about the knowledge state of individuals over time, and how frequently individuals in a population interact with one another, NBDA models can estimate whether those interactions increase the learning rate.

NBDA has been applied to many species across taxa, including humpback whales, great tits, honeybees, bearded capuchins, honeybees and trinidadian guppies. Illustration by Michael Chimento.

To illustrate the principle of network-based diffusion analysis, let’s use a silly, human-centric example. Let’s say an intrepid scientist is at a house party, and observes their friend, let’s call her Mary, open a beer bottle with a lighter. The scientist wants to know how she learned to that useful trick, but for is too shy to ask. Instead, they surreptitiously borrow her phone and call each contact to ask if they also know how to open bottles with a lighter. None of them have any idea what the scientist is talking about, including her family and close friends. One former colleague claims they know how to do it, but also asked who was calling, having only met Mary once in passing. From this data, the scientist would infer that Mary seemingly figured this out for herself. In an alternative scenario, if the scientist found her brother knew how to do this and so did her best friend, they might infer that she picked it up from them. This is fundamentally what NBDA does: by accounting for the timing of events, and the social relationships between individuals, the model statistically infers how much of the learning process was driven through asocial trial-and-error, and how much was due to social transmission.

Over the years, NBDA has been extended to account for…

1. individual-level variables (perhaps Mary smokes, predisposing her to have the requisite lighter in her pocket)

2. transmission weights (Mary is much more likely to have learned from someone who does this behaviour daily rather than monthly)

3. dynamic networks (if Mary learned the trick while she was living in Quebec, it’s unlikely she learned it from her family members in Florida)

4. comparison of multiple networks (with more data, the scientist might find that this behaviour actually spreads through friends more frequently than family)

… and so on. The flexibility of this framework, as well as its translation into the NBDA R package by co-author Will Hoppitt, has made it an invaluable, widely applied tool in the fields of social learning and cultural evolution.

What does STbayes add?

STbayes gives researchers a user-friendly tool to perform Bayesian NBDA analyses, and also introduces some new extensions to the framework. Users provide their data, and STbayes dynamically generates and fits models written on the back-end in Stan, a Bayesian statistical language that allows for more efficient model fitting than other statistical languages, like JAGS or BUGS (if you know, you know). STbayes also contains some useful functionality for interpreting model output, performing model comparison, and posterior predictive checks. This lowers the barrier to entry for less experienced coders, as they do not need to learn Stan itself, and also creates a quick way to prototype models for more advanced users who can then go onto modify the Stan code directly. The “Getting started” vignette provides a walk-through of the pipeline for a basic modelling scenario.

Beyond the pipeline, STbayes adds a few new extensions to NBDA. Perhaps the most important is that now users can take advantage of the output of generative network models. Network edges can be included as distributions, rather than point-estimates, allowing researchers to account for network uncertainty in their estimate of social transmission. Users can now easily include varying effects by trial or individual (e.g. some individuals might be more sensitive to social information than others). In addition to dynamic networks, users can also supply dynamic transmission weights that change over time. Finally, STbayes supports complex transmission likelihoods, and introduces a more numerically stable parametrization of frequency-dependent transmission (inspired by Dino Dini’s tuneable sigmoid function). The “Advanced recipes” vignette illustrates how to use these different features.

The story behind STbayes

STbayes is itself a product of cultural recombination. My research interests put me in a position where I was exposed to all of the ingredients used to put the package together, and my computational background gave me the skill-set I needed to execute it. During my PhD with Lucy Aplin at the Max Planck Institute of Animal Behaviour, I became exceptionally familiar with NBDA while working alongside Damien Farine and Sonja Wild, all of whom were power-users and contributors to the framework. Reviewing the literature, I found some studies used NBDA, while others used experience-weighted attraction (EWA) reinforcement learning models, an alternative framework. After studying their equations, I realized that the two could be smushed together to for a more holistic model of cultural evolution, as NBDA modelled acquisition, while EWA modelled choice. I published a simulation model to better understand the consequences of combining the two, and went on to use the model to investigate how immigrants might affect adaptive cultural evolution. I temporarily put NBDA to the side, and went on to use EWA to study social learning in immigrant great tits, learning how to use Stan from Brendan Barrett, who sat on my advisory committee. As I began my postdoc phase, the STRAND and BisonR generative network modelling packages were published. I realized how powerful it could be to model edges as distributions rather than point estimates, and thought it would be neat if this approach could be combined with NBDA.

As a postdoc, I was working with Fumihiro Kano at the University of Konstanz. Kano’s student, Mathilde Delacoux, had run an experiment studying anti-predatory vigilance in pigeon flocks, using a state-of-the-art system that recorded 100 Hz fine-scale 3D-tracking data. They wanted to ask whether pigeons were gaze-following to locate a predator. At some point, I realized that the question could be addressed with an NBDA. Mathilde extracted all the necessary data from the terabytes of tracking information. Meanwhile, I cobbled together an increasingly complicated Stan model to test myriad alternative hypotheses put forward by Kano. In the end, it allowed for including dynamic networks and transmission weights (downsampled to 1 Hz), individual-level variables, and varying effects. Once I had something that seemed able to recover parameter values from simulations, I sent the Stan code to Will Hoppitt, a key developer of the NBDA framework, and asked if he could check over the likelihood and give any feedback. He graciously agreed, and after talking (and patching up an important bit of the likelihood I had borked), we came to the conclusion that it would be helpful to put together a package that could automatically create such Stan models, and thus STbayes was conceived.

This was my first time putting together an R package, and I learned perhaps more than I bargained for from the experience. Hadley Wickham’s tutorial was invaluable. Of course, it was very much worth the effort. Science is iterative and collaborative. You’re always standing on the shoulders of others, and I am very grateful to everyone who helped along the way.

Read the full article here.

Post edited by Sthandiwe Nomthandazo Kanyile.

Leave a comment