Interactions between different predator–prey states: a method for the derivation of the functional and numerical response

In this paper we introduce a formal method for the derivation of a predator’s functional response from a system of fast state transitions of the prey or predator on a time scale during which the total prey and predator densities remain constant. Such derivation permits an explicit interpretation of the structure and parameters of the functional response in terms of individual behaviour. The same method is also used here to derive the corresponding numerical response of the predator as well as of the prey.


Introduction
The functional response is defined as the average number of prey captured per individual predator per unit of time as a function of the population densities of the prey, the predator or both. Well known examples are the Holling I, II and III (Holling 1959) and the Beddington-DeAngelis (DeAngelis et al. 1975;Beddington 1975) functional responses. While the Holling type II functional response was derived using a time budget argument, the Holling type III as well as the functional response by Beddington and DeAngelis were introduced without an explicitly modelled underlying mechanism. However, as we show here, these responses (and many more) can be derived from a system of fast state transitions of the prey or predator during which the total prey and predator densities remain constant.
For example, Metz and Diekmann (1986) derived the Holling type II functional response assuming two predator states, searching and handling, where the transition from the searching to the handling state is the result of an actual prey capture. As a consequence, the equilibrium distribution of predator densities over the two states depends on the prey density: the higher the prey density, the greater the proportion of the individual predators in the handling state and, since it is only the searching predators that capture the prey, the average number of prey captured per predator per unit of time varies with the prey density exactly as described by Holling. Likewise, the Beddington-DeAngelis functional response, whose traditional interpretation is in terms of predator interference, was derived in a different context by Geritz and Gyllenberg (2012). They assumed two prey states, exposed and hiding, in addition to the two predator states of searching and handling. The transition from the exposed to the hiding state is mediated by the encounter with the predator. The equilibrium density distributions of both the prey and the predator over their respective states, therefore, depend on one another's population density. As searching predators capture only exposed prey, the functional response now is not just a function of the prey density, as in the Holling type II functional response, but also of the density of the predator itself.
Equally important as the functional response are the numerical responses of the prey and the predator. One distinguishes between demographic and aggregative numerical responses. The latter is a consequence of individuals moving in space and will not be considered here. The demographic numerical response is the rate of change in population density due to birth and death as a function of the population densities of the prey, the predator or both. The same individual-level processes that determine the functional response can also determine the numerical response. Examples of how the numerical response of the prey can depend on the density of the predator (other than through prey capture) have been given by Gyllenberg (2013, 2014).
Most predator-prey models in the literature are special cases of the model by Gause (1934) and Gause et al. (1936) where X and Y are the densities of the prey and the predator, respectively, g(X ) is the per capita growth rate of the prey population if the predator is absent, f (X ) is the predator functional response, γ > 0 is defined as the conversion factor of prey into predator offspring and δ > 0 is the per capita natural mortality rate of the predator.
The predator's numerical response (through birth) in Eq. (1) is given by the term γ f (X ). However, the linear relationship between the predator's numerical response and its functional response is lost if different prey-handling states have different fertility levels. In this paper we give an example with two predator states (starving and wellfed) where the former hunts to survive (but does not reproduce) while the latter hunts to reproduce. The proportion of predator individuals in each state depends on the prey density such that at low prey densities there are relatively more starving predators. This leads to a nonlinear relation between the numerical and functional responses, which on the population level can be described by a non-constant conversion factor γ (X , Y ).
Likewise, if searching and handling predator individuals have different death rates and their relative densities vary with the prey density, then the mean death rate will vary accordingly. Moreover, if two prey states (like exposed and hiding) have different birth or death rates, and if the relative densities of the states depend on the predator density (as in a previous example), then the numerical response of the prey will depend on the predator density in a way that is not directly linked to prey capture. All in all this leads to the more general model Once the states and state transitions have been specified, the expressions for f , g, γ and δ as functions of both X and Y follow automatically.
Functional responses provide a connection between two levels of description of a biological population: the microscopic level, where the interactions between individual behavioural states are described, and a macroscopic level, where only the population size is tracked. The interplay between behavioural states and functional responses has been the focus of numerous research works, see e.g. Pettorelli et al. (2015), Abrams (2015), Jeschke et al. (2002) and Alexander et al. (2012). More recently, several teams are trying to understand the impact of stochasticity (due, for instance, to stochastic interactions between predators and prey, or to the limited number of individuals involved). For more details on stochastic models, we refer to Johansson and Sumpter (2003), while the connection between stochastic and deterministic models is discussed by Dawes and Souza (2013). Moreover, Billiard et al. (2018) have analysed the first deviation from the deterministic dynamics implied by stochastic effects.
In the context of global warming and rapid changes of species range, the quantitative information provided by functional responses is a valuable tool to understand population dynamics. Recent studies on invasive species have adopted this approach, for example Dick et al. (2013), Barrios-O'Neill et al. (2015), Taylor and Dunn (2018) and Crookes et al. (2019), while other teams are using this notion to discuss the efficiency of biocontrol agents, as given by Cabral et al. (2009) and Schenk and Bacher (2002). In both cases, the precise description provided by the functional response proves key to understanding the effect of the antagonistic behaviour on biodiversity and species density. Other works investigate further the quantitative capabilities of functional responses: they develop fitting methods and algorithms to estimate the parameters of the models, see Pritchard et al. (2017), Skalski and Gilliam (2001) and Rosenbaum and Rall (2018).
In this article, we consider that both the predator and the prey population are structured by behavioural states. We give a formal method for the mechanistic derivation of a predator's functional response which provides a clear interpretation of the population dynamics in terms of the underlying individual level processes. In addition, we apply the same method to derive the corresponding numerical response of the predator and the prey as well.
Section 2.1 is focused on the time scale separation argument and the general method used to derive the functional and numerical responses. In Sect. 2.2, we discuss the existence and uniqueness issues for the fast dynamics that are necessary to apply the time scale separation idea. We illustrate these notions with a canonical example in Sect. 3.
In Sects. 4 and 5, we consider two cases where either the prey population or the predator population is structured by behavioural states, while the other species is only described by its total density. An interesting outcome is that the conversion rate and the death rate of the predator population are no longer constant if we suppose that the behavioural states of the predator population impact its reproduction rate or mortality rate. In Sect. 6, we consider a case where both populations are structured by behavioural states. In spite of the more complex interaction structure, we show that it is still possible to understand the fast dynamics of the model and to derive explicitly the functional and numerical responses. In each section, we compare the functional responses that we obtain with the well known functions of Holling and Beddington and DeAngelis.
In Sect. 7, we discuss the advantages and drawbacks of our approach.

The model
Consider a predator-prey model with x = (x i ) m i=1 and y = (y i ) n i=1 where x i and y i denote the densities of the prey population and the predator population in the various states. By assuming that the transitions between the different states are fast, we can ignore slower processes such as birth and decay.
The ordinary differential equations which model the fast time scale scenario are given by with the consistency conditions on the parameter values The prey move from state i to state k with rate A ki , with k, i ∈ [1, m]. They leave state i at rate A ii and enter one of the k = i states with k ∈ [1, m] at rate A ki with k = i, k ∈ [1, m], such that (4) follows. When interacting with predators in state j, prey individuals in state i leave their state at rate B (i) i j and move into one of the k = i m]. Then, the consistency condition in (5)  i j or spontaneously with rate D ki . As for the prey transitions, the consistency conditions on the parameter values which characterise the interactions between the predator states are given in (6) and (7).
Note however that the model is not fully general since it does not include prey-prey or predator-predator interactions, nor the formation of complexes of (possibly multiple) prey or predator individuals, such as the formation of groups (see e.g. Geritz and Gyllenberg 2013). For example, stalking of the prey and unsuccessful attacks can be modelled as fast reactions, but they involve mixed predator-prey states. These cases fall outside the general framework presented here, as we include only pure prey and pure predator states. However, while including prey-prey or predator-predator interactions as well as mixed predator-prey states is straightforward for concrete applications (see, for example, Jeschke et al. 2002), it becomes more difficult to give a general qualitative analysis of the fast dynamics. Moreover, we consider only two separate time scales. The approach can be readily extended to multiple time scales.
In order to derive the corresponding functional response on the slow time scale, it is necessary that the fast dynamics settles on a unique hyperbolically stable steady state (x,ŷ), wherex andŷ denote the population column vectors.
We calculate the functional response by considering the total number of prey in state i caught with capture rate β i j by an individual predator in state j over the size Y of the predator population with X denoting the size of the prey population. Likewise, the prey numerical response can be expressed as where λ i and μ i are respectively the per capita birth and natural mortality rates corresponding to the prey state i. Next, for the predator, let γ i j and δ j denote respectively the per capita fecundity of a predator in state j that has captured a prey in state i and the per capita natural mortality rate of a predator in state j. Then the predator's numerical response is given by are respectively the density-dependent conversion factor and mortality rate. The equilibrium on the short time scale gives the frequency distribution of individuals over the various states. This is the same as the distribution of the amount of time that a single individual spends in the various states. Therefore, the population level responses on the long time scale result from time-averaging on the short time scale.
Note that the function γ does not have a direct interpretation in terms of the individual behaviour. It is a population level model component that we introduce here in order to give the equation in the form of the predator-prey model in (1). The functional form of the product of γ and f , on the other hand, does have an individual level interpretation, which is given in Eq. (10).

Existence and uniqueness of the fast dynamics equilibrium
The system in (3) can be rewritten in matrix form as The matrices A + B(y), A and B(y) in M m (R), where we use the notation M m (R) to denote the m × m-matrix space over R, are non-negative off-diagonal matrices and have negative main diagonal entries. The same conditions apply to the matrices C(x) + D, D and C(x) in M n (R).
In the linear case, when B = 0, C = 0, because of the consistency conditions, the matrices A and D correspond to the transition rate matrices of a continuous time Markov chain and the system in (11) becomes ẋ = Aẋ y = Dy Under the assumption that this Markov chain is irreducible and aperiodic, there exists a unique stationary distribution π , corresponding to the fast dynamics steady state we are looking for and which can be found by solving the system in (11). Furthermore, the convergence to the limit distribution is exponentially fast. As shown in the example in Sect. 3, a similar argument is used in the triangular case, when the transitions of one of the two species are not affected by the other population densities.
Alternatively, when we consider the non-linear case (B, C = 0), the existence of the equilibrium corresponding to the fast dynamics is guaranteed by the Perron-Frobenius Theorem and Shauder's Fixed Point Theorem. We give the detailed proof in the "Appendix A". However, the uniqueness of this equilibrium is more difficult to establish.
When we consider a model with a small number of states (typically 4 states in total), the uniqueness and hyperbolic stability of the steady states can often be checked directly. This is the case of the application that we will discuss in Sect. 6, where the hyperbolic stability of the fast dynamics equilibrium is verified, as we show in the "Appendix C".
If the number of states is larger (more than 4 states in total), we have not been able to prove or refute the uniqueness and hyperbolic stability of the steady states under the assumptions presented in Sect. 2.1. If we relax these assumptions, however, we can show that it is possible to build examples where the uniqueness does not hold. In "Appendix D", we construct matrices A, B, C, D that satisfy the assumptions except for some diagonal coefficients of A and D that are equal to 0 (specifically A 11 = A nn = D 11 = D nn = 0). The fast dynamics has then at least two different steady states. This example, where the uniqueness is an issue, can be seen as a model for an actual biological system. Therefore the uniqueness problem appears not only as a mathematical challenge, but also as an important question for the general application of the method, which first of all requires a good understanding of the fast dynamics asymptotic behaviour.
The example discussed in Sect. 3 is a triangular case of (11), where B(y) = 0 for all y, while the applications in Sects. 4 and 5 model the scenario with A = 0 (i.e., only a single prey state) and B(y) = 0 for all y and Sect. 6 gives an application with the complete model form.
3 Application: when the transitions of the prey are not due to the interactions with the predator states.
Consider the following ODE system The equations in (13) do not take into account the movements between different prey states due to the interactions with the predator states, while the predator movements can be induced by the prey states. The equilibriumx for the fast dynamics satisfies the equation A ·x = 0. We denote by E m the matrix of ones in M m (R). Let X and Y be the total population sizes. Then,x satisfies the equation E m ·x =X, whereX denotes the vector of length m with all elements equal to X . Summing up the two equations, we obtain thatx = (A + E m ) −1 ·X . We repeat the same procedure with the system of equations given by (C(x)+D)·ŷ = 0, whereŷ denotes the column vector of length n of the predator states at equilibrium and (C(x) + D) the matrix in M n (R) evaluated atx. Furthermore,ŷ satisfies E n ·ŷ =Ȳ, whereȲ denotes the vector of length n with all elements equal to the total predator density Y . Then, the equilibrium is given byŷ Now we apply the above to the following matrix for the prey states The matrix is analogous to the transpose of the generator matrix corresponding to a birth-death process where the parameters A k+1,k and A k,k+1 are respectively the birth rates and the death rates. In this case, the prey transitions are not predator induced and occur only between neighbouring states. The prey leave the class x k with rate A kk = A k−1,k + A k+1,k . Moreover, the transitions from the (k − 1)-state and (k + 1)state to the k-state happen at rates A k,k−1 and A k,k+1 , as shown below: The ordinary differential equations for the k = 2, . . . , m − 1 states are while the fast dynamics of the k = 1, m states is modelled by We use the solution of the balance equation for the stationary distribution of the birth-death process. The equilibrium of the systemẋ = A · x is of the form Given the normalisation condition m k=1 x k = X for the total prey population, we obtainx We now set A i+1,i = A i Y , that is, we assume that the prey transitions from each state to the consecutive one are directly proportional to the total predator density. If, for example, consecutive prey states represent increasing levels of protection, then the prey are likely to move from the current state to the next one at higher predator densities. This applies to the context of prey defenses triggered by predator kairomones, e.g. chemo-signals which warn the prey of danger (see, for example, Papes et al. 2010, Apfelbach et al. 2005, Takahashi et al. 2005 Additionally, we assume that the predator has two states: searching and handling. In particular, we assume that the handling state includes every action of the predator that occurs after prey capture, such as the actual killing of the prey, carrying the prey to the lair, eating, digesting, resting and giving birth. On the other hand, the searching state is considered as an highly active state. Therefore, births happen only while the mother is in the handling state, although rarely enough to be negligible on the short time scale in order not to violate the assumption of constant total prey size. The ODE for the searching predators with density S and with attack rates (c i ) m i=1 corresponding to each prey state is given by where H is the density of the handling predators, 1 d is the average handling time and The fast dynamics equilibrium for the searching predators and the handling predators isŜ Since we include prey capture as a fast process, we need that the predator population size is much smaller than the prey population size, i.e. Y X , so that the effect of the prey capture on the total prey population size X is negligible. The prey capture is proportional to the predator population size. If we did not make the assumption of rare predators, then the prey would die out on the short timescale. The total population size Y in this example and in the applications in Sects. 4, 5 and 6 is always the magnified or scaled-up predator population size. In "Appendix B" we give the technical details and assumptions about the individual behaviour in order to achieve time scale separation between the fast dynamics and the slow dynamics.
The predator functional response f (X , Y ) is calculated as in (8) and given by the food source is superabundant and an increase in the prey density X does not increase the feeding rate, which reaches a constant saturation level d, as in the Holling type II functional response. Then the function in (25) is increasing with the total prey population until it saturates at this value.
Furthermore if there is only one prey state the functional response in (25) simplifies to the Holling type II functional response We recall that in (25) we assume A 21 = A 1 Y , that is the rate which determines the transitions of the prey from the defended state x 1 to the exposed state x 2 is linearly depending on the total predator density. This interpretation agrees also with the individual behaviours modelled by Geritz and Gyllenberg in (2012) for their mechanistic derivation of the Beddington-DeAngelis functional response, where the available prey are in state x 1 , while the x 2 class denotes those individuals that found a refuge from the predators. In particular, in the literature the most common form of the function by Beddington and DeAngelis is given by Here we obtain a generalisation of the Beddington-DeAngelis functional response in (27), which differs from the one in Geritz and Gyllenberg (2012) because we suppose that the prey in both states x 1 and x 2 can be captured but at different rates: Fig. 1 The functional response given in (29). Parameter values: a c 1 = 10, The graph of the function in (29) is illustrated in Fig. 1. When the prey population X increases, the asymptotic behaviour is the same as described above for the class of functions in (25). At high predator density Y , the functional response in (29) with c 1 < c 2 increases and tends to the Holling type II functional response (Fig. 1a). This is in contrast to the Beddington-DeAngelis functional response, which is a decreasing function of Y . On the other hand, if c 1 > c 2 the functional response decreases with the total predator size Y (Fig. 1b).
If c 2 = 0 (or sufficiently small), the functional response in (29) is a Beddington-DeAngelis functional response of the form given in (27) with a = c 1 A 12 , b = c 1 4 Application: a functional response with density dependent handling time

Individual level reactions, population equations and fast equilibrium
We analyse the same scenario presented in Sect. 3, that is, the predator population is structured in two classes, the searching predators S and handling predators H . In this application we consider only one prey state. We define with c 1 the attack rate. We assume moreover that the handlers return to the searching state with prey density dependent rate c 2 X or spontaneously with rate d. This assumption is ecologically reasonable if the uptake of resources from the corpse of the killed prey declines with the handling time. The capture of a new prey becomes then worthwhile especially if the prey density is high and an indicator of the overall prey density is given by the average time until a new prey gets into the handling predator's field of vision. Furthermore, the density dependent transition may be the result of an actual encounter with a prey individual or may be triggered by prey kairomones (as assumed in the previous section, but with the roles of prey and predator reversed). All these interactions are fast time processes in comparison to birth and natural death and are summarised below: Note that in the first transition the prey disappears due to prey capture, while in the second the prey acts merely as a catalyst. The corresponding population level differential equations of the fast time dynamics are given by applying the law of mass action and the time scale separation is presented in details in "Appendix B": The total predator population is constant and given by Y = S+ H . Then, we can reduce the system of equations to only one equation and solve the steady state equation. The fast dynamics equilibrium is

Functional response
We can now derive the corresponding functional response The functional response in (32) is a two-parameter function, because only the ratios c 1 d and c 2 d matter and the shape of the functional response is therefore affected by these fractions, as shown in Fig. 2. Furthermore, by considering the formulation we observe that the functional response in (32) is like the Holling type II functional response, but with a density dependent handling time given by the ratio 1 c 2 X +d . The higher the prey density is, the faster the predator will quit handling and start searching for fresh food. Note that such behaviour is functional because if the prey is scarce, then the predators will tend to diligently consume the food source until it is completely exhausted and handle the prey longer than if the prey were abundant.

Predator numerical response
We assume that the predators in the handling state give birth. Therefore the per capita reproduction rate of the predators is proportional tô The conversion factor γ (X ) = 1 c 2 X +d is then a decreasing function of the prey density X and in particular it is proportional to the average time spent handling the prey. If we assume that in this particular scenario the predator per capita natural mortality rate is the same for the predators both in the searching state and in the handling state, then the mortality rate is constant as in (1).

Individual level reactions, population equations and fast equilibrium
We now assume that the searching predators are divided into two subclasses according to the level of starvation, well-fed (S 1 ) and starving (S 2 ). It is natural then to assume different capture rates for the two classes, e.g. starving predators have a lower capture rate than satiated predators, c 1 > c 2 . We suppose again the handling predators in class H . We denote with H 1 the predators that enter state H from state S 1 and with H 2 the predators that enter H from state S 2 . The predators in H 1 and H 2 handle the prey for, on average, 1 d 1 units of time, then they enter class S 1 . If a well-fed predator does not capture a prey in on average 1 d 2 units of time, it enters the state S 2 . We assume that starving predators have very low per capita fecundity since they are hunting to survive and restock their basic energy reserve. On the contrary the well-fed predators invest part of the energy gained from the food source for reproduction. In this case, the per capita fecundities for the two types of consumers, namely Γ 1 and Γ 2 , differ. In particular Γ 1 > Γ 2 , since in case of starvation the individuals are likely to cease energy allocation to reproduction, see Kooijman and Kooijman (2010). We assume the offspring to be in state S 2 . We consider the transitions between the different predator states to be fast processes with respect to birth and death. In addition, we consider the total predator population size considerably smaller than the total prey size. The time scale separation is achieved through the scaling given in "Appendix B". We summarise below the individual level processes: The equations that describe the population level fast time dynamics are given by

Functional response
The functional response corresponding to the dynamics above is The functional response in (38) is an increasing function of X up to a saturating level given by d 1 , as shown in Fig. 3a. It is a type III functional response of the form A necessary condition for the function to be convex in the neighbourhood of 0 is that the second derivative has to be positive. This is true if and only if c 1 c 2 > 1 + d 2 1 d 1 , that is the attack rate of the wellfed predators, c 1 , is sufficiently higher than the attack rate of the starving predators, c 2 . This result is consistent with the biological interpretation of the individual level dynamics that we have provided.
In the literature the most common form of the Holling type III functional response is The function in (39) can be mathematically reduced to the function in (40), if we let c 2 → 0 and c 1 → ∞, such that the product c 1 c 2 stays constant. This can be interpreted as well-fed predators being extremely efficient hunters, while starving predators are very unsuccessful searchers.

Predator numerical response
On the slow time scale, we suppose that the reproduction rate of the predators is proportional to the density of the handling predators at the fast time equilibrium and that the energy intake from the consumption of the prey is partly allocated to reproduction. At an individual level, we consider the following reactions, which happen at a slow time scale with respect to the interactions modelled in (35): The per capita reproduction rate in this particular scenario is not a constant, but it is an increasing function of the total prey population size (see Fig. 3c) with saturating value given by the fecundity rate of the well-fed predator individuals, Γ 1 , at high prey density: The conversion factor is a function of the prey density (see Fig. 3b), saturating on the value Γ 1 d 1 when the food source is abundant. In fact, 1 d 1 is the average time spent handling the prey and Γ 1 denotes the per capita fecundity of the well-fed predators. Furthermore, the function γ (X ) is increasing if and only if Γ 1 > Γ 2 , which is consistent with the biological assumptions given in Sect. 5.1.
Suppose further that the predators in the two searching states differ not only in their capture rates, but also in their respective mortality rates δ 1 and δ 2 , with δ 2 > δ 1 . The individual level interactions occurring at the slow time scale which model the natural mortality of the predators are then given by Under these assumptions we note that the average per capita mortality rate is given by Mortality is then no longer constant, but a decreasing function of the prey density, as shown in Fig. 3d. In particular, in the absence of the prey, the function δ takes the value of the per capita mortality rate of the starving predators, δ 2 .

Alternative interpretation of the individual level processes
As far as the functional response is concerned, the model can be interpreted also in the context of predators structured according to their level of experience. This is the usual interpretation of the Holling type III functional response, although until now a rigorous derivation was missing. Here we show how the Holling type III functional response can be derived with our approach. Suppose that class S 2 contains the individuals that lack experience and are not well skilled in capturing the prey, while class S 1 includes those experienced individuals with success rate c 1 > c 2 . Note that at low prey density, almost all predators will be inexperienced. Predators in both classes, after interaction with the prey, enter the class of handling predators H . The average time spent handling the prey is 1 d 1 units of time. Predators that have captured (and handled) a prey are considered experienced (class S 1 ), but they lose this status, and hence the ability to capture prey at high rate, after on average 1 d 2 units of time (transition to class S 2 ). Furthermore, we assume that the individual level processes that determine the interactions between the predator and prey states are fast time reactions with respect to birth and death. The above scenario can be visualised in the following way: The ODE system which describes the population level fast time dynamics is the following The total predator density Y is constant, such that dY dt = d S 1 dt + d S 2 dt + d H dt = 0 Then the fast dynamics settles on the asymptotically stable equilibrium: The corresponding functional response has already been given in (38).

Individual level reactions, population equations and fast equilibrium
In the following model, we assume that the prey has a natural tendency to seek protection, but that searching predators are able to overcome the prey defenses, for example by causing them to panic and by attacking the isolated individuals. As shown by Geritz and Gyllenberg (2012), this leads to fast-processes that are the opposite of those in the Beddington-DeAngelis model. The individual level reactions are: The corresponding differential equations for the fast time population dynamics are with the conservation laws E + P = X and S + H = Y (see "Appendix B" for details on the time scale separation between the fast and slow dynamics). The corresponding fast time equilibrium is given bŷ where p = a b , q = d c and Δ p,q (X , Y ) = q p 2 q + 2 p (q + 2X ) Y + qY 2 . In the "Appendix C", we give the phase portrait corresponding to the system in (50), for different values of the parameters, in order to show that the fast dynamics equilibrium is unique and hyperbolically stable.

Functional response
We derive the corresponding functional response (Fig. 4a) When p → 0, that is a → 0 or b → ∞, the functional response tends to the Holling type II functional response, since the prey is most of the time available for being captured: The case in which q → ∞, that is c → 0 or d → ∞, corresponds to the scenario where the predators are almost all the time searching. Therefore, the predators searching and attacking the prey correspond to the total predators Y and the portion of prey subjected to predation is given by bY a+bY X = Y p+Y X , with bY a+bY being the probability for the prey to be in the vulnerable state. Taylor expanding with respect to 1 q near zero and retaining only the lowest order term in 1 q , we get ( Fig. 4b) We note that if both q → ∞ and p → 0, then the functional response in (55) becomes linear, as in the Holling type I functional response. In this case the predators handle the prey for an infinitely short time and the prey is most of the time exposed to the predators' attacks. The function is increasing with the attack rate c. This is a typical functional response for filter feeders as shown by Jeschke et al. (2004).

Prey and predator numerical responses
If we assume that only the handling predators give birth, then the predator per capita birth rate is proportional toĤ i.e. it is proportional to the functional response, as usual. On the other hand, when we consider the searching predators S and the handling predators H having different death rates δ 1 = δ 2 , then the overall per capita death rate is which is no longer constant, as usually given in the literature, but depends on X and Y . We note that the product of XY in the numerator of the functional response in (57) leads to a squared Y term in the population equations for the prey and the predator. In the predator equation for the slow dynamics, this leads to an Allee effect (i. e. at low predator densities almost all prey are protected and cannot be captured), since the per capita birth rate at low predator densities is of order Y (see 58), while, when q → ∞ and the density of the handling predators is very small, the per capita death rate is approximated by the constant value δ 1 (see 59). A similar situation was modelled from first principles by Geritz and Gyllenberg (2013).
If we assume that only the protected prey in class P give birth, i.e., if no other slow interactions between the individual prey or their resources occur, then the prey per capita birth rate is proportional tô However, when the hiding prey and the available prey have different death rates μ 1 = μ 2 and if there are no other sources of slow death, e.g. interference competition among the prey, then the overall per capita death rate is Furthermore, we note that by visualising the prey and predator numerical responses in terms of the functional response, it is possible to understand what the former look like in the limiting cases of the latter as treated above in (56) and (57).

Conclusions
In this paper, we proposed a method for the derivation of the functional response from a system of prey-predator interactions which occur on a fast time scale, with respect to birth and death. Many functional responses appear in the literature, but they often lack of interpretation at the individual level. The time scale separation argument that we use in this paper is a possible approach to link the macroscopic behaviour of the population to the microscopic dynamics of the state transitions of individuals. Such derivation permits an explicit interpretation of the structure and parameters of the functional response in terms of the individual behaviour.
Elements of the two time-scales are implicit in the traditional approach to deriving the Holling type II functional response, as the consumption rate of the predator instantaneously adjusts to the current prey density. Here we formalise the two-time scales approach in a systematic way. Specific instances of this method can be found in the literature, for example in the works by Metz and Diekmann (1986) and Gyllenberg (2012, 2013). However, in this paper we embed these instances into a more general and formal framework that, in addition to the predator's functional response, also gives a derivation for the numerical responses of the predator as well as of the prey.
In addition to a general outline of the method, we give several concrete applications, including an application that leads to a generalisation of the Holling type III functional response. The functional response Holling type III has been associated with switching between alternative prey depending on their relative abundance. An explicit derivation was given by Leeuwen et al. (2007). Alternatively, the Holling type III functional response can be associated with different hunger states of the searching predators instead of different experience levels. We give here a mechanistic explanation for the latter. The specific form, as found in the literature, is recovered as a limiting case and is easily understood in terms of the explicitly modelled underlying individual behaviour.
In another application, the handling predator may abandon its catch if it detects another live prey. This leads to a Holling type II functional response with densitydependent handling time. In particular, both the handling time and the conversion factor are decreasing functions of the prey density. Such behaviour is adaptive if the uptake of resources from the killed prey declines with the handling time.
Furthermore, we discuss the functional response corresponding to a simple nonlinear system for the fast dynamics, where we consider two states for the predators and for the prey and we are able to compute explicitly the fast dynamics equilibrium. Here the predators may overcome the prey defenses by causing panic among the prey and by attacking the isolated individuals. We model the prey and predator numerical responses by assuming the two species structured by states with different birth and death rates. The results at the population level are consistent with the individual level reactions and show that at low predator densities an Allee effect is likely to appear.
The method presented here is not the most general method possible. For example, we did not consider interactions among the prey themselves or the predators themselves like the exchange of information about the presence of prey or predators leading to a change in the motivational state or the state of alertness. Neither did we include states involving more than one individual, such as two predators fighting over a kill, or several prey seeking protection in numbers, or a predator stalking or fighting a prey. It is not difficult to extend the method to include these cases (e.g. see Geritz and Gyllenberg (2013) where prey groups of different sizes are modelled as different prey states), but it becomes more difficult to prove the existence and, in particular, the uniqueness of an equilibrium of the fast dynamics of the state transitions.
In order to apply slow-fast time scale separation, it is necessary that the fast dynamics is settled on a unique and hyperbolically stable steady state. We are not able to give a general result. In particular, the uniqueness of the equilibrium corresponding to the fast dynamics remains an open question. However, by relaxing the conditions on the parameter values, we have built an example in which the fast time steady state is not unique: this may set a limit to the assumptions that we can make on the coefficients of the matrices which model the interactions in order to get a unique hyperbolically stable equilibrium.
In our approach only individuals in some specific discrete states are able to reproduce. The proportion of time that an individual spends in these states is equal to the proportion of individuals in such states at the fast time equilibrium. In this way birth is limited by a time-budget. Another (and possibly more realistic) approach would be to model births as energy limited, like in the dynamic energy budget models (see, for example, Kooijman andKooijman 2010, Geritz andGyllenberg 2014).
A possible disadvantage of the approach is that to use it in a practical way, one must make assumptions about the transitions between microstates and the model may become parameter heavy. However, as a theoretical tool, the method has potential. One of the key questions in ecology today, raised by Durrett and Levin (1994) among others, is how to scale up from the level of individual behaviours in a population to functional responses and dynamics equations at the population level. Deriving functional and numerical responses from the behaviour of the individual prey and predator is important if one wants to go beyond a mere description of the population dynamics to an understanding in terms of the underlying individual level processes. Also the other way around, that is, if one wants to know the effect of certain changes in the behaviour of the individual prey or predator, the derivation of the population model from first principles in terms of individual behaviour is a necessity.

Appendix A
..,n} , D ∈ M n (R) be matrices with non-negative off-diagonal coefficients. Suppose that A and D are transition matrices such that the linear system in (12) has a unique stable equilibrium and (B k i, j ) i, j∈{1,...,m} , (C k i, j ) i, j∈{1,...,n} are irreducible matrices respectively for all y > 0, y ∈ R n and for all x > 0, x ∈ R m . Assume, moreover, that all these matrices are transition matrices and that the conservation laws on the total population density m i=1 x i = X and n i=1 y i = Y hold, with X and Y constant. Then, the system in (11) has at least one equilibrium point.
Proof Consider the steady state equations In the first set of equations, A + B(y) ∈ M m (R) is an irreducible nonnegative offdiagonal matrix for all y > 0, y ∈ R n and by the Perron-Frobenius Theorem it has a simple dominant nonnegative eigenvalue, that is 0. Let ψ(y) be the corresponding eigenvector satisfying m i=1 ψ(y) i = X . In the same way, for the second set of equations we have that C(x) + D ∈ M n (R) is an irreducible nonnegative off-diagonal matrix for all x > 0, x ∈ R m and by the Perron-Frobenius Theorem it has a simple dominant nonnegative eigenvalue, that is 0. Let φ(x) be the corresponding eigenvector satisfying n i=1 φ(x) i = Y . The continuous map from the compact convex set {x ∈ R m : m i=1 x i = X } in itself, = ψ • φ has at least one fixed point by the Shauder's Fixed Point Theorem. This shows that the fast dynamics has at least one steady state.

Appendix B
We give here the time scale separation for the system in Sect. 3 in details. The dynamical system of the interactions modelled in Sect. 3 is given by where λ k and μ k are respectively the per capita birth and natural mortality rate for the prey in state k as given in (9), Γ is the conversion rate of prey into predators such that Γ H = γ (X , Y ) f (X , Y )Y and δ is the per capita mortality rate of the predators.
Let ε > 0 be a small and dimensionless scaling parameter. In order to separate the fast and slow dynamics, we define the following scalings for the parameters of the fast time interactions and the predator population that is assumed to be much smaller than the prey population: We now give the slow-fast equations corresponding to the system in (63) using the scaled parameters: We introduce the scaled short time t = ε −1 τ and let ε → 0. We give the equations for the dynamics on the fast time scale: The variables X and Y are constants on the fast time scale and from the equations in (65) for the fast variables x k , S and H we can now derive the fast dynamics equilibria given in (20), (21), (23) and (24). The time scale separations for the models in Sects. 4 and 5 follow the passages and the scalings given above for the system in Sect. 3. We consider now the dynamical system for the interactions modelled in Sect. 6: In this case, as in Geritz and Gyllenberg (2012), we additionally assume thatb is large in comparison to the other parameters. In this way, the term −bP S in the short time scale equations for the exposed and the protected prey is not negligible, but part of the fast dynamics. We introduce the scaled parameterb = ε −2 b. For an alternative scaling, we could assume that the parametersc andd are small in comparison to the other parameters (see also Geritz and Gyllenberg 2012). In this case, we would not need to assume that the total predator size is much smaller than the total prey size, but we would separate the dynamics in (66) into three separate time scales.

Appendix C
We compute the solutions for the system of equations in Sect. 6.1, for different values of the parameters a, b, c, d and different initial conditions. The numerical simulations in Fig. 5 show that the uniqueness and hyperbolic stability of the fast dynamics steady state is verified for the chosen values of the parameters.

Consider the system in (3). Suppose
Consider weaker assumptions on (B k i, j ) i, j∈{1,...,n} and (C k i, j ) i, j∈{1,...,n} , such that they are not non-negative off-diagonal matrices, but verify for every i, j ∈ {1, . . . , n} In this particular case, we are able to give numerically a counterexample to the uniqueness of the steady state of the system.
We consider the following symmetric system, where This model satisfies the relations necessary for the conservation of mass: one can check x 2 (t), y 1 (t), y 2 (t))). Moreover, the system has two steady states, namely and One may check that, thanks to the Implicit Function Theorem, perturbations of the steady states still exist if we make all the coefficients non zero, but close to the coefficients chosen above. Under the stronger assumptions of non-negative off-diagonal matrices (B k i, j ) i∈{1,...,n} and (C k i, j ) i∈{1,...,n} , we are also able to build a counterexample to the uniqueness of the steady state corresponding to the fast dynamics in (3). In particular, we still assume a symmetric situation where the matrices describing the dynamics for the first set and the second set of equations are equivalent. Moreover, we impose that the matrices corresponding to the linear part of the system of equations are transition matrices such that state 1 and state n are absorbing states, in a stochastic sense.
We construct a counterexample based on the following cross-diffusion system: with n, m ∈ C 2 ([0, 1)) and Neumann boundary conditions. To show that this system may have several solutions, one may consider a satisfying a(λ + cos(π x)) = 1 λ + cos(π(1 − x)) .
Then n = λ + cos(π x), m = λ + cos(π(1 − x)) is a solution and the symmetry of the system makes it non unique. We have developed a discrete version of this idea and we give in the following section the corresponding numerical example. We proceed in three steps: Step 1: Defining x, y, T x , T y such that T y x = 0 and T x y = 0.
Definition of x and y. We consider x, y ∈ R n defined by for every i ∈ {1, . . . , n}. Note that x is different from y. Definition of T y . Let T y ∈ M n (R) a tridiagonal matrix: for any i ∈ {1, . . . , n}, Thanks to the definitions (74) and (73), for i ∈ {2, . . . , n − 1} while for i = 1 (a similar computation can be made for i = n), We have then shown that Definition of T x . Let T x ∈ M n (R) a tridiagonal matrix: for any i ∈ {1, . . . , n}, Then, Step 2: Defining a linear interpolation between T y and T x . We want to define α i , β i such that where μ(i) = 1 if i ≤ n 2 and μ(i) = n otherwise. Case where i ≤ n 2 .
Taking the difference of those two equations leads to which shows that β i is positive: Next, we add up the two equations appearing in (83). Thanks to (73) The value of β i is given by (85), then for i ≤ n 2 and i = 1. Case where i > n 2 .
Taking the difference of those two equations leads to which shows that β i is positive: Next, we add up the two equations appearing in (88). Thanks to (73), we have x i + y i = 2λ and from the definitions in (75) and (80) The value of β i is given by (90), then for i > n 2 and i = n.
Step 3: Conclusion. Definition of A, B, C, D.
Let A, B, C, D ∈ M n (R) tridiagonal matrices. We define the matrix A as follows, using the coefficients α i defined by (87) or (92) for i ∈ {1, . . . , n}: Moreover we denote A n,1 = α 1 2 , A 1,n = α n 2 , while the other coefficients are 0. Thanks to (87), A is then an off-diagonal non-negative matrix, and n k=1 A k,i = A k−1,k + A k,k + A k+1,k = 0.
We define next the matrixB, using the coefficients β i defined by (85) Moreover we obtainB n,1 = β 1 2 ,B 1,n = β n 2 , while the other coefficients are 0. Thanks to (85),B is an off-diagonal non-negative matrix. We define the family of matrices For any i ∈ {1, . . . , n}, (B k i, j ) k, j is then an off-diagonal non-negative matrix, and it satisfies for i ∈ {1, . . . , n} Finally, we define Note that the matrices A, (B k ) k , (C k ) k , D that we have constructed satisfy the assumptions given at the beginning of this section.
Thanks to the symmetry of the coefficients (see (98)), we also obtain Finally, we have constructed two steady-states (x, y) and (y, x) for the system of differential equations that we consider: and

D.2 Numerical example
We construct a numerical example where we consider the prey and the predators structured into three states. The individual level reactions correspond to the following network and reaction rates x 1 x 2 x 3 y 1 y 2 y 3 Note that x 1 and x 3 , y 1 and y 3 are absorbing states for the transition matrices A and D, respectively. A possible biological interpretation of the interactions in (105) is given by assuming the prey population in two different locations, in particular the prey individuals in state x 1 are in the first location, while the prey individuals in state x 3 are in the second location. The searching predators are also divided into those individuals in state y 1 , which are searching for a prey in the first location, and those in state y 3 , which are hunting in the second location. When a prey in state x 1 meets a predator in state y 1 (and similarly for a prey in state x 3 meeting a predator in state y 3 ), it goes hiding with rate 1 6 and with rate 1 4+ √ 2 it goes back either to state x 1 or to state x 3 . After an encounter with a prey individual in state x 1 , with probability per unit of time 1 6 the predator in state y 1 starts handling the prey. The same interactions occur for the predators in the second location when they meet a prey in state x 3 . Define x i and y i , with i = 1, 2, 3 and n = 3 as follows Note that x is different from y. Define the matrices T y and T x such that T y x = 0 and T x y = 0 are as follows We can define T x in the same way and show that Then we define a linear interpolation between T y and T x . In particular, we define α i , β i such that where μ(i) = 1 if i ≤ n 2 and μ(i) = n otherwise. From now on, all the numerical values are obtained by taking λ = 2. This choice of the parameter values does not have any particular biological justification. Then, by solving the above system of equations for α i and β i , we get α 1 = 0 β 1 = 1 3 Then, we can define the following system of ordinary differential equations ⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ dx 1 dt (t) = α 2 2 x 2 − β 1 2 y 1 x 1 = 1 4+ √ 2 x 2 − 1 6 y 1 x 1 dx 2 dt (t) = −α 2 x 2 + β 1 2 y 1 x 1 + β 3 2 y 3 x 3 = − 2