## Abstract

While invertebrates lack the machinery necessary for ‘acquired immunity’, there is increasing empirical evidence that exposure to low levels of disease may ‘prime’ an invertebrate's immune response, increasing its defence to subsequent exposure. Despite this increasing empirical data, there has been little theoretical attention paid to immune priming. Here, we investigate the evolution of immune priming, focusing on the role of the unique feedbacks generated by a newly developed susceptible–primed–infected epidemiological model. Contrasting our results with previous models on the evolution of acquired immunity, we highlight that there are important implications to the evolution of immunity through priming owing to these different epidemiological feedbacks. In particular, we find that in contrast to acquired immunity, priming is strongly selected for at high as well as intermediate pathogen virulence. We also find that priming may be greatest at either intermediate or high host lifespans depending on the severity of disease. Furthermore, hosts faced with more severe pathogens are more likely to evolve diversity in priming. Finally, we show when the evolution of priming leads to the exclusion of the pathogens or hosts experiencing population cycles. Overall the model acts as a baseline for understanding the evolution of priming in host–pathogen systems.

## 1. Introduction

For many vertebrate hosts, immunity to disease can be ‘acquired’, such that recovery with specific long-lasting memory results from previous infection with pathogens. While invertebrate hosts lack the machinery necessary for this acquired immunity, there is increasing evidence that immune memory in invertebrates may be ‘primed’ following exposure to low doses of disease, thereby reducing the potential for future infections [1,2]. Immune priming in invertebrates is, therefore, distinct from the typical acquired immunity in vertebrates, in that the immune memory does not occur following recovery from a period of being an infected and infectious individual. Rather, it is a phenomenon of a raised immune response following exposure to the pathogen. As such it is important to understand the ecological, epidemiological and evolutionary dynamics of immune priming as distinct from other forms of host defence.

Experimental evidence of the existence of immune priming in insect hosts has grown considerably in recent years. Priming has been identified in a range of insect hosts, including *Plodia interpunctella* [3], *Tribolium castaneum* [4], *Bombus terrestris* [5] and *Tenebrio molitor* [6], and results from exposure to immune elicitors such as lipopolysaccharides [6], heat-killed bacteria [4], live bacteria [5] and live virus [6]. Evidence of immune priming has also been found in other invertebrates such as *Daphnia magna* [7] and *Penaeus monodon* [8]. It is, therefore, becoming increasingly clear that immune priming may be common across a range of natural and laboratory disease systems. However, the implications of this form of immunity to the population and evolutionary dynamics of host–pathogen systems remain largely unexplored.

The evolution of host defence mechanisms to disease has now received considerable theoretical attention, focusing on the evolution of mechanisms of avoidance (lowered transmission [9]), tolerance (lowered virulence [10,11]) and clearance (increased recovery [9,12]). These studies have highlighted how the level of host defence that evolves depends on the ecological and epidemiological traits and the life-history costs associated with increased defence. The evolution of acquired immunity as a defence trait (where hosts become immune after recovering from disease) has also received some theoretical attention. Boots & Bowers [13] found that hosts are more likely to adopt long-lived immunity against fast-transmitting pathogens that cause intermediate virulence, and that coexistence of host types with short- and long-lasting immunity is also possible. Two further studies [14,15] have also shown that investment in immunity may be maximized at high or intermediate lifespans depending on whether or not immunity is permanent, and where the costs are incurred, whereas Garnier *et al*. [16] recently showed that maternal transfer of immunity should be maximized at high lifespans against pathogens with intermediate virulence. However, as of yet there has been no theoretical study of the evolution of immune priming. Two recent papers have, however, investigated the impact on host population dynamics, finding that immune priming can reduce the prevalence of infection considerably [17,18]. Furthermore, Tidbury *et al*. [18] found that the population dynamics of hosts with primed immunity are more complex than in classic models with acquired immunity, with the potential for bistability between disease-free and endemic states as well as for endemic cycles.

By allowing hosts to escape or delay infection, immune priming is likely to be subject to strong selection pressure, and it is, therefore, important to investigate immune priming from an evolutionary perspective. Here, we shall investigate the evolution of host immune priming. We develop a host–pathogen model to investigate how the epidemiological details impact on the host's investment in priming, and the possibility of diversification while paying particular attention to the interplay between the evolutionary dynamics and the underlying population dynamics.

## 2. Model

We use a similar framework to classical models of infectious disease [19] to construct a model that describes the dynamics of susceptible (*S*), primed (*P*) and infected (*I*) hosts with the following set of differential equations (cf. [18]):
2.1
2.2
2.3

All hosts are born susceptible at *per capita* birth rate *a*, which is reduced owing to crowding by a factor *cN* where *N* = *S*+*P*+*I* is the total population density. (As in the vast majority of host–pathogen evolutionary models, we assume that density dependence acts on host birth rate; but see Pugliese [20] and Best *et al.* [21] for examples of the impact of instead assuming density-dependent mortality, particularly on pathogen evolution.) All three host classes can produce offspring, but the fecundity of infected and immune primed hosts may be reduced by factors *f*_{I} and *f*_{P}, respectively. All hosts are subject to background mortality at death rate *b*. We assume direct transmission of disease with transmission coefficient *β*. When challenged with disease, we assume some proportion of susceptible hosts (*p*) are not fully infected, but are instead immune primed, whereas the remainder (1−*p*) become fully infected. Immune primed hosts benefit from immune protection, which limits the rate of reinfection by a factor *q*. As well as potentially suffering reduced fecundity, infected hosts suffer through a further death rate (defined here as virulence) *α*. For analytical ease, we make two notable simplifications to the model of Tidbury *et al*. [18]: we do not include maternal priming and we assume that priming is permanent (the impact of these assumptions is considered in §4).

Here, we focus on the evolutionary dynamics of priming, assuming that hosts are able to evolve the proportion of infections resulting in immune priming through the parameter *p*. Assuming a heterogeneous ‘dose distribution’ on challenge with disease, we note that *p* may be seen to represent the watershed where challenge results in infection rather than priming. Despite the compelling evidence for its existence, our understanding of the mechanisms behind immune priming in invertebrates is still relatively poor [22]. As such, it is hard to specify the mechanisms that are critical to the evolutionary response of hosts in their level of priming, but it is clear that this may involve pathways in both the recognition of pathogens and the strength of the response. We assume that any increase in priming is costly to the host elsewhere in its life history. As is standard in host evolutionary models, we assume that this cost to increased defence is through reduced reproduction, such that *a* = *a*(*p*), with *a′*(*p*) < 0 [9–14], though we recognize that these costs could be imposed elsewhere [9]. We note that all hosts pay the cost of this increased defence, not just primed hosts. We use the evolutionary framework of adaptive dynamics [23], assuming that rare mutants with priming trait *p*_{m}, which deviates slightly from the resident trait value, attempt to invade the resident equilibrium. The success of the invasion depends upon the mutant's invasion fitness, defined as its growth rate while rare. Using the next generation matrix [24] (see electronic supplementary material, §A), we calculate this invasion fitness to be
2.4and
2.5where superscript asterisks denote resident equilibrium densities. This invasion fitness expression yields a simple biological interpretation: taking *ϕ _{i}* to be the rate at which susceptible mutants enter the class

*i*and

*T*to be the average time period spent in class

_{i}*i*, the invasion fitness is the relative reproductive output of a mutant host in its lifetime (for the full calculation and expression of

*s*, see electronic supplementary material, §A). If the invasion fitness is greater than zero, the density of the mutant population will increase to invade the resident population. Contrastingly, if the invasion fitness is less than zero then the density of the mutant population will decrease and will die out. Through a series of mutations and substitutions, the host population will evolve in the direction of the local selection gradient, until an evolutionary singularity, a (potentially temporary) ‘stopping point’ of evolution, is reached where the selection gradient is zero [23]. This gives a condition on the gradient of the evolutionary trade-off at the singular point, 2.6which is always negative provided

*f*

_{P}(

*b*+

*α*) >

*f*

_{I}

*b*. Throughout this paper we assume

*f*

_{P}= 1 (primed hosts reproduce fully), meaning that this condition is always satisfied and, therefore, it is possible for a singularity to exist.

The evolutionary behaviour at the singularity depends upon the combination of two second-order terms: evolutionary stability (ES; whether the strategy is a local fitness maximum) and convergence stability (CS; whether the strategy is a local attractor) [23]. The singular strategy is evolutionarily stable if the following condition holds:
2.7where *a″*(*p*) is the curvature of the trade-off at the singular point. The singular strategy is convergence stable if This condition is algebraically complicated, involving terms in ∂*Y**/∂*p* and ∂*N**/∂*p*_{,} and is, therefore, omitted here for brevity.

We shall use a standard trade-off form for our numerical work, which links maximum and minimum values of *p* and *a* with a smooth curve with (at most) one inflection, the shape of which is controlled by the coefficient *λ* [25]. We shall always assume that the extremes of *p* are (*p*_{min},*p*_{max}) = (0,1), reducing our trade-off to
2.8which necessarily means *a′*(*p*) < 0, as required for the singular point to exist.

Previous work has revealed that this model can yield highly complex ecological dynamics, most notably endemic cycles [18]. In this case, because there are no fixed equilibrium values for the resident densities, we cannot rely on the invasion fitness expression given in equation (2.4). Instead in regions where the underlying population dynamics may be non-equilibrium, we use numerical methods to find the largest Lyapunov exponent, and, therefore, the invasion fitness, of an invading mutant and then produce pairwise invasion plots (PIPs) to analyse the evolutionary behaviour [25,26]. Two example PIPs are presented in figure 1. A range of possible resident priming rates form the *x*-axis and the same range of mutant priming rates the *y*-axis, and a fixed trade-off *a*(*p*) assumed. For each resident–mutant pair, the invasion fitness is calculated through the numerical methods described (the jagged appearance occurs because they are constructed from numerical simulations). Regions of positive mutant invasion fitness are then shaded black and regions of negative invasion fitness left white. Note that along the main diagonal, where *p* = *p*_{m}, the invasion fitness is necessarily zero. Assuming small mutational steps, the population will evolve up or down the diagonal until the singularity, marked by the grey dot, is reached where a second zero-fitness contour crosses the main diagonal. In the first example (figure 1*a*), the singular point is both convergence stable (attracting; black arrows) and evolutionarily stable (uninvadable; grey arrows), and is, therefore, a long-term attractor of evolution (a continuously stable strategy (CSS)). In the second example (figure 1*b*), the singular point is convergence stable (attracting; black arrows) but evolutionarily unstable (invadable; grey arrows), and is, therefore, an evolutionary branching point.

## 3. Results

### 3.1. No costs in immune priming

First, we briefly discuss the results where immune priming is cost-free. In this case, the selection gradient becomes 3.1

This does not depend on *p*, and as such the host population will either maximize or minimize priming, depending on whether the infected or primed class has the greater relative reproductive output. Given the assumption made above that *f*_{P} = 1, priming will always be maximized provided *α* > 0.

When immune priming is high, it can be shown that the underlying population dynamics are either a disease-free equilibrium or bistability between disease-free and endemic states [18]. Therefore, when priming is cost-free and the host maximizes its investment, the host will evolve towards a region where the pathogen may be at risk of being excluded. In particular, if the population dynamics are bistable between endemic and disease-free states, environmental variation could change population levels from the endemic to the disease-free steady-state basin of attraction. Furthermore, if the system approaches the disease-free state directly, without passing through a bistable region, it can be shown that a further singular point exists at the exact point that the pathogen is excluded (i.e. *I* = 0), meaning that the host is able to evolve levels of priming that will exclude its pathogen (see the electronic supplementary material, §B1).

### 3.2. Trade-off shapes: costs to immune priming

We now include costs to priming through a trade-off with reproduction. Because the shape of the trade-off between life-history traits is known to be central to the evolutionary behaviour in ecological systems [27–29], we first consider the effect the trade-off shape has on the outcome. We fix an intermediate singular point at (*p*,*a*(*p*)) = (0.5,2) and then plot the boundaries of ES (solid lines) and CS (dashed lines) in terms of the trade-off curvature (*a″*(*p*)) as functions of three of the model parameters: virulence, infected reproduction (sterility) and reinfection (immune protection; figure 2). When the curvature is negative, then priming incurs ‘accelerating’ costs (i.e. each incremental increase in priming causes a greater loss of reproduction), positive curvature indicates ‘decelerating’ costs and a curvature of zero yields a linear trade-off.

In all cases accelerating trade-offs (*a″*(*p*) < 0) lead to CSSs (these are ES and CS, and end points of evolution), where the host population will evolve to the singular level of priming and then remain there. Similarly, strongly decelerating trade-offs (*a″*(*p*) > 1.5) always produce repellers (neither ES nor CS) where the population will evolve away from the singular point to maximum or minimum levels of priming (although it is possible for there to be further singular points to which the population will evolve), depending on the initial conditions. Between these two extremes, ‘weakly’ decelerating trade-offs may result in CSSs, repellers, Garden of Eden strategies (ES but not CS, but behave much like repellers) or branching points (CS but not ES, these points are attractors of evolution but local fitness minima, leading to disruptive selection and branching), depending on the parameters and the exact trade-off curvature. Evolutionary branching is most likely to occur against more severe pathogens (high virulence (figure 2*a*) and high sterility (figure 2*b*)) and at low rates of reinfection (figure 2*c*). Branching will lead to the coexistence of diverse types, one of which has a high reproduction rate but low priming and is, therefore, subject to high disease severity, and a second which has a low reproduction rate, but high priming meaning it can continue to reproduce for a greater time period. Below, we investigate the interplay of evolutionary and population dynamics for the CSS, branching point and repeller scenarios in more detail.

### 3.3. Continuously stable strategies

Choosing a trade-off between priming and reproduction that results in a CSS (choosing a curvature of *a″*(*p*) = −0.1), we examine how the model parameters affect the level of evolved priming in figure 3. The dots mark the CSS level of priming as predicted from PIPs, whereas the lines and shading demarcate regions of parameter space with different underlying population dynamics (calculated with the numerical continuation software AUTO that identifies the location and stability of fixed points for equations (2.1)–(2.3) for varying parameters [30]), namely endemic equilibria, endemic cycles, disease-free equilibria, and bistability between disease-free and endemic states.

Increasing virulence (figure 3*a*) generally selects for greater priming in hosts as infection is far more costly. As virulence approaches very high levels, the prevalence of infection falls and there is then a very gradual reduction in priming, though investment remains significant. Similarly, introducing sterility (reduced infected reproduction; right-to-left in figure 3*b*) initially selects for greater priming, but for *f*_{I} < 0.7, the maximum level of priming possible is limited to below one owing to the presence of the disease-free equilibria for *p* < 1. This selection to higher priming at high severity (i.e. high virulence and sterility) also tends to move the system in to a region of parameter space where the population dynamics are bistable between disease-free and endemic equilibria (light shading), or cycles (dark shading). In these bistable regions, the population will remain at the endemic steady state, be it an equilibrium or cycle, unless there is some external change to the densities. We note that although the host often evolves on to the boundary of the disease-free region, where the pathogen would be excluded (figure 3*b*), it does not evolve in to this region to definitively exclude the pathogen. Again, decreasing reinfection produces a similar pattern to increased severity (figure 3*c*), with investment in priming largely increasing for higher immune protection as the benefit of being immune increases. However, at very high rates of protection (low *q*) investment falls, since here infection prevalence will be low, reducing the selection pressure.

We also consider how investment in priming varies with lifespan in figure 3*d*,*e* to allow comparison with previous results on acquired immunity [14], with hosts in figure 3*e* facing much more severe pathogens (i.e. high sterility and virulence). We find that short-lived hosts always have low investment in priming, as the prevalence of disease is low since few hosts will ever become infected. Against less severe pathogens (figure 3*d*), priming is highest at intermediate lifespans, whereas against more severe pathogens (figure 3*e*), priming is highest at long lifespans. Long-lived hosts will almost inevitably become infected, but if the pathogen is rather mild, infected hosts still make a considerable contribution to invasion fitness, and so selection for priming is rather weak. By contrast, if the pathogen is more severe, infected hosts will make little contribution to invasion fitness and long-lived hosts are, therefore, selected to delay infection for as long as possible. We also again find that hosts faced with more severe pathogens (figure 3*e*) are more likely to evolve in to regions of endemic cycles and bistability.

### 3.4. Evolutionary branching points

We show simulations of our system where we choose the trade-off curvature such that there is an evolutionary branching point at (*p*,*a*(*p*)) = (0.5,2) (*f*_{I} = 0, curvature *a*″(*p*) = 1.3) in figure 4*a* (for a description of the simulation procedure, see the electronic supplementary material, §C). Alongside the evolutionary trajectory, we plot the population dynamics at each point on the trajectory, plotting the resident densities of the two susceptible strains, (note that initially these two strains are in fact the same). The simulation clearly shows the population converging to the singular point then splitting into two strains. One strain then goes on to maximize priming, whereas the other appears not to minimize priming, but instead to approach a new attracting singular point at close to minimal priming. (The dashed line marks the point where two local maxima first arise.) Initially the host exhibits equilibrium population dynamics (denoted by the solid line), and after branching the two strains emerge with distinct densities, but still exhibiting equilibria, as shown in the lower inset with the population dynamics of at evolutionary time = 300. However, as the lower host strain approaches the minimum at *p*_{1} = 0, the underlying population dynamics switch to cycles (denoted by the dots, which mark the upper and lower bounds of the cycles). This is shown in the upper inset with the population dynamics of at evolutionary time = 600. Investigations in AUTO (not shown) confirm that two coexisting strains close to extremes of the trade-off will exhibit endemic cycles.

We now choose parameter values such that the branching point occurs where the underlying population dynamics are cycles (*p*,*a*(*p*)) = (0.8,1.8) (*f*_{I} = 0, curvature *a*″(*p*) = 0.68). Again the simulation in figure 4*b* shows the population branch in to two strains, one of which goes on to maximize priming, whereas the other again appears to adopt an intermediate attracting singular point created in the two-host system. Unlike the previous example, here the underlying population dynamics remain as cycles for the duration of the evolutionary trajectory (compare the two insets for the population dynamics of at evolutionary time = 800 and 1500). We found no values of *p*_{1} or *p*_{2} for which equilibria were predicted.

### 3.5. Repellers

We now choose a trade-off that produces a repeller at the chosen singular point (*p*,*a*(*p*)) = (0.5,2) (*q* = 0.2, curvature *a″*(*p*) = 0.75). The host population will then either maximize or minimize priming depending on the initial conditions (or, potentially, reach a new singular point). From figure 3, it is clear that whenever selection maximizes priming then the population is moved towards a region where the population dynamics are either bistable between disease-free and endemic states, or purely disease-free. In figure 5*a*, we plot simulation output for this system showing the level of priming invested in by the host, alongside the resident susceptible (*S**) and infected (*I**) population densities for the resident strains. The simulations show that the population repels from the singular point towards maximum priming, moving in to a region of bistable population dynamics. The host then evolves across the endemic to disease-free ‘catastrophe’ into a region where the pathogen can no longer persist, as shown by the infected density dropping to zero. (Note at this point, there is a discontinuity in the selection gradient as the population switches to a new set of population dynamic equilibria with *I* = 0.) The inset PIP in figure 5*a* highlights this behaviour, showing that selection is to move away from the repeller, and that mutants with higher priming continue to have positive fitness at the boundary of the disease-free equilibria (grey region), such that these types will invade and eradicate the pathogen. Thereafter, because there is no pathogen present and priming is costly, the host abandons investment in priming and minimizes, leading to an increase in the susceptible density. However, for these lower rates of priming the pathogen *R*_{0} > 1, meaning the disease-free population dynamics equilibrium is in fact unstable, and any future exposure to the pathogen will result in an immediate return to the endemic state.

The above results assume that the population evolves through a bistable region and across the endemic to disease-free catastrophe. In the electronic supplementary material, §B2, we show that if the system approaches the disease-free state directly, without passing through the bistable region, then a further singular point must exist at an endemic steady state, preventing the extinction of the pathogen. Interestingly, we find that this second singular point is often an evolutionary branching point. This is seen in figure 5*b*, where we show evolutionary simulations alongside the population densities of the (two) susceptible strain(s) (*q* = 0.1, curvature *a″*(*p*) = 0.75), which shows the population initially evolves away from the repeller at *p* = 0.5, but reaching a branching point at *p* = 0.8. The existence of these two singular points can be seen clearly from the PIP in the inset. However, we see that after branching the upper strain goes extinct, leaving only the strain with minimal investment in priming (note there is no branching–extinction cycle here, as the lower host strain has evolved beyond the evolutionary repeller). Similar behaviour is found to occur where the population would approach an endemic to disease-free catastrophe, but must first pass through a region of endemic cycles: a further branching point exists in the cycling region that prevents exclusion from occurring.

## 4. Discussion

By allowing hosts to delay or even escape infection, immune priming is crucially distinct from acquired immunity, where hosts must first become infected before becoming immune. We have found that the level of costly immune priming selected for is strongly impacted by the severity of the pathogen, with highly virulent and sterilizing pathogens selecting for much greater priming, and that evolutionary branching is more likely in hosts encountering these more damaging pathogens. We have also highlighted how the evolution of priming feeds back to the underlying population dynamics, with hosts often evolving in to regions of bistable and cyclic population dynamics. The evolution of immune priming may therefore result in highly complex evolutionary and epidemiological dynamics.

By reducing infection and its associated costs, immune priming may increase the host's chances of future reproduction. The benefit of priming, therefore, clearly increases as hosts face more damaging pathogens. Both increased virulence (owing to the reduced lifespan) and increased sterility (owing to the reduction in reproductive ability whilst infected), therefore, largely act to increase selection for immune priming. It is clear, therefore, that immune priming should be expected to be favoured in natural systems where pathogens are highly damaging to their hosts. Indeed, in a recent empirical study, Tidbury *et al*. [3] showed immune priming is selected for in *P. interpunctella* hosts exposed to low levels of PiGV, a natural virus that is an obligate killer. Similarly, maternal immune priming in *D. magna* has been found following infection with a sterilizing bacterial parasite, *Pasteuria ramose* [7]. These empirical examples indeed suggest that immune priming may be common in invertebrates faced with highly damaging pathogens. Furthermore, our results show that high disease severity and high immune protection are more likely to allow for evolutionary branching in hosts. We would, therefore, predict that such systems may be more likely to display within-population diversity in priming.

A key insight from our model is that the evolutionary characteristics of immune priming are very different from those of acquired immunity. We have found that selection for priming remains high against highly virulent pathogens as hosts always look to escape infection, even if prevalence is low. By contrast, acquired immunity is unlikely to evolve at high rates of virulence, because hosts infected with highly virulent pathogens are unlikely to ever recover to immunity, limiting the benefit of investing in acquired immunity [13]. We have also shown that immune priming may be selected for most strongly in hosts with intermediate or long lifespans, depending on the severity of the pathogen. Short-lived hosts are unlikely to be challenged by disease and, therefore, there is little selection for priming. By contrast, long-lived hosts will almost certainly become infected, and the benefits of priming then depend on the contribution they can make to invasion fitness while infected. Miller *et al*. [14] found that selection for permanent acquired immunity is maximized at intermediate lifespans, but due to a somewhat different mechanism to immune priming. In the model considered by Miller *et al*. [14], infection prevalence is lowest for long-lived hosts, and, therefore, there is little selection pressure for immune defences. In our immune priming model, prevalence is in fact greatest for long-lived hosts, because all hosts will almost inevitably become infected, but the fitness loss of infection may not be enough to select for greater priming. However, selection for long-lasting (but not permanent) immunity [14] and maternal transfer of immunity [16] are always strongest at high host lifespans. The evolution of immunity in general is clearly in need of greater study to understand these complex feedbacks between immunity, epidemiology and evolution.

Here, we have focused on the evolution of the priming mechanism itself (i.e. the parameter *p* in our model). Of course, a second stage of this process is the level of immune protection that priming provides; that is, how easily primed hosts become reinfected (the parameter *q* in our model). Given the similar epidemiological role of these two processes, we may expect the evolution of immune protection to exhibit similar behaviour to that found here, but further work is required to confirm this. Also, it may be assumed that rather than leading to a level of immunity, priming results in a ‘low-level’ infection, whereby these hosts still make a small contribution to the force of infection and suffer a low rate of virulence, but to a much lesser extent than full infection. The dynamics of such a ‘tolerance priming’ mechanism are unclear intuitively and would require dedicated studies. To limit the complexity of the analysis in this initial model, we have made some key simplifications to the susceptible–primed–infected (SPI) model as proposed by Tidbury *et al*. [18]. In particular we assumed that priming is permanent, and that there is no maternal priming. Maternal priming appears to be a common feature of insect-disease systems [3,5,7], but we have little knowledge of how long immune priming lasts. In the purely epidemiological SPI model, reducing the period of immune priming was found to slightly reduce the potential for endemic population cycles, whereas maternal priming increased the potential for cycles [18]. It is, therefore, important that these processes, as well as further epidemiological and ecological factors, are incorporated into subsequent models to confirm that the dynamics predicted here are broadly applicable to experimental and empirical systems.

We have shown how the evolutionary trajectory of immune priming is likely to cause hosts to pass through different regions of underlying population dynamics, including regions of endemic cycles. There are relatively few studies investigating evolutionary dynamics with non-equilibrium underlying population dynamics [25,31,32], particularly in continuous-time models. Note that we do not force non-equilibrium dynamics for all parameter space, but instead allow the population to evolve through different regions of underlying dynamics. Although we found that the population dynamics before branching were maintained immediately after branching, we found that in the long-run endemic cycles tended to dominate. This contrasts with Hoyle *et al*. [32] who found that the behaviour after branching is always preserved in a discrete-time logistic model, perhaps suggesting that our continuous-time immune priming model has a propensity for population cycles when there is coexistence. Furthermore, it has been previously shown in discrete-time models that population cycles can lead to evolutionary branching through the creation of singular points that would not be present in the same system where there are equilibrium dynamics [25]. We have also shown that branching points can exist near the boundary of the disease-free and endemic states, notably where the underlying population dynamics are cyclic. In general, we have found that evolutionary branching is possible for a range of parameter values where the trade-off between priming and reproduction is weakly decelerating. Interestingly, we found that in general the lower strain does not minimize its investment, but instead maintains an intermediate level of priming. This may again be linked to the tendency of the dimorphic system to produce cyclic population dynamics, and the consequent creation of further attracting singular points.

We have also shown that evolution may lead to the host moving into regions of bistable population dynamics between endemic equilibria or cycles and disease-free equilibria. In these regions, significant alterations in the environment may move the system in to a different basin of attraction in the population dynamics, potentially excluding the pathogen. Moreover, we have shown cases where evolution can exclude a pathogen by the trajectory moving across an endemic to disease-free catastrophe. Often, however, deterministic exclusion of the pathogen is prevented owing to the existence of an attracting singular point close to the disease-free boundary. In these regions, the prevalence of infection is so low that there is little selection to increase priming to the point where there is extinction (but see [33]). Clearly, however, immune priming may be an important mechanism in hosts escaping the damaging effects of pathogens.

Immune priming is being increasingly recognized as an important route to immunity in a range of invertebrate systems [1,2]. We have shown that the evolution of immune priming can create complex dynamics, with highly severe pathogens creating particularly strong selection pressures. Not only do these damaging pathogens select for high investment in priming in hosts, but also they tend to create conditions suitable for the creation of within-population diversity in priming, leading to non-equilibrium population dynamics and may lead to the exclusion of the pathogen. It is clear that a greater understanding of immune processes, and immune priming in particular, is needed for clearer predictions of disease dynamics.

- Received October 29, 2012.
- Accepted December 4, 2012.

- © 2012 The Author(s) Published by the Royal Society. All rights reserved.