Updating your version of Julia on a shared computer cluster

When it comes to the console and using binaries, I am just not at all tech-savvy. I recently had to install an updated version of Julia on the computer cluster I am using (previously worked with an HTCondor cluster, now I am at a SLURM cluster). I didn’t want to break everyone else’s programs, so I wanted to install it only for me.

The Julilang website kind of already gives you the answer here. But it still took me a while to figure our exactly what to do. So, here we go.

  1. Download the binaries from the Julialang website (in my case those were the Generic Linux Binaries for 64-bit architecture)
  2. Upload this .tar file to your user folder on the cluster, e.g. /home/yourusername/bin
  3. Untar the file using: tar -xvf
  4. Change the folder name to something more useful (I just used the version number: julia062)
  5. Now, we need to let the server know that it should this version of julia whenever we call julia from the terminal. To do this, we need to change the PATH variable; Have a look with echo $PATH (should look similar to this: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games); What we want to do, is to add our path /home/yourusername/bin to it. So, create a/or use the .profile file in your home directory (to get to the home directory, simply enter cd); with the commandnano .profile a text editor opens; We want to add our path to the beginning of the PATH variable, so like in math we want the new PATH’ to be ourPATH + oldPATH. To achieve this we will write: PATH="/home/yourusername/bin/julia062/bin:$PATH"; the $PATH simply adds whatever the PATH currently is to the end of our path. (You might have to replace /home/yourusername with $HOME, depending on the server settings). Finally, save the file by pressing Ctrl-X and accepting the changes.
  6. Now, logout of the cluster and log in again.
  7. When you now call julia, the version you just installed should be the one up and running. Remember, that you now also need to install all the packages you want to use for the updated version of Julia.

Enjoy your latest version of Julia!

Oh, and don’t forget to change the call in your source files as well. Those look usually like this #!/usr/bin/env julia but now needs to be #!/home/yourusername/bin/julia062/bin julia. Otherwise, you will only use the latest version of julia whenever you call it directly, but your jobs for the cluster would still run with the version installed globally.

Still questions? Let me know how to improve this post.

Italic species names in Mendeley exported *.bib files

I stumbled upon this annoying problem with my reference manager Mendeley: while it is fully capable of italicising journal names where necessary, it lacks the ability to italicise species names.

Screen Shot 2017-08-09 at 07.24.18.png

An easy solution is to simply use the HTML code for italic font:

Screen Shot 2017-08-09 at 07.26.18.png

And there you go, now the species name will be italicised when you let Mendeley automatically generate a reference list in, say, MS Word. However, in case you export your references as *.bib file to use it in LaTeX you will find that the HTML code was not translated correctly and thus your References will look like this:

Screen Shot 2017-08-09 at 07.58.03.png

Well, that isn’t useful at all. Fortunately, some little programming can help here. The following code, provided by Kathy Lam (see here), opens the exported *.bib file,  searches for the italics HTML code and replaces it with the correct LaTeX code.

If you want to run the code on your Mac, simply copy the following code to a text file:


#!/usr/bin/python

# By: Kathy Lam
# Date: January 11, 2016
# Purpose: Replace all instances of "<i>" with "\textit{"
# and "</i>" with "}" in bibtex file generated by Mendeley

oldbib = open("bibliography.bib", "r")
newbib = open("new_bibliography.bib", "w")

for line in oldbib:
    if line.startswith("title"):
        if "<i>" in line:
            fixed_open_tags = line.replace("<i>", "\\textit{")
            fixed_both = fixed_open_tags.replace("</i>", "}")
            newbib.write(fixed_both)
        else:
            newbib.write(line)
    else:
        newbib.write(line)

Replace bibliography.bib with the name of your *.bib file. Save this text file as a *.py file. Then, to make it executable, change over to the Terminal and type chmod +x FILE.py, where FILE is the name of the text file you just created. Finally, put the python file and your bib file in the same directory and then double click the python file. All reference should be fixed now. Let’s see:

Screen Shot 2017-08-09 at 08.13.23.png

Thanks Kathy! And good luck everyone with fixing your references.

By the way, there is an even faster way, see Ozan’s comment.

Julia – The first contact

Today I tried Julia for the first time. I have read about it before, and kept considering whether or not it is worth learning another programming language (see e.g. Should I learn new programming langauge Julia?). And there are many thoughtful comments online on the benefits of Julia compared to other popular high-level programming languages like R, Python, MATLAB, etc. (here, or here), but there are also critical voices (like here). In any case, I decided to have a look at it anyway. My background is in R, so learning Julia should not be too much of a problem. Right?

First, I installed Julia directly from the developers’ website. But, you can also use homebrew to setup Julia. After installation, Julia is immediately accessible through the terminal. 

Screen Shot 2017-08-06 at 11.41.33.png

While I have no problems using the terminal, I still prefer a good IDE. Yeah, I am that kind of person. Previously, I used RStudio and texstudioand am very happy with the additional functionality an IDE provides. I decided to install Juno, which is an extension for the Atom text editor. Simply search and install the uber-junopackage within the Atom editor. It takes a while to load install all the dependencies. Once this is done a new Julia session is initiated. This first start up will also take a few moments.

Hacking 2+2 into the console results in 4. Good, the first test was successful. Now, on to something more adventures. Plotting. I know, this might be too advanced for the first day, but hey, in R plotting belongs to the core functions, and enjoy plotting my data and results. Simply type plot(1:10) in an R console and a plot will appear somewhere.

Screen Shot 2017-08-06 at 11.53.11

Great. So, how to do this in Julia? The Julialang website offers three different options for plotting: Plots, PyPlot, and Gadfly. In order they are the generic way of plotting in Julia, a variant relying on Python's matplotlib, and one that is similar to R's ​ ggplot2 . (I really like ggplot2 a lot, and in combination with cowplot you can make really nice plots, so I guess, in the long run, I will stick with making plots in R).

First, install the Plots package, then call it for the session by using using and then let us plot 2 sets of data each with 10 random numbers:

Pkg.add("Plots")
using Plots
plot(rand(10,2))

And here we go. A quick way to plot:

Screen Shot 2017-08-07 at 17.58.22.pngInterestingly, the created figure is interactive. You can zoom in on data, and pan around. That’s certainly different from the generic R plot.

These first steps have definitely made me interested in exploring Julia more. Less for plotting, but more for using it as my go to agent-based modelling language.

Open questions about culture

I found my notes with the big questions and controversies, which came up at the Culture Conference I mentioned earlier. I think the most prominent one was:

How do we define cultural evolution?

Of course, it would ideal to have a definition of cultural evolution we could all agree on. But, given the diverse backgrounds of researchers currently working on the topic it is unlikely to be agreed on in the near future. I guess, we still have not understand this phenomenon enough to put it into words. This is similar to life, the species concept, or fitness, which are concepts happily used by many researchers but all of which are lacking a universal definition.

Further questions regarded:

How important is high-fidelity imitation/copying for cumulative culture?

Where lies the origin of cumulative culture?

What constitutes primate and non-primate innovation, how do they emerge, and how are they dispersed (if at all)?

Which types of social learning (imitation, emulation, teaching) do we find in other species and how important are they for cumulative culture?

These are all fascinating questions and each seems to have the potential to fill an entire life of research. Let us use our social learning and cooperative abilities and tackle them together.

(Please fell free to use the comment section in case you have got more questions which you feel are important for our research field.)

The First Meeting of the Young Social Learning Researchers

A quick introduction

 

I recently started an initiative to connect young researchers (Masters, PhDs, Post-Docs) from diverse backgrounds (spanning from archaeology, biology and physics to psychology and philosophy), whose work broadly falls into social learning and cultural evolution. The aim of this initiative is to initiate a first contact between researchers and to get in touch with each others projects, but also facilitate future cooperation (you would be surprised how many people work on similar projects).

Together with my engaged colleagues (like Matt Creasey, Alecia Carter, Harry Marshall, and others) my goal is to organize socializing events (many great ideas come up in a pub), seminars (to present our work), and workshops (to learn from each others research techniques).

Pre-Conference-Pub-Meeting of the YSLR

To kick-off this initiative, I hijacked the Culture Conference a week ago at Birmingham University. Hoping that some participants of the conference would not only arrive a day earlier but were also interested in my idea, I organized an informal meeting at a pub on Wednesday evening. To get an idea how many would come (if any at all) I set up an online questionnaire (here) where everyone who wanted to join sign up with their name, mail address and a short description of their work. Together we distributed the link to the form to work groups in our field.

I was surprised (and very pleased) by the quick response of 40+ researchers. I did not expect to receive so many reactions. At the pub we were about 14 Master and PhD students as well as Post-Docs, from St. Andrews, Durham, Exeter, Manchester and even Århus. Thanks again to everyone who could make it. It was great to talk to so many like-minded colleagues about their exciting projects.

 

Besides other topics we also discussed what shape the #YSLR initiative could take on. Their were three points raised:

  1. Staying in touch – Creating a mailing list, which can be used to distribute information about upcoming meetings, conferences, new papers of members, enquiring help, etc.
  2. Exchange – Organizing a (one day) seminar for members with short talks about our projects as well as discussions about the pressing questions in our field (see below).
  3. Socialize (my favourite of all suggestions) – A one weekend get-together in Snowdonia, where we combine hiking and cooking with networking, socializing, and enjoying being a young researcher 😉

I’m currently setting up the mailing list at my university, though the IT is very slow in responding. I hope to have something running by next week. If you would like to be part of the mailing list then please fill out this form here.

I will have a look into points 2 and 3, and I will be needing help for this. So, if you would like to engage with our project, please let me know. I’m happy about every response.

At the Culture Conference in Birmingham 2016

From 9th to 10th June we and many more researchers joined the Culture Conference, organized by Elisa BandiniEva Reindl, and Claudio Tennie. Have a look at their website to get an idea of the line-up of speakers and topics.

What can I say, ‘t was a great conference with thought provoking talks, enlightening discussions, and inspiring speakers. From what I took away, the main questions that stand unanswered or are highly controversially discussed in cultural evolution are:

  • What is an acceptable definition for cumulative culture?
  • What are the necessary mechanisms for culture to evolve?
  • Is it time to bury the cumulative culture ratchet?

(Have you got more? Use the comments below!)

I hope these are topics we (as YSLR) will address and discuss in one of our future meetings, and hopefully add to their resolution.

Until then, stay tuned!

 

 

 

The Gossip

The Gossip

During one of the talks at the recent Winter Meeting of the Association for the Study of Animal Behaviour a painting by Norman Rockwell, The Gossip, was used to illustrate information diffusion (here some gossip) in a group of individuals (here Rockwell’s neighbourhood). To me, it not only demonstrates that humans are quite good in spreading information, but also, how much we love to do so. Most people are curios on the border to being nosy. I wonder how important this personality trait might be for the success of a species/population/group of individuals.

We want to keep track of what is happening around us and observing others or taking up information they provide might help us to do so. Did the world change, or the relationships between the people around us? Both could be relevant to our survival. One of these cases were more information seems to be better than less.

If you want to know more about the painting and its creation, have a look at Rompedas’ blog.

New release of R – all packages gone?

A brand new release of R is out, you install it using the convenient installer and bam! you are up to date again. And, as a special treat you might find yourself without the packages you had previously installed. At least, that is what happened to me. A simple way to get the packages installed again? Use this line of code in your R console:

install.packages( as.character( as.data.frame( installed.packages( "/Library/Frameworks/R.framework/Versions/3.1/Resources/library/" ))$Package))

This will automatically install all the packages that were installed for the previous release (which in this case was R 3.1, which you can see in the path). Depending on what version number your previous release had you will have to change the version number in the path accordingly.

Nah, is that a time saver?

Coming back to the head line: your packages are not gone at all, it is just that your new version of R is looking for packages in a new folder. See it as an advantage, if you ever have to deal with a package that is only running say with R 3.0 then you can go back to the 3.0 directory with all the other packages that were functional at that time as well.

And as a side note, a quick google search will bring up similar pieces of code thanks to the helpful bloggers Randy Zwitch and rmkrug.

An introduction to Agent-Based Modelling in R


Rock Paper Scissors Lizard Spock

As part of my PhD I am using computational models to unravel the evolution of certain behaviours. In my case I am interested in the evolution of social learning. Here, I want to give a very short introduction for how to create a simple agent-based model (ABM) using R. When I started with my first ABM I had no clue where to start. When you read scientific papers that use ABMs they usually do not talk about the implementation (code-wise) either. So, here is an example for an agent-based model for individuals that play a game commonly known as Rock, Paper, Scissors. But first, what actually are ABMs? Wikipedia says, that ‘an agent-based model is one of a class of computational models for simulating the actions and interactions of autonomous agents with a view to assessing their effects on the system as a whole.’ Now, let us analyse what the fundamentals for an ABM are.

What you need for an agent-based model

The minimum ingredients for an agent-based model are:

  • Agents that interact with the world around them and/or with other agents
  • A world in which the agents ‘live’ or move around
  • A set of rules that determines what every agent is allowed or has to do
  • A loop, which allows to repeatedly act or interact

In our case agents are not moving around and therefore we will not consider the second point (a world). Let us start with only two agents that play one of the three strategies (Rock, Paper, Scissors) against each other. We will define two individuals, let them choose a strategy and then play them.

Creating agents is actually very simple. We need to keep track of an individual and therefore it needs an ID. In our model they will choose a strategy, which we will associate with the ID. And finally, to make the model interesting, let us monitor the times an individual wins against the other. To keep track of all this we create a data.frame with the according columns

indDF indDF
## id strategy num_wins
## 1 1 NA 0
## 2 2 NA 0

Check at our first point: we got our agents ready to play. In the next step we let them choose a strategy. As we our agents will choose their strategies repeatedly we simply create a function. We will hand over the indDF and the function assigns a random strategy to the stratscolumn in the data.frame. We use number instead of names for the strategies, as this will make working with them easier later on.

chooseStrategy strats ind$strategy return(ind)
}

Let us proceed to the next step where the agents play their strategies. Again, we create its own function. What is happening inside the function can be summarised like this: strategies are ordered numerically in the way the win against each other, i.e. paper:1, scissor:2, rock:3. As 11 we need to identify this special case (rock loosing against paper). The number of wins of the individual with the winning strategy is increased by one. If both individuals play the same strategy, nothing happens in this round.

playStrategy if(ind$strategy[1]==ind$strategy[2]) {} else{
#in the case that one chose Rock and the other paper:
if(any(ind$strategy == 3) && any(ind$strategy == 1)){
tmp ind[tmp,"num_wins"] }else{
#for the two other cases, the better weapon wins:
tmp ind[tmp,"num_wins"] }
}
return(ind)
}

Now we can let the individuals play against each other repeatedly. We are going to use a simple for loop for this and let individuals play 1000 times against each other.

for(i in 1:1000){
indDF indDF i }
indDF
## id strategy num_wins
## 1 1 2 488
## 2 2 3 512

You might have spotted a function at the beginning of above’s chunk. I wrote a small setup function that allows us to quickly create the data.frame we were using above. An easy way to reset the simulations.

setup return(data.frame(id=1:2, strategy=NA, num_wins=0))
}

We now habe a neat little model. You will find that there is not much of a difference between the one or the other individuals. Especially, when you let it run more often.

But say, you would like to monitor what is happening throughout the simulation. We can record the process when we let the loop report individual results every turn. We will simply write the number of wins of both individuals in a two column matrix called dat. Subsequently, we will plot the result:

rounds indDF dat for(i in 1:rounds){
indDF indDF dat[i,] i }

plot(dat[,1], type='l', col='#EA2E49', lwd=3, xlab='time', ylab='number of rounds won')
lines(dat[,2], col='#77C4D3', lwd=3)

ABM_1-1

The model is running and we can observe what is happening. Now it becomes interesting. We can use the model to actually find the answer to a hypothesis. For instance: is it true that a player, wich never switches it’s strategy, is more successful when it plays against another individual that randomly switches its strategy? To test this we need to adjust the strategy choosing function.

chooseStrategy2 strats ind$strategy[2] return(ind)
}

Now, the second individual will change its strategy randomly, while the first chooses a strategy once and then sticks with it. We will return the results of this simulation to a matrix called res2. We will compare it to a simulation where every individual switches randomly between strategies. To make the results more robust let us repeat all simulations 100 times.

rounds repetitions dat res2 for(j in 1:repetitions){
indDF indDF[1,"strategy"] for(i in 1:rounds){
indDF indDF dat[i,] i }
res2 j }

plot(dat[,1], type='l', col='blue', lwd=3, xlab='time', ylab='number of rounds won')
lines(dat[,2], col='red', lwd=3)

# for comparisson let's calculate the winning vector for both players switch strategies:
res1 for(j in 1:repetitions){
indDF for(i in 1:rounds){
indDF indDF dat[i,] i }
res1 j }

# and the winner is:
t.test(res1,res2)

##
## Welch Two Sample t-test
##
## data: res1 and res2
## t = 0.5579, df = 202, p-value = 0.5775
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.09938468 0.17781605
## sample estimates:
## mean of x mean of y
## 1.529412 1.490196

ABM_2-1

At the end of the chunk I added a t-test to compare the two types of simulations. As you can see, no, it doesn’t make a difference whether the agent changes its strategy or not. However, this doesn’t take into account human psychology. Nevertheless, an interesting result.

Rock Paper Scissors on a network

In this second example we are going to use the same game, but this time several individuals will play against each other. In my phd project I assume that individuals can only interact with other individuals with which they have a connection. An easy way to think about this is a network, where individuals are represented by nodes and connections by ties. We will use a simple lattice network and therefore individuals can only play with their direct neighbours. To add an evolutionary dynamic to the simulation individuals that loose adopt the strategy of the winner. Have a read through the code, there are some explanations in it.

require(igraph) # for networks
require(reshape) # to change the resulted data in a format ggplot2 can use
require(ggplot2) # for plotting

# size of the lattice
sidelength<img class="alignnone wp-image-594 size-full" src="https://infinitedegrees.wordpress.com/wp-content/uploads/2015/07/abm_3-1.png" alt="ABM_3-1" width="672" height="480" />

<a href="https://infinitedegrees.wordpress.com/wp-content/uploads/2015/07/abm_3-2.png"><img class="alignnone wp-image-595 size-full" src="https://infinitedegrees.wordpress.com/wp-content/uploads/2015/07/abm_3-2.png" alt="ABM_3-2" width="672" height="480" /></a>

What we observe are interesting dynamics between the three strategies. For the limited number of rounds that we let the model run all strategies coexist. However, sometimes one strategy disappears which will lead to the win of the strategy that loses against this one. For example, if paper disappears, rock should win on a long run. You can now experiment what would happen if you have a smaller or bigger network, or even a different network type. The ```igraph``` package offers many possibilities here.

### And what is with Spock?
The model we created so gar can be used to investigate for example epidemic dynamics. How do for instance information, rumors, and ideas, spread through a network. When we think of strategies spreading through a network we might want to add another strategy and see how a four-strategies-game differs from a three-strategies-game. Let us add Spock from the __Rock, Paper, Scissors, Lizard, Spock__ (see for example [here](http://www.samkass.com/theories/RPSSL.html))that you might have heard off from [The Big Bang Theory](https://www.google.it/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&ved=0CAMQjxxqFQoTCKy_hIfd4cYCFcjtFAodxhAAvA&url=http%3A%2F%2Fwww.fanpop.com%2Fclubs%2Fthe-big-bang-theory%2Fimages%2F15090520%2Ftitle%2Frock-paper-scissors-lizard-spock-fanart&ei=7rmoVenrNM2f7gaU0I6QBQ&bvm=bv.98197061,d.ZGU&psig=AFQjCNHLCUOTpBDCfNDHRBHWLmg-4Wlipg&ust=1437207412361054&cad=rja).


```r
# size of the lattice
sidelength<-10
# creating an empty data.frame to store data
stat<-data.frame()
# creating a lattice network using the igraph package
l<-graph.lattice(length=sidelength,dim=2)
# now every individual chooses a strategy at random
V(l)$weapon<-sample(c(1,2,2.9,3), size=length(V(l)), replace=T)
# for a nicer visualisation lets colour the different options
V(l)[weapon==1]$color<-'blue' # Paper
V(l)[weapon==2]$color<-'yellow' # Scissors
V(l)[weapon==3]$color<-'green' # Rock
V(l)[weapon==2.9]$color<-'purple' # Spock
# and this is what it looks like:
plot(l, layout=as.matrix(expand.grid(1:sidelength, 1:sidelength)), vertex.label=NA)

Let us have a look how our network looks like with four strategies:

ABM_4-1

Finally, let us run the slightly altered model.

for(t in 1:2500){
    from <- as.numeric(sample(V(l), 1))
    nei<-neighbors(l, v=from, mode='all')
    if(length(unique(V(l)$weapon))==1) {
        V(l)$weapon[from]<-sample((1:3)[1:3!=as.numeric(V(l)$weapon[from])], 1)
    } else {
        to <- sample(nei, 1)
        fromto<-c(from,to)
        w<-as.numeric(V(l)$weapon[fromto])
        if(w[1]==w[2]) {} else{
            if(max(w) == 3 && min(w) ==1) {
                V(l)$weapon[fromto[w==3]] <- "1"
            }
            else{
                V(l)$weapon[fromto[w==min(w)]] <- V(l)$weapon[fromto[w==max(w)]]
            }
        }

    }
    stat<-rbind(stat, c(sum(V(l)$'weapon'=="1"), sum(V(l)$'weapon'=="2"), sum(V(l)$'weapon'=="2.9"), sum(V(l)$'weapon'=="3")))
    # you can also plot each individual network configuration in each step of the simulation
    # V(l)[weapon==1]$color<-'blue' # Paper
    # V(l)[weapon==2]$color<-'yellow' # Scissors
    # V(l)[weapon==3]$color<-'green' # Rock
    # V(l)[weapon==2.9]$color<-'purple' # Spock
    # plot(l, layout=as.matrix(expand.grid(1:sidelength, 1:sidelength)), vertex.label=NA)
}

names(stat)<-c("Paper","Scissors","Rock","Spock")
s<-melt(stat)
s$time<-1:nrow(stat)
ggplot(data=s, mapping=aes(x=time, y=value, col=variable)) + geom_line() + theme_bw()

ABM_4-2

I hope this introduction was helpful and allows you to come up with your own ideas for agent-based models. Share and post your versions of the code in the comments if you like.

Our buggy moral code – when do we cheat?

Dan Ariely is a behavioural economist. In this TED talk he presents his experiments and insights into predictable irrationality. Surprising or not, there are many cases of irrational behaviour in humans. Here Ariely focussed on intuitions and cheating which he and his lab investigated. Let me summarise what he has to say about cheating. The experiment his lab conducted is quite simple: a group of participants receives a sheet of paper with N number of mathematical tasks to solve. After a certain time, which is chosen so that it is impossible to solve all tasks, the students have to hand back their sheets. They get paid for every solved task. Ariely explains how they then added possibilities to cheat, for example, students would shred their sheets and should then tell how many tasks they solved. Interestingly, the students would cheat a little but not overly much. This is a pattern that is consistent with several modifications of the experiment that would in theory allow to cheat more. However, a specific version of the experiment (students would ask for tokens instead of money and could then exchange the tokens with money somewhere else) drastically increased cheating. Separating the lie and receiving the reward (money) as well as abstracting money for tokens made cheating more tempting. And finally, Ariely explains a version of the model where an acting student bluntly cheated; after 30s in to the experiment the actor would say that he/she finished the task and received its reward. As this obvious act of cheating wasn’t punished, one could expect that it increases cheating. But this was not always the case. It depended on the sweatshirt of the acting student. When the shirt had the logo of the university all other students were studying at, cheating would indeed go up, while there was no cheating when the shirt was from a different university. People seem to either want to separate themselves from misbehaving individuals, or to identify with a group of people and their behaviour. This has important implications for what we have seen and still see at stock markets.

Not by learning alone

How does a population of any species maintain its behavioural characters? In other words, how do individuals of a species ensure that information about how to survive in the world are passed on from one generation to the next? This can be basically everything that is somehow related to feeding, growing, surviving, and reproducing.

Modes of information transmission

I found this very nice (and short) paper by Bennett Galef Jr. from 1975, where he explains the three mechanisms by which behaviours are passed on to the next generation. Instead of describing the transmission of behaviours I will rather talk about information, as behaviour is also just information. This is:

§1 Information are innate – In this case information are ‘endogenous’ to the individual by being part of its genetical code. The genotype not only influences the phenotype of an organism, but also its propensity for different behaviours (you are less likely to learn how to fly if you were born without wings).

§2 Similar information are gathered by experiencing similar interactions with the (non-social) environment – Individuals of a population that experiences predation by birds of prey might learn very similar avoidance or escape strategies if compared to each other, but likely very different ones compared to individuals of a population that faces predation by snakes. Saying that, it is not all too surprising to find similar behaviours when comparing individuals from different species, which is comparable to convergent evolution where similar environmental conditions and natural selection produce analogous adaptations, like fins in dolphins and penguins.

§3 Information are socially transmitted – In this case individuals gain information by interacting or observing the behaviour of another individual. Because this happens in the context of other individuals it is also called ‘social learning’, which is different from §2 where individuals learn on their own and henceforth called ‘individual learning’. Examples are trial-and-error and insight learning.

As Wakano and Aoki (2006) note, all three modes of information transmission are usually present in a population, they differ, however, in the type of information they carry. If the environment is stable or only slowly changing and information about it keeps valid over a long time it can be innate. If the environment changes moderately social learning is often found, and individual learning becomes inevitable when the world changes quickly. (FYI, that’s what I find in my models as well 😉

Social interaction – sufficient or necessary?

Galef now goes on to discuss social learning (§2) in more detail. Specifically he talks about an aspect I was not aware of before: when is social interaction between individuals sufficient and when is it necessary for learning? What does that mean? The first example Galef gives is based on a study by Harlow and Harlow on Rhesus monkeys from 1965. They found that individuals that grew up without interacting with their mothers or group members never developed a ‘normal’ sexual or maternal behaviour. Therefore, a social interaction is necessary to acquire the ‘normal’, relatively invariant, and species-typical behaviours.

Very different from that example is the case of a study by Galef and Clark from 1971, where adult rats where fed with two types of food: a preferred type with a sub-lethal dose of poison (which will cause nausea but no harm) and less preferred one, which was not altered. Adults learned to eat the less preferred food and avoided the initially preferred food items. Consequently, pups also prefered the initially less preferred food, although they did not even get in contact with the prepared food items, and thus with the adverse stimulus. This is an example where individuals (the pups) could have acquired information on their own (without a social context), by sampling both food types. Here, social interactions are sufficient but not necessary. But let me cite the elegant description by Galef:

Idiosyncratic pattens acquired by the transmitter, as a result of its history of transaction with the environment, may be introduced into a population repertoire, resulting in the establishment of socially transmitted traditions within subpopulations of a species.1

As we see, social learning is a mechanism that not only allows a population to maintain a repertoire of information and behaviours, but also to add new elements to it. But let us turn to the last part of the paper:

How then is information transmitted?

Galef uses an example of food preference and predator avoidance to describe two mechanisms by which information can be transmitted:

§4 Altering the environment – Adult rats heavily mark places with urine or feces to indicate save food sources, which in turn are then preferred by rat pups. The young are also known to prefer feeding in close vicinity to adults. These are two examples that show information transmission due to local or stimulus enhancement. (Galef and Clark, 1971a)

§5 Pairing an innate tendency with a social interaction – In two studies rat pups were shown to start running when adults run (Reiss, 1972, Angermeier, 1959). This unconditioned tendency (run when adult runs) can be used to couple an unconditioned stimulus (fleeing adult) with a conditioned stimulus (sight of predator).

Galef closes his paper by pointing out the evolutionary significance of social learning. He states that if laboratory experiments resemble natural conditions then trial-and-error must be energy consuming and error prone. Therefore, it must impose a fitness benefit on parents if their naïve offspring is capable of rapidly acquiring relevant behaviours (locating and handling food, discovering, avoiding, and escaping predators) to quickly become independent of their parents.

A very nice and insightful read!

EDIT: the title of this post is a play with the title of the book ‘Not by genes alone’ by Richardson and Boyd.

References
Galef BG (1975) The Social Transmission of Acquired Behavior. Biol Psychatry 10(2):155–160.

Wakano JY, Aoki K (2006) A mixed strategy model for the emergence and intensification of social learning in a periodically changing natural environment. Theor Popul Biol 70(4):486–497.


  1. Sentences like this are the reason why I enjoy communicating science in a, say, simpler language.