# Parasite-mediated predation determines infection in a complex predator–prey–parasite system

## Abstract

The interplay of host–parasite and predator–prey interactions is critical in ecological dynamics because both predators and parasites can regulate communities. But what is the prevalence of infected prey and predators when a parasite is transmitted through trophic interactions considering stochastic demographic changes? Here, we modelled and analysed a complex predator–prey–parasite system, where parasites are transmitted from prey to predators. We varied parasite virulence and infection probabilities to investigate how those evolutionary factors determine species’ coexistence and populations’ composition. Our results show that parasite species go extinct when the infection probabilities of either host are small and that success in infecting the final host is more critical for the survival of the parasite. While our stochastic simulations are consistent with deterministic predictions, stochasticity plays an important role in the border regions between coexistence and extinction. As expected, the proportion of infected individuals increases with the infection probabilities. Interestingly, the relative abundances of infected and uninfected individuals can have opposite orders in the intermediate and final host populations. This counterintuitive observation shows that the interplay of direct and indirect parasite effects is a common driver of the prevalence of infection in a complex system.

### 1. Introduction

Food webs are complex networks composed of species and governed by their interactions, whereby consumers feed on resources to gain energy [1,2]. When a species goes extinct, its local network may also disappear from the food web, potentially altering the system’s stability and dynamics [3]. While food webs tend to be robust to random losses, some species may play crucial roles in maintaining the food web integrity and therefore are likely to cause the greatest damage if removed [4]. The degree of impact caused by the loss of a species is characterized by its number of interactions with other species and the degree of specialization of those interactions [3].

Parasites represent large biomass on Earth [5] and are involved in about 75% of food web links [6]. Parasites impact their host population through changes in body condition [7], behaviour [8] and reproduction [9]. Fighting parasite exposure demands mounting an immune response which is energetically costly and, as such, exposure without infection can result in lower reproductive investment and fecundity than unexposed hosts [10–12]. This parasitic outcome has been observed in snail–trematode systems, for instance, and is common in insects infected by protozoans, nematodes and cestodes [10]. The consequences of infection go beyond a single population because hosts are connected with other species, such as predators and prey [13]. In natural systems, parasites can infect multiple hosts directly or via trophic interactions [14]. Trophically transmitted parasites provide natural biological indicators of trophic links because they are the accumulated consequence of long-term feeding by their hosts [15,16], and are common in nature [5]. For example, the tapeworm *Schistocephalus solidus* uses copepods and fish as first and second intermediate hosts, before trophically reaching the final bird host [17]. The nematodes *Camallanus lacustris* and *Anguillicola crassus* are trophically transmitted and use the three-spined stickleback *Gasterosteus aculeatus* as a paratenic host [18]. Some trophically transmitted parasites can even manipulate the behaviour of their intermediate prey host in ways that increase consumption rates, and therefore transmission to their final predator host [19–21]. This flux transfer has consequences on the food web connectance and stability [22]. Despite their ecological importance, however, the mechanisms driving the dynamics of trophically transmitted parasites are not well understood [16].

From an ecological perspective, biological populations exhibit a large spectrum of dynamical behaviour from stable equilibrium points, to stable cyclic oscillations and chaotic dynamics [23]. The latter can refer to the appearance of aperiodic cycles in population dynamics and may occur when the *per capita* rate of increase exceeds some threshold value [24]. A biological system is considered internally stable if it does not experience significant changes in its characteristics and returns to a steady state after a perturbation [23]. Theoretical work on a complex food web model demonstrates that the fluctuations in predator–prey population dynamics change according to the attack rate of the predator [25]. The model shows that too inefficient or too aggressive predators result in vigorous population fluctuations and prevent predator–prey coexistence [25]. In various predator–prey–parasite models, the infection of only predator species [26,27], only prey species [28–31], or both predator and prey species but by different parasites [32], can impact predator–prey population dynamics. The inclusion of parasites in predator–prey systems often leads to chaotic dynamics [33–35] because epidemiological processes (such as disease) can alter the death and birth rates of the predator and prey hosts and lead to aperiodic cycles in predator–prey dynamics. While previous models illustrate the effects of parasitism on predator–prey interactions, they often focus on the infection of single host species (either the prey or the predator) or do not consider stochastic demographic fluctuations [36,37]. Here, we focus on species coexistence and the prevalence of infection in different trophic levels when the parasite mandatorily infects both the prey and the predator under stochastic demographic changes.

Besides classical predator–prey cycles often referred to as total abundances in each species, subpopulations of infected and uninfected hosts coexist at equilibrium [38]. The relative frequencies of infected and uninfected hosts are likely to be relevant in community dynamics. While parasites are not entirely or instantly fatal to their hosts [14], their consumptive effects may result in trait-mediated trophic cascades [39]. When infection is highly detrimental to the prey, a high frequency of infected prey may have a bottom-up effect on the food web, e.g. the reduction of prey species (bottom) is followed by the population decline of its consumers (up) [40]. Also, a high frequency of infected prey increases the probability of parasite transmission to higher trophic levels. When infection is highly detrimental to the predator, a high frequency of infected predators may lead to top-down effects because the reduction of predator (top) abundance relaxes the predation pressures on the prey, allowing the prey (down) to reproduce more rapidly [40]. The resulting increase in prey abundance leads to stronger pressures on lower trophic levels such as smaller prey or plants. These cascading effects can impact community structure and dynamics [41] as well as ecosystem functioning [41,42]. The strength and frequency of parasite-mediated trophic cascades will be determined by the susceptibility of the host to the parasite [42] and the magnitude of fitness costs due to infection [39].

Here, we built an individual-based model to capture such a complex predator–prey–parasite system, based on microscopic events, including reproduction, intrinsic death, competition, infection and predation for relevant species. Note that when applying individual-based modelling in ecological systems, we refer to individuals as microscopic components and populations and communities as macroscopic organizational levels, hence microscopic events refer to individual-level events [43]. In our model, the parasite is transmitted trophically from infected prey to predators [17,18]. We investigated the extent to which different factors such as the infection probabilities and parasite virulence (here defined by the reproductive costs imposed on infected hosts) [10–12,44] affect the transmission and persistence of the trophically transmitted parasite. We decomposed the predator and prey populations into infected and uninfected subpopulations to identify the parameters that influence the stable states among the three species.

While using a stochastic individual-based model, we also wrote down the rate equations of microscopic reactions to analyse the average dynamics of our system, which resembles the population-level models like classical generalized Lotka–Volterra equations [45,46]. Although stochastic dynamics normally agrees with its corresponding deterministic system in large populations, it allows random demographic fluctuations which are important in some evolutionary scenarios, especially for extinctions of small populations [47]. Since antagonistic interactions such as those between parasites and hosts, and prey and predators, often lead to cyclic dynamics, where population sizes could drop and go through deep valleys, we are interested in how stochasticity arising from the individual level will impact the coexistence of the three species and their population composition (i.e. frequencies of infected and uninfected host individuals).

The focus of this work is not to rebuild predator–prey–parasite systems, which have been well studied in the past. Instead, we constructed a new framework to include key parameters such as reproduction costs and infection probability and analysed how these parameters can impact species coexistence. Our results provide a foundation to understand a coevolving system, which can be extended from our model by allowing those key parameters to evolve through new mutations under the interplay of ecology and evolution.

### 2. Methods

We consider a system with three species, prey, predator and parasite (figure 1) denoted by *X*, *Y* and *Z*, respectively, in our microscopic reactions, which represent individual-level events like reproduction, death, competition, infection and predation. Since the parasite will infect an intermediate host (the prey) before being transmitted trophically to the definitive host (the predator), there are two distinct subtypes within each host species, the infected and uninfected. We denote the infected and uninfected prey populations by *X*_{I} and *X*_{U}, and the infected and uninfected predator populations by *Y*_{I} and *Y*_{U}. While reactions and their rates are defined at the individual level, how often, for example, reproduction or predation happens at the population level will also depend on the population abundances. For example, predation takes place in the predation rate per individual encounter multiplied by the prey and predator abundance. In the absence of the parasite, the prey and predator population interactions are described by a damped Lotka–Volterra model [48–50].

#### (a) Microscopic reactions of individuals from the three species

In the absence of the other species, the prey populations can be described by the following reactions, where ${g}_{x}\in {\mathbb{R}}^{+}$ is the reproduction rate of the prey, *r*_{x} ∈ [0, 1] is reproductive costs on infected prey. Here, $K\in {\mathbb{R}}^{+}$ is the environmental carrying capacity of the prey population, where we assume intra-specific competition increases mortality in the population level but does not affect reproduction. While we already apply a cost of infection in reproduction, we assume that infection does not influence the competition outcome between infected and uninfected prey. However, this cost of competition can be easily implemented if necessary. We note here that infected prey offspring are uninfected [17,18].

*S*, where $S\in {\mathbb{R}}^{+}$. It is then infected with probability

*Q*

_{x}∈ [0, 1]. When a parasite successfully infects the prey, the parasite is removed from the free-living parasite population. Otherwise, it remains in the free-living parasite population.

*f*

_{y}. The reproduction efficiency of the predator by consuming is

*k*

_{y}∈ [0, 1], which means a consumed prey gives rise to at most one predator offspring. When an uninfected prey meets an uninfected predator, we have the following reactions:

*Q*

_{y}∈ [0, 1]. If the predator is successfully infected by the parasite through consumption of infected prey, the infected predator’s ability to reproduce is affected by the presence of the parasite and hence is reduced according to parameter

*r*

_{p}∈ [0, 1]. Meanwhile, the parasite transmitted from the primary host, the prey, will reproduce within the definitive host, the predator, and have ${n}_{z}\in {\mathbb{Z}}^{+}$ offspring per successful infection. This indicates that in our model, the free-living parasites will only be released after a parasite finishes its life cycle and reproduces in its final hosts, and thus is coupled with the success of predation.

*r*

_{e}∈ [0, 1]. We assume that the reproductive cost due to infection is larger than the one due to exposure. Hence,

*r*

_{p}≤

*r*

_{e}.

*r*

_{p}. Note that parasite reproduction already happened when this predator was infected the first time, thus is not redundantly included here.

*r*

_{p}. The parasite transmitted by this newly encountered prey will reproduce in its final host because this is the first time this predator is infected by this individual parasite.

*r*

_{e}. Thus, in the following reaction where the predator reproduces,

*r*

_{e}refers to the cost of exposure in this encounter and

*r*

_{p}refers to the cost of previous infection:

*d*

_{x},

*d*

_{y}and ${d}_{z}\in {\mathbb{R}}^{+}$ denoting that for the prey, predator and parasite, respectively. While we already apply a cost of infection or exposure in reproduction, we assume the same intrinsic death for infected and uninfected individuals for the sake of simplicity. However, costs on death due to infection can be easily implemented as an extension.

We use a standard Gillespie algorithm [51,52] to perform stochastic simulations of the time evolution of the prey and predator subtypes and the parasite. See table S1 of the electronic supplementary material for the corresponding propensity equations and reactions. A summary of parameters is given in table 1.

parameter | definition |
---|---|

g_{x} |
reproduction rate of the prey |

r_{x} |
reproductive cost on the prey due to parasite infection |

d_{x} |
intrinsic death rate of the prey |

K |
environmental carrying capacity of the prey |

S |
scaling factor for prey–parasite interactions |

n_{z} |
offspring per reproduction of the parasite |

d_{z} |
intrinsic death rate of the parasite |

f_{y} |
predation rate |

k_{y} |
reproduction rate of the predator |

r_{p} |
reproductive cost on the predator due to parasite infection |

r_{e} |
reproductive cost on the predator due to parasite exposure |

d_{y} |
intrinsic death rate of the predator |

Q_{x} |
infection probability of parasite–prey |

Q_{y} |
infection probability of parasite–predator |

#### (b) Deterministic rate equations based on microscopic reactions

We can analyse the average population dynamics by writing down the deterministic equations based on the above reactions. We introduce *x*, *y* and *z* to represent the population abundance of the prey, predator and parasite, respectively, where $x,y,z\in {\mathbb{R}}^{+}$. We use subscripts to distinguish the infected and susceptible prey and predator subtypes. We let *x*_{I} and *x*_{U} denote the infected and uninfected prey subpopulations, *y*_{I} and *y*_{U} denote the infected and uninfected predator subpopulations, and *x* and *y* for the total population. Thus, *x* = *x*_{I} + *x*_{U} and *y* = *y*_{I} + *y*_{U}. We derive a set of ordinary differential equations from the microscopic reactions, where $\dot{{x}_{I}}$, $\dot{{x}_{U}}$, $\dot{{y}_{I}}$, $\dot{{y}_{U}}$ and $\dot{z}$ denote the rates of change of corresponding populations with respect to time:

### 3. Results

#### (a) Equilibrium analysis for the deterministic system

We first analyse the coexistence of all three species based on our deterministic equations. When the parasite enters the predator–prey system, it must have a basic reproduction value greater than unity to become endemic. Given the parasite can only reproduce in an infected predator, we show that the parasite can always invade a predator–prey system if *S*, *Q*_{x}, *Q*_{y}, *z* > 0 (see §2.1 of the electronic supplementary material). We note here that a feature of the deterministic system considered is the coexistence of all species when *z* > 0.

When, *z* > 0, we have two scenarios, stable coexistence of all species or chaotic dynamics, as *t* → ∞. We can obtain the equilibria when $\dot{{x}_{I}}=\dot{{x}_{U}}=\dot{{y}_{I}}=\dot{{y}_{U}}=\dot{z}=0$ for *x*_{I}, *x*_{U}, *y*_{I}, *y*_{U}, *z* > 0. The steady state of infected prey population, ${{x}_{I}}^{\ast}$, is a solution to the following polynomial (see details in §2.2 of the electronic supplementary material):

*α*=

*Q*

_{x}

*S*,

*β*=

*Q*

_{y}

*f*

_{y},

*γ*=

*r*

_{p}

*k*

_{y}

*f*

_{y},

*δ*=

*k*

_{y}

*f*

_{y}, $\u03f5=({r}_{e}{k}_{y}(1-{Q}_{y})-(1-{r}_{p}{k}_{y}){Q}_{y}){f}_{y}$, $\zeta =({r}_{p}{r}_{e}{k}_{y}(1-{Q}_{y})+{{r}_{p}}^{2}{k}_{y}{Q}_{y}){f}_{y}$,

*η*=

*n*

_{z}

*Q*

_{y}

*f*

_{y}and

*λ*=

*β*/

*d*

_{y}. From ${{x}_{I}}^{\ast}$, we determine the remaining steady-state populations ${{x}_{U}}^{\ast}$, ${{y}_{I}}^{\ast}$, ${{y}_{U}}^{\ast}$,

*z** as the following:

When there is no reproductive cost (*r*_{p} = 1, *r*_{x} = 1, *r*_{e} = 1), we observe the coexistence of all species, where our stochastic simulations fluctuate around the numerical simulations of the rate equations and converge to the analysed equilibrium when time increases (figure 2). For a complete reproductive reduction of infected predators without altering other parameters (*r*_{p} = 0, *r*_{x} = 1, *r*_{e} = 1), the deterministic dynamics are cyclic and the predator population can drop into deep valleys with small values but always exists. However, the small predator population can go extinct in stochastic simulations and lead to a very different outcome, i.e. the predator species vanishes first followed by the parasite and the prey species recovers to fluctuate around its own carrying capacity (electronic supplementary material, figure S9).

#### (b) Patterns of parasite, predator and prey coexistence

We further explore all possible outcomes of species coexistence, where one (prey), two (prey and predator) or three (prey, predator and parasite) species coexist over the long term. In the absence of reproductive costs (*r*_{p} = 1, *r*_{x} = 1, *r*_{e} = 1), the coexistence of the three species is more likely with increasing infection probabilities of hosts (*Q*_{x}, *Q*_{y}) under both deterministic and stochastic dynamics (figure 3*a*,*d*, magenta). This is because parasites with complex life cycles must be efficient at infecting both trophic levels to reach maturity and reproduce. Interestingly, the three species coexist in a narrower range of infection probabilities of the predator host than of the prey host, with a threshold of *Q*_{y} > 0.25 and *Q*_{x} > 0.07, respectively. Given that the parasite needs both hosts in its life cycle, these differences could stem from the predator population being smaller than the prey population.

When considering a reproductive cost only on the infected predator (*r*_{p} ∈ [0, 1], *r*_{x} = 1), we found that the stochastic simulations still agree well with the deterministic predictions in most parameter regions (figure 3*b*,*c*,*e*,*f*). For high reproductive costs on infected predators (small *r*_{p}), the predator population becomes very small due to increasing infections either in prey (*Q*_{x}) or in predator (*Q*_{y}). Consequently, we observe the extinction of predator species first followed by the parasite (figure 3, cyan). However, if the infection probability of either host is too small (small *Q*_{x} or small *Q*_{y}), the parasite will not be able to be maintained in the system, which leads to a coexistence of only the prey and the predator (figure 3, yellow). The threshold to avoid parasite extinction is higher in the infection probability of the predator (*Q*_{y}) than the infection probability of the prey (*Q*_{x}). For a complete reduction of reproduction on the predator due to infection (*r*_{p} = 0), there are intermediate ranges of *Q*_{x} and *Q*_{y} values, where the three species can coexist. This range increases when the reproductive costs on infected predators decrease (increasing *r*_{p}). We see a similar pattern if there is a reproductive cost only on the infected prey (electronic supplementary material, figure S11B,C,E,F), i.e. under a complete reduction of reproduction on the prey due to infection (*r*_{x} = 0), the three species coexist in an intermediate range of *Q*_{x} and *Q*_{y} values and this range increases with increasing *r*_{x}. Finally, when there are reproductive costs both on the prey and the predator (electronic supplementary material, figure S11A,D), the coexistence of the three species only happens when the costs on both hosts are below certain thresholds.

In the border parameter regions between coexistence and extinction, while there is only one possible outcome in deterministic dynamics, both coexistence and extinction can happen in stochastic repeats under the same parameter values. This illustrates the importance of stochasticity and demographic fluctuations in species coexistence. In addition, there is a small shift between the clear border of the deterministic dynamics and the vague border of the stochastic dynamics, where there is a slightly wider region of three-species coexistence (figure 3, magenta) under the deterministic dynamics compared to the stochastic dynamics. This is likely to arise from stochastic extinction in abundance cycles under species interactions. In the deterministic dynamics, even if an abundance cycle is with large amplitudes under coexistence, i.e. small population sizes in the valleys, the species will not go extinct because the dynamics are deterministic. However, in the stochastic dynamics, such cycles with deep valleys can lead to species’ extinction at random, thus all possible outcomes can happen among independent realizations in a given parameter set. This explains why the deterministic dynamics for three-species coexistence is slightly larger than the stochastic dynamics.

#### (c) Frequency of uninfected and infected host subtypes

We consider the composition of infected and uninfected host subpopulations when the predator, prey and parasite coexist (figure 4). As expected, infected individuals are more frequent than their uninfected counterparts with increasing infection probabilities and a threshold of *Q*_{x} > 0.18 and *Q*_{y} > 0.36, in both the deterministic and stochastic simulations (figure 4*a*,*d*, cyan). Similarly, uninfected hosts coexist with the parasite at higher frequencies than their infected counterparts under lower infection probabilities (figure 4*a*,*d*, magenta).

Interestingly, we found that all combinations of subpopulations’ coexistence are possible, albeit at very different likelihoods. For instance, we often observe that a higher number of infected predators is combined with a higher amount of uninfected prey (figure 4, yellow). This combination happens when the parasite is more efficient at infecting the predator than the prey, with a threshold of *Q*_{x} = [0.12–0.69] and *Q*_{y} > 0.41 (figure 4*a*,*d*, yellow). If *Q*_{y} = 1 and *r*_{p} = 1, which refers to the highest infection probability of the predator without any cost, this outcome happens in a small parameter range of infection probabilities of the prey *Q*_{x} = [0.12–0.18] (figure 4*b*,*e*, yellow). Contrarily, with high reproductive costs on infected predators (small *r*_{p}), this parameter space increases and we see a high frequency of uninfected prey regardless of the infection probabilities of both hosts (figure 4*b*,*c*,*e*,*f*, magenta and yellow). This suggests that the prey population can recover from infection when parasite pressure leads to few predators, which relaxes the predation pressures on the prey.

A high frequency of infected prey combined with a high frequency of uninfected predators is the least common outcome, yet an interesting one (figure 4, black). This combination of host frequencies occurs in a parameter space in which the parasite is less efficient at infecting the predator than the prey (with a threshold of *Q*_{y} = 0.33–0.38), combined with low reproductive costs on infected predators (*r*_{p} > 0.6). Due to the complex life cycle of the parasite, the predator must eat infected prey to be exposed to the parasite. When there is a high availability of infected prey, the transmission of the parasite to the predator ultimately depends on the predator’s resistance/susceptibility. This explains why, when the infection probability of the predator is high (*Q*_{y} = 1), we do not see the coexistence of infected prey and uninfected predators at high frequencies according to any probability of the parasite infecting the prey (figure 4; electronic supplementary material, figure S12B,E). With low reproductive costs on infected predators, the predator population recovers rapidly from infection because we assume that the parasite is not vertically transmitted to the next generation [17,18]. In addition, when the predator is less efficient at consuming the prey, the predator population is unable to recover from infection, regardless of the type of prey that is available.

To further investigate the conditions leading to a high frequency of infected prey and uninfected predators, we tested the effects of the parameters when *Q*_{y} = 0.35, which is in the critical parameter range resulting in these frequencies of host subpopulations. We found that the variation in the probability of prey infection (*Q*_{x}) and reproductive costs on infected prey (*r*_{x}) become practically irrelevant (figure 5*b*,*e*). Instead, this outcome is mainly driven by low reproductive costs on infected predators (large *r*_{p}). This suggests that the probability of the parasite infecting the prey is ultimately mediated by the predation pressures which are, in turn, mediated by the parasite-mediated selection, hence revealing an indirect parasite effect.

Again, we observe a difference between the deterministic and stochastic results especially at the border regions between the yellow and magenta areas in figure 5*a*,*d*. The definitions of yellow and magenta areas in figure 5 differ only in the order of the subpopulation sizes of uninfected and infected predators. At low *r*_{x} and *r*_{p} values, the subpopulation sizes of uninfected and infected predator populations are relatively close in deterministic dynamics (see electronic supplementary material, figure S10). Thus, given the nature of the stochastic dynamics, we expect some variation in the classification between yellow and magenta in this parameter space.

### 4. Discussion

Growing evidence suggests that parasites mediate trophic interactions [41,42] and that predators regulate host–parasite interactions [53,54]. Yet, the interplay of those dynamics remains understudied, particularly when parasites have complex life cycles [16]. To address this knowledge gap, we implemented an individual-based model of a complex predator–prey–parasite system, where the parasite is transmitted trophically from infected prey to predators. We showed that the infection probabilities of both host species and parasite virulence (reproductive costs on infected hosts) determine the coexistence of the three species (figure 3; electronic supplementary material, figure S11). We compared our deterministic simulation results with stochastic dynamics. In almost all parameter regimes, the stochastic simulations agree well with deterministic predictions. In the border regions (e.g. between coexistence and extinction in the parameter space), while only one outcome is possible under deterministic dynamics for each parameter set, both coexistence and extinction can happen in different stochastic realizations. This demonstrates the relevance of demographic fluctuations in species coexistence. When decomposing the host populations into uninfected and infected subpopulations, we found multiple stable states of the three species which are determined by the infection probabilities and parasite virulence across the trophic levels (figure 4).

Generally, we show that the three species are more likely to coexist with increasing infection probabilities of both hosts because parasites with complex life cycles need to infect both trophic levels to develop and reproduce [55,56]. Interestingly, our results further show that, for the persistence of the parasite, the probability of infecting the predator is more critical than the probability of infecting the prey (figure 3*a*,*d*). Given that the parasite needs both hosts in its life cycle, these differences could stem from the different population sizes of the predator and prey. We suggest that the parasite needs to be more efficient at infecting the predator because the encounter probabilities between uninfected predators and infected prey are lower than those between free-living parasites and uninfected prey. A non-excluding alternative explanation is that the availability of infected or uninfected prey becomes less relevant when the parasite is inefficient at infecting the predator, i.e. with a low probability of infecting the predator. Our finding that infecting the predator is more critical for the persistence of the parasite could possibly explain why selection leads to the manipulation of intermediate hosts by trophically transmitted parasites [19,57]. When the likelihood of finding a predator is low, the manipulation of the intermediate host (the prey) enhances parasite fitness by increasing the probability of infected prey being more eaten than non-infected prey. Recent theoretical work demonstrates that strong host manipulation can stabilize community dynamics and allow a trophically transmitted parasite to coexist with its intermediate and final hosts [58].

Previous deterministic models of parasite dynamics within simple communities predict that parasites should generally go extinct before their hosts [59]. Here, using complex communities, we show similar patterns whereby, in most cases, the parasite goes extinct before the predator, but the prey always survives. Our simulations, however, reveal that both the predator and the parasite can go extinct with high reproductive costs on either host combined with medium to high probabilities of the parasite infecting either host (figure 3; electronic supplementary material, figure S11, cyan). This result is consistent with theoretical work on a predator–prey–parasite system where the parasite infects only the prey, showing that when the prey population is infected at a low rate, and the predator has low reproductive potential, the extinction of both the predator and the parasite can happen [60]. We suggest, however, that the underlying mechanisms are different when considering a parasite that must infect both trophic levels. In our simulations, indeed we show that the extinction of both predator and parasite happens with low reproductive potential of the predator, however, in combination with medium to high probabilities of the parasite infecting both hosts (figure 3*b*,*c*,*e*,*f*, cyan). This pattern emerges because, in that parameter space, the predator population size is small. Furthermore, our results indicate that, due to the parasite’s complex life cycle, the fitness of one host (estimated in the form of reproductive success) can change with the probability of the other host getting infected. These complex interactions are reflected in our simulations, where the likelihood of predator–parasite co-extinction increases with high infection probabilities of the predator combined with high reproductive costs on infected prey (electronic supplementary material, figure S11C,F, cyan), as well as with high infection probabilities of the prey combined with high reproductive costs on infected predators (figure 3*b*,*e*, cyan). These results illustrate an indirect parasite effect on predator–prey dynamics and highlight the ecological relevance of complex species interactions.

To better understand the dynamics of the parasite’s demography, we decoupled the predator and prey populations into uninfected and infected subpopulations when the parasite coexists with the predator and the prey at a stable equilibrium. The most common outcome of our simulations reveals a high frequency of infected predators coexisting with a high frequency of infected prey (figure 4, cyan). As expected, the frequencies of infected hosts are higher with increasing infection probabilities and are lower with decreasing infection probabilities. Intuitively, due to the parasite’s complex life cycle, we expected the frequencies of infected and uninfected predator subpopulations to match with those of the prey. Yet, although less common, in some parameter spaces, this is not the case. Particularly, with high reproductive costs on infected predators there is a high frequency of uninfected prey, regardless of the infection probabilities of both hosts (figure 4*b*,*c*,*e*,*f*, magenta and yellow). Overall, we see that the prevalence of infection in the prey population is mostly driven by the reproductive costs on infected predators (figure 4*b*,*c*,*e*,*f*) rather than the reproductive costs on infected prey (electronic supplementary material, figure S12A–F). As the reproductive costs on infected predators increase, the predator population size drops, hence relaxing the predation pressures on the prey. Consequently, the prey population size recovers mostly with uninfected prey, illustrating an indirect parasite effect on the prey through the predator.

We found that the least likely combination of host subpopulations is a high frequency of infected prey coexisting with a high frequency of uninfected predators (figure 4, black). While this outcome is interesting, it is rare and happens in a narrow parameter space of infection probability of the predator *Q*_{y} = [0.33–0.38], combined with low reproductive costs on infected predators *r*_{p} > 0.6. Given that our model does not assume vertical transmission of the parasite to the prey or predator offspring [17,18], we expected the prey population to recover from infection in the absence of reproductive costs on infected prey. Surprisingly, the likelihood of observing a higher frequency of infected prey coexisting with a higher frequency of uninfected predators increases with lowering reproductive costs on infected prey (figure 5, black). We suggest that the prey recovers slower from infection due to strong predation pressures in this parameter space, particularly as the infection probability is higher on the prey than on the predator. This result is coherent with the healthy herd hypothesis, which proposes that the dynamics of prey–parasite interactions are determined by the predator population size and parasite virulence [53]. Also, experimental evidence shows that the parasite’s impact on the population size of an intermediate consumer is obscured by that of the predator when predators are abundant [29], which is a characteristic we found often in our system.

In natural systems, parasites can be virulent, and yet sometimes do not cause significant changes in host density [61]. For instance, Duffy & Hall theoretically tested the effects of two parasites, the bacterium *Spirobacillus cienkowskii* and the yeast *Metschnikowia bicuspidata*, on the common freshwater invertebrate *Daphnia dentifera* [61]. While both parasites are known to be virulent, only bacterial epidemics led to significant changes in the host density. Interestingly, they found that the rapid evolution of host resistance to the yeast parasite combined with predation mostly on infected hosts decreased the prevalence of infection and minimized host density decline [61]. Further theoretical work on eco-epidemiological models, where the parasite infects the prey population, showed that the predators’ preference for uninfected and infected prey individuals plays a significant role in the system dynamics and stability [32,60]. We suggest that these dynamics may be different in systems where the parasite is transmitted trophically because the infection probabilities and parasite virulence can vary across trophic levels [62].

Based on our results, we propose that the combination of host subpopulations in different trophic levels may have important ecological consequences. For instance, if a predator evolves the capacity to eat preferentially uninfected prey, high predation pressures will result in a prey population of highly abundant infected individuals [53]. The resulting high incidence of infected prey may lead to a higher likelihood of transmission of the parasite to other predators that lack a discriminative feeding behaviour. We suggest that the transmission of these parasites to other predator species will ultimately depend on multiple factors such as parasite virulence and the immunity of those hosts. Similarly, a high incidence of infected predators or a high incidence of infected prey may lead to trophic cascades [40] with potentially important consequences at the community level [41,42].

Overall, we demonstrate that the interplay of direct and indirect parasite effects along a food web is a common driver of the prevalence of infections. The parasite can impact the host population directly through the reproductive costs resulting from infection, or indirectly via changing the demography of the interacting species, i.e. the predator or the prey of the host. The combination of infection probabilities and reproductive costs on infected hosts of different trophic levels determines the internal stability of the system because parasites change the demography of the host populations (a direct parasite effect) and, consequently, predator–prey dynamics (an indirect parasite effect). Moreover, by analysing the dynamics of different host subpopulations, we provide quantitative data on the prominent features of a multi-species system driving the dynamics of a trophically transmitted parasite. In some parameter spaces, we show that both extinction and coexistence can happen in different stochastic realizations. Although we focus on a static predator–prey–parasite system, the stochastic uncertainties might lead to completely different evolutionary outcomes when mutations and coevolution happen. We propose that integrating the evolution of host resistance and parasite infectivity in complex models may reveal important aspects of these complex interactions because the rates of infection vary according to host–parasite coevolution. Particularly, hosts from different trophic levels may coevolve with the parasite differently, according to their population sizes and parasite virulence. Yet, our study provides new insights into the mechanisms driving the dynamics of trophically transmitted parasites, with important implications for forecasting and managing the spread of diseases in natural ecosystems.

### Ethics

This work did not require ethical approval from a human subject or animal welfare committee.

### Data accessibility

All code associated with this paper are available online at https://github.com/WeiniHuangBW/Predator-Prey-Parasite.

The data are provided in electronic supplementary material [63].

### Declaration of AI use

We have not used AI-assisted technologies in creating this article.

### Authors' contributions

A.C.H.I.: conceptualization, investigation, methodology, visualization, writing—original draft, writing—review and editing; A.M.: conceptualization, investigation, methodology, visualization, writing—original draft, writing—review and editing; C.E.: conceptualization, supervision, writing—review and editing; W.H.: conceptualization, methodology, supervision, writing—original draft, writing—review and editing.

All authors gave final approval for publication and agreed to be held accountable for the work performed therein.

### Conflict of interest declaration

We declare we have no competing interests.

### Funding

A.C.H.I. is funded by the Mexican National Council for Science and Technology (CONACYT), grant no. 837236. C.E. is supported by UKRI grant nos. NE/L002485/1, NE/V001469/1.

## Acknowledgements

We would like to thank the editors and two anonymous reviewers for their insightful comments. A.C.H.I. generated figure 1 using BioRender software.

### References

- 1.
Montoya JM, Pimm SL, Solé RV . 2006 Ecological networks and their fragility.**Nature**, 259-264. (doi:10.1038/nature04927) Crossref, PubMed, Web of Science, Google Scholar**442** - 2.
Allesina S, Alonso D, Mercedes P . 2008 A general model for food web structure.**Science**, 658-661. (doi:10.1007/978-3-8349-8915-4_3) Crossref, PubMed, Web of Science, Google Scholar**320** - 3.
Allesina S, Bodini A, Bondavalli C . 2006 Secondary extinctions in ecological networks: bottlenecks unveiled.**Ecol. Modell.**, 150-161. (doi:10.1016/j.ecolmodel.2005.10.016) Crossref, Web of Science, Google Scholar**194** - 4.
Allesina S, Bodini A . 2004 Who dominates whom in the ecosystem? Energy flow bottlenecks and cascading extinctions.**J. Theor. Biol.**, 351-358. (doi:10.1016/j.jtbi.2004.05.009) Crossref, PubMed, Web of Science, Google Scholar**230** - 5.
Kuris A 2008 Ecosystem energetic implications of parasite and free-living biomass in three estuaries.**Nature**, 515-518. (doi:10.1038/nature06970) Crossref, PubMed, Web of Science, Google Scholar**454** - 6.
Lafferty K, Dobson A, Kuris A . 2006 Parasites dominate food web links.**Proc. Natl Acad. Sci. USA**, 11 211-11 216. (doi:10.1073/pnas.0604755103) Crossref, Web of Science, Google Scholar**103** - 7.
Anaya-Rojas J, Brunner F, Sommer N, Seehausen O, Eizaguirre C, Matthews B . 2016 The association of feeding behaviour with the resistance and tolerance to parasites in recently diverged sticklebacks.**J. Evol. Biol.**, 2157-2167. (doi:10.1111/jeb.12934) Crossref, PubMed, Web of Science, Google Scholar**29** - 8.
Lion S, Van Baalen M, Wilson W . 2006 The evolution of parasite manipulation of host dispersal.**Proc. R. Soc. B**, 1063-1071. (doi:10.1098/rspb.2005.3412) Link, Web of Science, Google Scholar**273** - 9.
Lockley E 2020 Long-term survey of sea turtles (*Caretta caretta*) reveals correlations between parasite infection, feeding ecology, reproductive success and population dynamics.**Sci. Rep.**, 18569. (doi:10.1038/s41598-020-75498-4) Crossref, PubMed, Web of Science, Google Scholar**10** - 10.
Hurd H . 2001 Host fecundity reduction: a strategy for damage limitation?**Trends Parasitol.**, 363-368. (doi:10.1016/S1471-4922(01)01927-4) Crossref, PubMed, Web of Science, Google Scholar**17** - 11.
Sorensen RE, Minchella DJ . 2001 Snail-trematode life history interactions: past trends and future directions.**Parasitology**, S3-S18. (doi:10.1017/s0031182001007843) Crossref, PubMed, Web of Science, Google Scholar**123** - 12.
Eizaguirre C, Lenz TL, Kalbe M, Milinski M . 2012 Rapid and adaptive evolution of MHC genes under parasite selection in experimental vertebrate populations.**Nat. Commun.**, 621. (doi:10.1038/ncomms1632) Crossref, PubMed, Web of Science, Google Scholar**3** - 13.
Raffel T, Hoverman J, Halstead N, Michel P, Rohr J . 2010 Parasitism in a community context: trait-mediated interactions with competition and predation.**Ecology**, 1900-1907. (doi:10.1890/09-1697.1) Crossref, PubMed, Web of Science, Google Scholar**91** - 14.
Lafferty KD, Kuris AM . 2002 Trophic strategies, animal diversity and body size.**Trends Ecol. Evol.**, 507-513. (doi:10.1080/10428190410001683697) Crossref, Web of Science, Google Scholar**17** - 15.
Marcogliese DJ, Cone DK . 1997 Food webs: a plea for parasites.**Trends Ecol. Evol.**, 320-325. (doi:10.1016/s0169-5347(97)01080-x) Crossref, PubMed, Web of Science, Google Scholar**12** - 16.
Lafferty KD 2008 Parasites in food webs: the ultimate missing links.**Ecol. Lett.**, 533-546. (doi:10.1111/j.1461-0248.2008.01174.x) Crossref, PubMed, Web of Science, Google Scholar**11** - 17.
Hammerschmidt K, Koch K, Milinski M, Chubb JC, Parker GA . 2009 When to go: optimization of host switching in parasites with complex life cycles.**Evolution**, 1976-1986. (doi:10.1111/j.1558-5646.2009.00687.x) Crossref, PubMed, Web of Science, Google Scholar**63** - 18.
Krobbach CK, Kalbe M, Kurtz J, Scharsack JP . 2007 Infectivity of two nematode parasites,*Camallanus lacustris*and*Anguillicola crassus*, in a paratenic host, the three-spined stickleback*Gasterosteus aculeatus*.**Dis. Aquat. Organ.**, 119-126. (doi:10.3354/dao074119) Crossref, PubMed, Web of Science, Google Scholar**74** - 19.
Lafferty KD, Kimo Morris A . 1996 Altered behavior of parasitized killifish increases susceptibility to predation by bird final hosts.**Ecology**, 1390-1397. (doi:10.2307/2265536) Crossref, Web of Science, Google Scholar**77** - 20.
Poulin R . 2010 Parasite manipulation of host behavior: an update and frequently asked questions.**Adv. Study Behav.**, 151-186. (doi:10.1016/S0065-454(10)41005-0) Crossref, Web of Science, Google Scholar**41** - 21.
Hafer N . 2016 Conflicts over host manipulation between different parasites and pathogens: investigating the ecological and medical consequences.**BioEssays**, 1027-1037. (doi:10.1002/bies.201600060) Crossref, PubMed, Web of Science, Google Scholar**38** - 22.
Neutel A, Heesterbeek J, De Ruiter P . 2002 Stability in real food webs: weak links in long loops.**Science**, 1120-1123. (doi:10.1126/science.1068326) Crossref, PubMed, Web of Science, Google Scholar**296** - 23.
May RM . 1974 Biological populations with nonoverlapping generations: stable points, stable cycles, and chaos.**Science**, 645-647. (doi:10.1126/science.186.4164.645) Crossref, PubMed, Web of Science, Google Scholar**186** - 24.
May RM . 1976 Simple mathematical models with very complicated dynamics.**Nature**, 459-467. (doi:10.1201/9780203734636) Crossref, PubMed, Web of Science, Google Scholar**261** - 25.
Gutiérrez Al-Khudhairy OU, Rossberg AG . 2022 Evolution of prudent predation in complex food webs.**Ecol. Lett.**, 1055-1074. (doi:10.1111/ele.13979) Crossref, PubMed, Web of Science, Google Scholar**25** - 26.
Haque M, Venturino E . 2007 An ecoepidemiological model with disease in predator: the ratio-dependent case.**Math. Methods Appl. Sci.**, 1791-1809. (doi:10.1002/mma.869) Crossref, Web of Science, Google Scholar**30** - 27.
Auger P, Mchich R, Chowdhury T, Sallet G, Tchuente M, Chattopadhyay J . 2009 Effects of a disease affecting a predator on the dynamics of a predator-prey system.**J. Theor. Biol.**, 344-351. (doi:10.1016/j.jtbi.2008.10.030) Crossref, PubMed, Web of Science, Google Scholar**258** - 28.
Hilker F, Malchow H . 2006 Strange periodic attractors in a prey-predator system with infected prey.**Math. Popul. Stud.**, 119-134. (doi:10.1080/08898480600788568) Crossref, Web of Science, Google Scholar**13** - 29.
Banerji A, Duncan A, Griffin J, Humphries S, Petchey O, Kaltz O . 2015 Density- and trait-mediated effects of a parasite and a predator in a tri-trophic food web.**J. Anim. Ecol.**, 723-733. (doi:10.1111/1365-2656.12317) Crossref, PubMed, Web of Science, Google Scholar**84** - 30.
Khan QJ, Al-Lawatia M, Al-Kharousi FA . 2016 Predator–prey harvesting model with fatal disease in prey.**Math. Methods Appl. Sci.**, 2647-2658. (doi:10.1002/mma.3718) Crossref, Web of Science, Google Scholar**39** - 31.
Adak D, Bairagi N, Hakl R . 2020 Chaos in delay-induced Leslie–Gower prey–predator–parasite model and its control through prey harvesting.**Nonlinear Anal.: Real World Appl.**, 102998. (doi:10.1016/j.nonrwa.2019.102998) Crossref, Web of Science, Google Scholar**51** - 32.
Lenbury Y, Rattanamongkonkul S, Tumrasvin N, Amornsamankul S . 1999 Predator-prey interaction coupled by parasitic infection: limit cycles and chaotic behavior.**Math. Comput. Modell.**, 131-146. (doi:10.1016/S0895-7177(99)00186-7) Crossref, Google Scholar**30** - 33.
Upadhyay RK, Bairagi N, Kundu K, Chattopadhyay J . 2008 Chaos in eco-epidemiological problem of the Salton Sea and its possible control.**Appl. Math. Comput.**, 392-401. (doi:10.1016/j.amc.2007.06.007) Web of Science, Google Scholar**196** - 34.
Bairagi N, Adak D . 2016 Switching from simple to complex dynamics in a predator-prey-parasite model: an interplay between infection rate and incubation delay.**Math. Biosci.**, 1-14. (doi:10.1016/j.mbs.2016.03.014) Crossref, PubMed, Web of Science, Google Scholar**277** - 35.
Das K, Bairagi N, Sen P . 2016 Role of alternative food in controlling chaotic dynamics in a predator-prey model with disease in the predator.**Int. J. Bifurcation Chaos**, 1650147. (doi:10.1142/S0218127416501479) Crossref, Web of Science, Google Scholar**26** - 36.
Fenton A, Rands S . 2006 The impact of parasite manipulation and predator foraging behavior on predator-prey communities.**Ecology**, 2832-2841. (doi:10.1890/0012-9658(2006)87[2832:TIOPMA]2.0.CO;2) Crossref, PubMed, Web of Science, Google Scholar**87** - 37.
Fenton A, Perkins SE . 2010 Applying predator-prey theory to modelling immune-mediated, within-host interspecific parasite interactions.**Parasitology**, 1027-1038. (doi:10.1017/S0031182009991788) Crossref, PubMed, Web of Science, Google Scholar**137** - 38.
Nistal R, De La Sen M, Alonso-Quesada S, Ibeas A, Garrido AJ . 2015 On the stability and equilibrium points of multistaged*SI*(*n*)*R*epidemic models.**Discrete Dyn. Nat. Soc.**, 379576. (doi:10.1155/2015/379576) Crossref, Web of Science, Google Scholar**2015** - 39.
Buck J, Ripple W . 2017 Infectious agents trigger trophic cascades.**Trends Ecol. Evol.**, 681-694. (doi:10.1016/j.tree.2017.06.009) Crossref, PubMed, Web of Science, Google Scholar**32** - 40.
Heath M, Speirs D, Steele J . 2014 Understanding patterns and processes in models of trophic cascades.**Ecol. Lett.**, 101-114. (doi:10.1111/ele.12200) Crossref, PubMed, Web of Science, Google Scholar**17** - 41.
Brunner F, Anaya-Rojas J, Matthews B, Eizaguirre C . 2017 Experimental evidence that parasites drive eco-evolutionary feedbacks.**Proc. Natl Acad. Sci. USA**, 3678-3683. (doi:10.1073/pnas.1619147114) Crossref, PubMed, Web of Science, Google Scholar**114** - 42.
Anaya-Rojas J, Best R, Brunner F, Eizaguirre C, Leal M, Melián C, Seehausen O, Matthews B . 2019 An experimental test of how parasites of predators can influence trophic cascades and ecosystem functioning.**Ecology**, e02744. (doi:10.1002/ecy.2744) Crossref, PubMed, Web of Science, Google Scholar**100** - 43.
Grimm V 2005 Pattern-oriented modeling of agent-based complex systems: lessons from ecology.**Science**, 987-991. (doi:10.1126/science.1116681) Crossref, PubMed, Web of Science, Google Scholar**310** - 44.
Heins DC, Ulinski B, Johnson J, Baker JA . 2004 Effect of the cestode macroparasite*Schistocephalus pungitii*on the reproductive success of ninespine stickleback,*Pungitius pungitius*.**Can. J. Zool.**, 1731-1737. (doi:10.1139/Z04-171) Crossref, Google Scholar**82** - 45.
Lotka AJ . 1920 Analytical note on certain rhythmic relations in organic systems.**Proc. Natl Acad. Sci. USA**, 410-415. (doi:10.1073/pnas.6.7.410) Crossref, PubMed, Google Scholar**6** - 46.
Black AJ, McKane AJ . 2012 Stochastic formulation of ecological models and their applications.**Trends Ecol. Evol.**, 337-345. (doi:10.1016/j.tree.2012.01.014) Crossref, PubMed, Web of Science, Google Scholar**27** - 47.
Huang W, Hauert C, Traulsen A . 2015 Stochastic game dynamics under demographic fluctuations.**Proc. Natl Acad. Sci. USA**, 9064-9069. (doi:10.1073/pnas.1418745112) Crossref, PubMed, Web of Science, Google Scholar**112** - 48.
Hirsch MW, Smale S, Devaney RL 2012**Differential equations, dynamical systems, and an introduction to chaos**, 3rd edn. Amsterdam, The Netherlands: Academic Press. Google Scholar - 49.
- 50.
Cherniha R, Davydovych V . 2022 Construction and application of exact solutions of the diffusive Lotka–Volterra system: a review and new results.**Commun. Nonlinear Sci. Numer. Simul.**, 106579. (doi:10.1016/j.cnsns.2022.106579) Crossref, Web of Science, Google Scholar**113** - 51.
Gillespie DT . 1977 Exact stochastic simulation of coupled chemical reactions.**J. Phys. Chem.**, 2340-2361. (doi:10.1021/j100540a008) Crossref, Web of Science, Google Scholar**81** - 52.
ineda Krch M . 2008 GillespieSSA: implementing the Gillespie stochastic simulation algorithm in R.**J. Stat. Softw.**, 1-18. (doi:10.18637/jss.v025.i12) Web of Science, Google Scholar**25** - 53.
Packer C, Holt RD, Hudson PJ, Lafferty KD, Dobson AP . 2003 Keeping the herds healthy and alert: implications of predator control for infectious disease.**Ecol. Lett.**, 797-802. (doi:10.1046/j.1461-0248.2003.00500.x) Crossref, Web of Science, Google Scholar**6** - 54.
Richards RL, Conner LM, Morris G, Drake JM, Ezenwa VO . 2022 Season and prey identity mediate the effect of predators on parasites in rodents: a test of the healthy herds hypothesis.**Oecologia**, 107-118. (doi:10.1007/s00442-022-05284-8) Crossref, PubMed, Web of Science, Google Scholar**201** - 55.
Lafferty K . 1992 Foraging on prey that are modified by parasites.**Am. Nat.**, 854-867. (doi:10.1086/285444) Crossref, Web of Science, Google Scholar**140** - 56.
Lafferty K . 1999 The evolution of trophic transmission.**Parasitol. Today**, 111-115. (doi:10.1016/S0169-4758(99)01397-6) Crossref, PubMed, Google Scholar**15** - 57.
Hafer-Hahmann N . 2019 Experimental evolution of parasitic host manipulation.**Proc. R. Soc. B**, 20182413. (doi:10.1098/rspb.2018.2413) Link, Web of Science, Google Scholar**286** - 58.
Rogawa A, Ogata S, Mougi A . 2018 Parasite transmission between trophic levels stabilizes predator–prey interaction.**Sci. Rep.**, 12246. (doi:10.1038/s41598-018-30818-7) Crossref, PubMed, Web of Science, Google Scholar**8** - 59.
De Castro F, Bolker B . 2005 Mechanisms of disease-induced extinction.**Ecol. Lett.**, 117-126. (doi:10.1111/j.1461-0248.2004.00693.x) Crossref, Web of Science, Google Scholar**8** - 60.
Bairagi N, Adak D . 2015 Complex dynamics of a predator-prey-parasite system: an interplay among infection rate, predator’s reproductive gain and preference.**Ecol. Complex.**, 1-12. (doi:10.1016/j.ecocom.2015.01.002) Crossref, Web of Science, Google Scholar**22** - 61.
Duffy MA, Hall SR . 2008 Selective predation and rapid evolution can jointly dampen effects of virulent parasites on Daphnia populations.**Am. Nat.**, 499-510. (doi:10.1086/528998) Crossref, PubMed, Web of Science, Google Scholar**171** - 62.
Leggett HC, Buckling A, Long GH, Boots M . 2013 Generalism and the evolution of parasite virulence.**Trends Ecol. Evol.**, 592-596. (doi:10.1016/j.tree.2013.07.002) Crossref, PubMed, Web of Science, Google Scholar**28** - 63.
Hijar Islas AC, Milne A, Eizaguirre C, Huang W . 2024 Parasite-mediated predation determines infection in a complex predator–prey–parasite system. Figshare. (doi:10.6084/m9.figshare.c.7159040) Google Scholar