Simulation code from Host–parasite fluctuating selection in the absence of specificity

Fluctuating selection driven by coevolution between hosts and parasites is important for the generation of host and parasite diversity across space and time. Theory has focused primarily on infection genetics, with highly specific ‘matching-allele’ frameworks more likely to generate fluctuating selection dynamics (FSD) than ‘gene-for-gene’ (generalist–specialist) frameworks. However, the environment, ecological feedbacks and life-history characteristics may all play a role in determining when FSD occurs. Here, we develop eco-evolutionary models with explicit ecological dynamics to explore the ecological, epidemiological and host life-history drivers of FSD. Our key result is to demonstrate for the first time that specificity between hosts and parasites is not required to generate FSD. Furthermore, highly specific host–parasite interactions produce unstable, less robust stochastic fluctuations in contrast to interactions that lack specificity altogether or those that vary from generalist to specialist, which produce predictable limit cycles. Given the ubiquity of ecological feedbacks and the variation in the nature of specificity in host–parasite interactions, our work emphasizes the underestimated potential for host–parasite coevolution to generate fluctuating selection.