The Stochastic Nature of Functional Responses

Functional responses are non-linear functions commonly used to describe the variation in the rate of consumption of resources by a consumer. They have been widely used in both theoretical and empirical studies, but a comprehensive understanding of their parameters at different levels of description remains elusive. Here, by depicting consumers and resources as stochastic systems of interacting particles, we present a minimal set of reactions for consumer resource dynamics. We rigorously derived the corresponding system of ODEs, from which we obtained via asymptotic expansions classical 2D consumer-resource dynamics, characterized by different functional responses. We also derived functional responses by focusing on the subset of reactions describing only the feeding process. This involves fixing the total number of consumers and resources, which we call chemostatic conditions. By comparing these two ways of deriving functional responses, we showed that classical functional response parameters in effective 2D consumer-resource dynamics differ from the same parameters obtained by measuring (or deriving) functional responses for typical feeding experiments under chemostatic conditions, which points to potential errors in interpreting empirical data. We finally discuss possible generalizations of our models to systems with multiple consumers and more complex population structures, including spatial dynamics. Our stochastic approach builds on fundamental ecological processes and has natural connections to basic ecological theory.


Introduction
Models of predator-prey dynamics are the archetypal description of consumer-resource interaction. Since the pioneering work of Lotka and Volterra [1,2], coupled first-order ordinary differential equations to describe the temporal variation of the abundance of two species, a consumer and a resource, are used by ecologists in all sorts of applications [3][4][5][6][7][8][9]. In this context, the term functional response [10][11][12] was introduced to capture the variation in the rate of consumption of a resource by a consumer when the density of the resource changes. Functional responses measure how per capita average rates of resource consumption respond to the density of both resources and consumers. Such functions have been derived by isolating the feeding process, that is by considering that both resource and consumer densities remain constant. These responses can be summarized by plotting the number of resource items consumed per unit time by a consumer as a function of resource density. Holling [11,12] used the term type I to describe a linear relationship between feeding rates and resource density, while the term type II describes a non-linear relationship between feeding rates and resource density, where the slope of the curve monotonically decreases with increasing resource density, saturating at a constant value of resource consumption. Such a functional form is obtained assuming consumers move from a phase where they actively search for resources to a handling phase where they are occupied with consuming/digesting and not able to search for new resource items [13]. The term type III is associated with similar non-linear functions, where the slope first slightly increases, then, after a certain threshold, steeply increases, and finally, decreases, producing a sigmoidal shape in the curve [14]. It has been shown both theoretically [15] and empirically [16] that type III functional responses have a stabilizing effect on population dynamics. Assuming that consumers can also interfere with each other, e.g., by competing for the same resource item during searching and handling, the functional response becomes a function of both resource and consumer density. Non-linear functional forms in both consumer and resource density were independently proposed by Beddington [17] and DeAngelis [18]. The Beddington-DeAngelis functional response for predator interference has been further characterized and extended in subsequent studies [19][20][21][22].
Functional responses are typically measured in feeding experiments with a controlled resource density, which isolates the feeding process and enables quantifying resource intake. Several statistical methods to infer functional response parameters from feeding experiments are available [23][24][25]. Functional response parameters can also be directly inferred from consumer resource time series obtained from empirical studies of population dynamics [16,[26][27][28]. Both empirical approaches and corresponding inference methods are based on the assumption that the parameterizations of functional responses obtained by feeding experiments are analogous to the parameterizations of the 2D ODEs describing consumer resource population dynamics. The type II functional response is still the most widely used functional response, and the corresponding differential equations for predatorprey dynamics, also known as the the Rosenzweig-MacArthur equations [29], have been widely studied in the dynamical systems literature [30][31][32]. Furthermore, the dynamical properties of consumer resource equations with the Beddington-DeAngelis functional response are well studied [33,34].
A complete review of the properties of these equations is beyond the scope of this paper. Instead, here, we underline how to derive such macroscopic equations from the elementary processes affecting the dynamics of individuals. Statistical physics has developed an array of powerful tools to scale up from microscopic to macroscopic dynamics [35,36]. These methods, originally developed to describe particle systems or chemical kinetics, can be more generally applied to many-body systems, and their use in population and community ecology has become widespread [37][38][39][40][41][42][43][44][45]. Examples of such derivations were given by Dawes and Souza [46], who proposed a minimal set of reactions to derive type I, II, and III functional responses, and by Van der Meer and Smallegange [21], who used similar arguments to derive a stochastic version of the Beddington-DeAngelis functional response. We provide here a simpler derivation that can be easily extended to include a more general set of reactions and accommodate different aspects of consumer resource interactions. We made the model general by allowing immigration and resource logistic growth and by defining the formation of a consumers-resource complex and triplets composed by two consumers fighting for one resource, which describes handling and interference, respectively. Although the stochastic description of the feeding process we provide here is not exhaustive, since we are not including direct consumer interference, it provides the basis for more elaborated reaction schemes. The paper is structured as follows • In Section 2, we give the description of a minimal set of reactions to define consumerresource dynamics, including predators handling prey and predators interfering. We use the Van Kampen, systems size expansion to get, through the master equation of the discrete system, a mean field version of the model consisting in a set of four ODEs. • In Section 3, we provide a detailed analysis of the dynamical properties of the 4D ODE system, including bifurcation analysis. • In Section 4, we show how different arguments of time scales' separation give rise to the classical 2D systems described in the ecological literature, i.e., predator-prey equations with Beddington-DeAngelis and Holling type II and type I functional responses. • In Section 5, we derive classical functional responses (Holling type II and III and Beddington-DeAngelis) inspired by [14]. We emphasize their stochastic nature, by deriving the probability distribution of feeding events. By doing so, we clarify the assumptions that enable all these derivations. We obtained functional responses that differ in their parameterization and in their functional form (for the Beddington-DeAngelis case) from the functional responses obtained via separation of time scales in the previous section. • In Section 6, we discuss potential limitations and possible generalizations of the model, describing future avenues of research.

A Minimal Set of Stochastic Processes
Here, we describe the dynamics of S = 2 species, a resource φ R and a consumer X A . We characterize the dynamics distinguishing the two species by defining a maximum number of resource individuals N 0 (N ∈ N) that can be packed in the local community. This parameter plays the role of the size of the system. This characterization introduces a limit in the total immigration rate of the resource species, Λ R , between zero, when the system is full with N resource individuals, and N, when it is empty. This results in a density-dependent total immigration rate and a density-independent death rate.
where δ R is the intrinsic death rate of the resources and Λ R (t) = λ R (N − n R (t)). Note that we can always consider the system's size as divided into N small portions or sites, which means that λ R can be interpreted as an immigration rate per empty site. Here, n R (t) is the number of resource individuals in the local community at time t. To further characterize resource dynamics, we considered another reaction describing birth events, Here, the per capita resource rate is given by , and β can be regarded as a per capita birth rate when the system is almost empty.
The dynamics of the consumers is described by immigration and death reactions, and by processes associated with interactions between consumer and resource individuals describing, e.g., the feeding process with reactions: where the formation of consumer-resource pairs X [AR] happens at a total rate αn R n A N and the degradation of pairs into newly born consumers happens at rate νn [AR] . In Reactions (6) and (7), α is the encounter rate between consumers and resources and ν is a degradation rate of pairs, defining the "handling time" τ H := 1/ν of individual consumers. We can finally consider another process related to consumer interference formalized in triplet formation, given by reactions of the kind: where χ is the rate of triplet formation that measures the propensity of free consumers to attack handling consumers and η is the rate of triplet degradation, which defines the "interference time" τ I := 1/η. Note that we did not consider interference between free consumers, i.e., reactions leading to the formation of consumer pairs X [AA] .

Derivation of Mean Field Approximations
The process defined by Reactions (1)-(9) can be formulated as a stochastic process. Fixing the number of sites to N, the system state is completely defined by a vector n = (n R , n A , n [AR] , n [ARA] ), and the dynamics is given by a discrete state Markov process, where P(n, t|n 0 , t 0 ) denotes the probability that the system is in state n at time t, given it was in state n 0 at time t 0 < t.
The transition rates associated with elemental processes are: These transition rates are consistent with the set of reactions introduced above. Let P(n, t) denote the conditional probability P(n, t|n 0 , t 0 ) obtained by imposing that the initial state, at t = t 0 , is n 0 , i.e., P(n, t 0 ) = δ(n − n 0 ). With this definition, the master equation reads as: where we introduced the one-step operators: to make the notation compact. Observe that operator X acts on population abundance n X , with X ∈ {R, A, [AR], [ARA]}. It can be shown, via a systematic Van Kampen expansion [35] of the master equation on the system's size (N), that the stochastic model defined above yields a deterministic approximation as the leading term of the expansion, together with a Fokker-Planck equation describing the noise in the next-to-leading order [35]. The mean field version of the process associated with the general set of reactions (1)-(9) is given by a system of coupled ODEs given by: In Appendix A, we illustrate how the Van Kampen expansion for the master equation proceeds for the case in which no triplet formation is considered, i.e., when χ = 0 = η.

Stability Analysis
The ODE system defined by Equations (20)-(23) has a rich behavior in terms of its stability and the qualitative analysis of the equilibrium points it exhibits. We first analyzed the equilibrium points of the full ODE system and found a transcritical bifurcation when λ A = 0. The system has limit cycles that emerge after a Hopf bifurcation, which we show in a particular case in Section 3.1.
At equilibrium, (23)  . Substitution into the r.h.s. of (22) yields νn [AR] = αn R n A N . Therefore, substitution of these two relations into the r.h.s. of (21) gives, at equilibrium, which, together with (20), forms a non-linear system of degree three for equilibrium abundances n A and n R . This system can be reduced to a cubic equation for n R , which reads: where we made the definitions λ A := λ A /α, λ R := λ R /β, δ A := δ A /α, and δ R := δ R /β and used the resource abundance scaled by the system's size f R := n R /N. However, for the sake of simplicity, in what follows, we focus on the case of the absence of the immigration of the predator, λ A = 0. In this case, (24) yields a trivial solution, n A = 0, which implies trivially that n [AR] = 0 and n [ARA] = 0. Therefore, the r.h.s. of (20) yields a second-order equation, This equation can be solved for f R , where we introduced the control parameter q := 1 − δ R = 1 − δ R β , which can be seen as the ratio between the intrinsic growth rate (r = β − δ R ) and the birth rate (β) of resources. The solution f − R is always negative, so we discarded it, and we obtained the first set of solutions n R = N f + R and n A = n [AR] = n [ARA] = 0. On the other hand, for λ A = 0, Equation (24) yields also the constant (q-independent) solution n R = Nδ A α = Nδ A . Again, using the r.h.s. of (20), we obtained a non-trivial equilibrium solution for n A , which, in turn, yields the equilibrium pair abundance, and triplet abundance, Now, we focus on the two equilibrium abundances for the resource, n R = N f + R and n (2) R = Nδ A . These two solutions cross each other at: which is basically a restriction between model parameters, Then, using the Jacobian matrix of the system (20)-(23) evaluated at the two equilibria, it is easy to show that the solution for n (2) R = Nδ A is stable for q < q and unstable for q > q . Consistently, the equilibrium solution for n (1) R = N f + R is unstable for q < q and stable for q > q . Therefore, we found a transcritical bifurcation at q = q for λ A = 0. Figure 1 shows the transcritical bifurcation as the stability of the steady-state changes by increasing the control parameter above the threshold q . Order parameter, q Resource abundance, f Solution (2) Solution (1) Figure 1. Transcritical bifurcation for λ R = 2β, λ A = 0, and δ A = 3α/2. Here, the vertical axis stands for the scaled resource abundance f R , and the horizontal axis represents the control parameter q = 1 − δ R /β. For q < q = 13/6, the (upper) solution f (2) R = 3/2 is stable and for q > q stability changes and f (1) R = 1 2 q − 2 + (2 − q) 2 + 8 becomes the stable resource scaled abundance. Observe that for q > q , consumer, pair, and triplet abundances become equal to zero in the stable branch. Stable (unstable) solutions are marked with full (dashed) lines.

Hopf Bifurcation
We also observed the emergence of a Hopf bifurcation for several ranges of model parameters. Here, we illustrate the existence of a Hopf bifurcation for λ R = 0, λ A = 0, and δ R = 0, in which we were able to calculate a series expansion of eigenvalues for small β. In order to derive analytical expressions in the simplest setting, we considered the model in the absence of triplets.

Let us focus on the equilibrium abundances
The bifurcation arises around this equilibrium point. Observe that these densities are meaningful if α > δ A . Notice that the threshold given by (32) At that equilibrium point, the Jacobian matrix reads: For β = 0, it is easy to see that the eigenvalues of J are λ = 0 (double) and λ = −2δ A − ν, so the equilibrium point is neutrally stable, and a limit cycle appears. We now expand these eigenvalues for β 1. The characteristic polynomial is: This cubic equation can be expanded in power series of β (for a similar expansion, we refer the reader to [47]). First, we obtained a series expansion for the double root λ = 0, obtained when β = 0. The perturbation analysis starts by setting λ = aβ b and then trying to determine the factor a and exponent b at leading order. Substitution into (34) yields: Therefore, the smallest powers in β are obtained by choosing b = 1/2. Canceling the leading terms (which turn out to be of the order of β), we can determine an expression for a as the solution of: i.e., Here, we see that for α > δ A , the double eigenvalue λ = 0 obtained for β = 0 splits into two complex eigenvalues with the imaginary part equal to: We can calculate the real part (at the lowest order in the β series expansion) by setting: Expanding the characteristic polynomial up to order β 3/2 and setting equal to zero the coefficient of the leading term yields the following expression for c: Therefore, for β 1, we obtained the two complex conjugate eigenvalues: By setting ν 2 + 2(3δ A − α)(δ A + ν) = 0, we found the threshold of a Hopf bifurcation, which can be expressed as: Observe that α c > δ A , so eigenvalues stemming from the splitting of λ = 0 (for β = 0) are complex. For α > α c , Re(λ) > 0, and for δ A < α < α c , Re(λ) < 0 in the limit β 1. Therefore, the eigenvalues cross over the imaginary axis, and a Hopf bifurcation arises: for α < α c , eigenvalues have a negative real part, which leads to stable oscillations around the equilibrium point. Once the threshold α c is crossed over (α > α c ), damped oscillations (with Re(λ) < 0) no longer exist, and the equilibrium point is unstable. The dynamics converges to a limit cycle (i.e., we found a supercritical Hopf bifurcation as α increases).
For the sake of completeness, we provide here the series expansion for the third eigenvalue, which can be obtained in a similar way: Notice that this eigenvalue remains negative for small perturbations in β > 0. Figure 2 shows the stability of equilibrium solutions for arbitrary values of α and β. The diagram shows the transcritical bifurcation threshold (32), which separates the stable solution (1), where only the resource survives, from the coexistence equilibrium (2). This solution is first asymptotically stable, and then, damped oscillations around this stable equilibrium point arise. The rightmost threshold line in Figure 2 stands for the Hopf bifurcation, which separates stable oscillations from limit cycles.  (42)) for the Hopf bifurcation is the limit (for β → 0) of the line that separates stable oscillations and limit cycles. The remaining lines were computed by numerical evaluation of the Jacobian eigenvalues.

Derivation of Functional Responses via the Separation of Time Scales
In this section, we discuss the asymptotic dynamics of the mean field description of the system (20)- (23). To simplify the calculations, we assumed there is no immigration in the system (λ R = 0 and λ A = 0). A simple asymptotic derivation can be made for the type I and type II functional responses. In this case, there is no interference between predators (χ = 0, η = 0), and we can write the mean field Equations (20)-(23) as: where r = β − δ R and K = rN/β are the growth rate and carrying capacity of the resource. Assuming that compounds disappear very fast from the system, the time scale of consumers X A is longer than the time scale of the compounds X [AR] . In this regime, putting (46), we obtained νn [AR] = αn A n R /N, which we can substitute in Equation (45) to get: which are the classical predator-prey Lotka-Volterra equations [1,2], i.e., consumer-resource equations with a type I functional response. Note that in Equation (48), the numerical response, i.e., the per capita rate of food intake of the predator [48], is equivalent to the functional response. In other words, the conversion efficiency of resource density into predator density is one. In this case, the parameter α can be interpreted as the macroscopic attack rate of the predator, whose density is given by n P = n A . In the opposite limit, when the time scale of compounds X [AR] is longer than the time scale of consumers X A , we can assume that the degradation rate of compounds and the growth rate of resources are small compared to all the other parameters. Following [46], these assumptions can be summarized by setting ν = ν and r = r with 0 < 1, whileν andr remain O(1). For any positive parameters, Equations (44)- (46) have simpler dynamics in the leading order. Making a simple rescaling in the time of the dynamics by writing d/dt = d/dt and substituting into Equation (21), we can now derive an expression for n A as: which can be substituted into Equations (20) and (22) to obtain an ODE system of two equations given by: which is the classical Rosenzweig-MacArthur model for predator-prey dynamics [29], where the total density of predators is slaved to the total number of compounds (50) and (51) describe predator-prey dynamics characterized by logistic growth for the prey and a typical type II functional response with attack rate α = 2αν/δ A , handling time τ H = 1/2ν, and death rate δ P =ν. In this case as well, the numerical response in Equation (51) is given by the functional response of Equation (48). Note also that in this case, the parameters of the macroscopic equations can be expressed as a function of the parameters of the microscopic process (2)- (7), but are not intuitively related to the same parameters obtained considering typical heuristic arguments to derive functional responses [25]. Similar slaving arguments can be made for the general system (20)- (23), where also the degradation rate of triplets is small compared to the other rates (i.e, we additionally set η = 2η ). The derivation goes as follows.
Eliminating n A from Equation (21), we obtained, up to first order in , which can be substituted into (20) to get an equation for the resource, On the other hand, summing Equations (22) and (23) yields: If we assumed that n [ARA] is proportional to n [AR] along the dynamics, say n [ARA] = κn [AR] , and we defined the total density of consumers as n P : , we finally obtained the typical functional form of the Beddington-DeAngelis functional response [19], including predator handling and interference, where the effective interference rate is given by χ = χ 1+κ , the effective attack rate is α = 2αν 1+κ , and the effective death rate of predators is given by δ P =ν 1+κ . However, we did not find a straightforward way to determine κ in terms of the parameters of the original dynamics given by Equations (20)- (23). In addition, we had to assume that densities n [AR] and n [ARA] are proportional along the temporal dynamics to obtain (55) and (56).

Stochastic Feeding Rates
A rigorous definition of a predator functional response can be precisely given as the number of resource units an average individual predator is able to consume per unit time. Since predator consumption rates respond in principle to resource density, any empirical approach intending to measure these rates will require fixing both resource and predator densities. We call these conditions chemostatic, in analogy with experiments done in chemostats, i.e., reactors where nutrient concentrations and density of microorganisms can be controlled [49]. Given the processes that define the stochastic dynamics in Section 2, we can now ask what type of functional response emerges under chemostatic conditions. Therefore, let us assume that we maintain both the number of resource units n 0 R and the total number of consumers n 0 A = n A + n [AR] constant. Let us also assume first no formation of triplets and focus only on the feeding process. In this case, the dynamics can be simply described by the following two processes: where the first equation is tightly coupled to the addition of a new resource unit in order to keep resources fixed to exactly the same level n 0 R all the time. In order to calculate the functional response, i.e., the number of resource units captured by an individual predator per unit time, we introduced a new stochastic variable R T , as the number of resource units consumed by a total population of consumers n 0 A , in a time interval, T. Then, the functional response, as a per capita feeding rate, over a certain period T and a total number of consumers n 0 A , becomes: This functional response is a stochastic per capita feeding rate. In principle, it is assumed to be both prey and predator dependent. It is described by the probability distribution of cumulative feeding events n, realized by the total number of consumers n 0 A , between Time 0 and T. If we characterize the configuration of the system by n, the number of accumulated feeding events, and n A , the number of free predators ready to attack resources at any given time, the stochastic dynamics of the feeding process is governed by the following total transition rates: Equations (60) and (61) represent the rate at which the individual-based reactions (57) and (58) occur. Compare these to reactions (6) and (7). Notice that here we did not consider consumer growth nor resource depletion. When a consumer individual attacks a resource item, this item is instantaneously replenished in order to maintain the resource density constant. These rates can be then used to write a master equation (see Equation (A14) in Appendix B), which governs the temporal evolution for the probability of having an accumulated total of n resource items being consumed and n A free consumers at time t, P(n, n A ; t). This one-step process is linear in n A since both n 0 A and n 0 R are kept constant. Therefore, the probability distribution P(n, n A ; t), can be calculated exactly. The probability distribution characterizing the stochastic variable R T is, in fact, its marginal, i.e., the probability of having a given number n of accumulated feeding events at time T, regardless how many free consumers n A are around. It will be given by: Before giving more details about the calculation of both the full probability distribution P(n, n A ; t) and its marginal, P(n, t), we first analyzed the average feeding rate, f (n 0 R , n 0 A ; T) . It is clear that the average total number of resource units R ≡ R T , consumed by a population of consumers monotonically increases in time according to: which, by defining: can also be written in integral form as: Therefore, the average feeding rate per individual consumer over a period T can be written as: Since the total number of consumers is kept constant (n 0 A = n A + n [AR] ), the average deterministic rate equations describing the feeding processes as defined in Reactions (57) and (58) can be reduced to a single equation for n A , If we assume as initial condition n A (0) = n 0 A , i.e., all consumers are free and ready to feed at time t = 0, then we can integrate the last equation from zero to T as: and therefore: Now, going back to Equation (66), we can write: This average rate per individual consumer tends to a stationary value as T tends to infinity, which is: where we removed the time (to denote the asymptotic limit) and the consumer dependence. After introducing again θ, as defined in Equation (78), it is clear that the average consumption rate per individual consumer corresponds exactly to the typical Holling type II functional response, where ν is the inverse of the handling time and α is the attack rate: See also the red curve in Figure 3. In an empirical setting, where we monitored the total number of resource units consumed by a controlled population of n 0 A consumers under chemostatic conditions over a period T, we would obtain a different total number for each experimental replicate. The scheme given by the reactions (57) and (58) predicts a theoretical distribution that can then be compared to data. We give details about the calculation of this distribution in Appendix B. In short, the transition rates given by Equations (60) and (61) are first used to write a master equation from which an equation for the probability generating function can be derived: where the precise definition of G(x, y, t) is given in Equation (58) in Appendix B. This PDE is then solved under the initial condition G(x, y, 0) = y n 0 A by the method of the characteristics, with the normalization condition G(0, 0, t) = 1, which yields the functional form: where y − 0 (x), y + 0 (x), and ∆(x) are functions of x (see Appendix B). It can be checked that this expression satisfies G(0, 0, t) = 1, for any t, and G(x, y; 0) = y n 0 A as required. In addition, this allows the immediate calculation of the probability generating function of the marginal distribution P(n; t) by simply evaluating the full probability generating function at y = 1: The distribution P(n; t) gives the probability of n prey items disappearing under the pressure of a constant total number of consumers n 0 A , from Time 0 until time t. Under controlled experimental conditions [24], this probability can be used as the exact likelihood function for inference purposes. See also [50] and the references therein, for a broader description of the challenges of the experiments and the inference of functional response parameters. Figure 3 shows stochastic simulations of the per capita rate compared to the Holling type II average provided by (72).  (57) and (58). Simulations were carried out using the Gillespie algorithm with 10,000 steps, while the rates (black dots) were calculated, after a transient of 5000 steps, for different values of resource concentrations and compared with the functional response given by Equation (72) (red line). The simulation parameters are β = 1.5, δ A = 1, α = 2.5, ν = 1, and N = 10,000. The total number of consumers is fixed to n 0 A = n A + n [AR] = 200.
Note that the Holling type II functional response in Equation (72) naturally arises as a per capita average asymptotic feeding rate after reaching stationarity under chemostatic conditions. If the feeding mechanism differs from the simple one assumed by the reactions (57) and (58), other functional responses will be obtained. For instance, if con-sumer feeding rates are strongly affected by the density of the resources, we can describe feeding dynamics by the following two processes: If we repeat an analogous derivation as for Holling type II, we arrived formally at the same Equation (67), but instead, parameter θ should now be defined as: which leads to a Holling type III functional response: Note that Reaction (76) can be regarded as if the presence of n − 1 extra resources facilitated the attack by consumers. Resources would have a self-catalytic effect on their own loss. In nature, it is plausible that when resources are clumped together, consumers encounter them better and faster. However, a Holling type III of exact order n (Equation (79) represents here of course an idealization. Furthermore, let us now assume consumer interference through the formation of triplets. Then, feeding dynamics is specified by the following scheme: Again, under chemostatic conditions, the resource level n 0 R and the total number of consumers n 0 A are both kept constant. In order to calculate the functional response as a per capita feeding rate over certain period T, f (n 0 R , n 0 A ; T) , we made use again of the definition given by Equation (66). The total consumer population is kept constant (n 0 A = n A + n [AR] + 2n [ARA] ) and is distributed among the three types: free consumers n A , handling/feeding consumers n [AR] , and interfering consumers engaged in triplet formation n [ARA] . Once this distribution reaches the steady state, there will be a steady number of consumers n A , free to attack and deplete resources. Therefore, at stationarity, Equation (66) becomes: where we dropped the dependence of the averaging time interval T, because this is an asymptotic rate and θ, defined again as in Equation (78), is a constant parameter, since n 0 R is assumed constant. The value of n A is defined by the steady state that emerges from the rate equations describing the feeding mechanism depicted in the reaction scheme (80)-(83). One can check that this system should read as: In order to determine the steady state of these feeding dynamics, we better work with densities ), which reduces the ODE system to the following two equations: By making these two equations equal to zero, we obtained steady state densities. In particular, the density of free consumers f A can be written as: Using this expression in Equation (84) and rearranging, we finally obtained the following per capita feeding rate of consumers at steady state given by: Note that this is a predator-dependent functional response that generalizes Holling type II. If no triplet formation is considered (χ = 0), we recovered Equation (72). Here, we considered consumers interfering with other consumers that have already caught a resource item, perhaps in the hope of getting a share. However, other possible forms of predator interference are possible. Figure 4 shows the comparison with stochastic simulations. The functional response given by (91) reduces almost to a Beddington-DeAngelis form in the limit χ η 1 and α ν 1. In this case, (91) reduces to: If we introduce the dimensionless rates τ [AR] := α ν , which can be interpreted as the average attack rate in units of handling time, and τ [ARA] := χ η , standing for the ratio between the pace of triplet formation and triplet degradation, respectively, we found that only in the limit of τ [ARA] 1 and τ [AR] 1, Equation (92) is a suitable approximation of Equation (91). The equation obtained is a predator-dependent functional response of the Beddington-DeAngelis type except for the product n 0 R N n A R N in the denominator. Therefore, we note that only if the system is at a very high resource density (n 0 R ≈ N), we would tend to observe the exact Beddington-DeAngelis functional form.

Discussion
The aim of statistical physics is to develop phenomenological macroscopic results from a probabilistic examination of the underlying microscopic processes. This allows connecting processes at different levels of coarse-grained description. We applied this approach to consumer-resource dynamics, connecting elemental processes of growth and consumption at the individual level to a more coarse-grained description that leads, in the limit of large populations, to a deterministic description in terms of the two-dimensional typical predator-prey model (the macroscopic law, sensu Van Kampen [35]).
We set up individual dynamics in a way that makes contact with classic models in ecology. For instance, if we consider only resource dynamics, we have a population that invades an area characterized by N sites with a given immigration rate per site, λ R . Then, local growth occurs, that is individuals send a number of propagules per unit time that only settle down successfully in proportion to the number of free, still non-colonized sites. This means that the system can only pack a maximum number of individuals, N. Finally, individuals die at a density-independent per capita rate, δ R . Under the usual assumption of one individual per site, this model corresponds to the open Levins model [51][52][53][54]. The extension of this model to S resources that compete for the N sites has been also carefully analyzed in the literature [55,56], both using one-step stochastic process and in the deterministic limit. Furthermore, if we drop local growth, then we have a system of S species undergoing an independent immigration-birth-death process, which, under ecological equivalence, leads to a typical neutral model for biodiversity [57,58]. Interestingly, when we sample a total of N S individuals from such a neutral community dynamics, which are necessarily distributed in a vector of abundances n = (n 1 , . . . , n S ), the probability of obtaining a given configuration vector, n, follows exactly the Etienne likelihood function [59,60], the corner-stone of neutral biodiversity theory.
Consumer-resource dynamics was also set up in a general way although it clearly allows for further generalizations. First, we considered also that consumers immigrate from outside the N-site system at a per site rate, λ A . While the system can only pack N resource individuals, in principle, there is no limit for the number of consumers. This number will be dynamically controlled by the resource level. The size of the system only directly limits resources. This differs from most approaches (e.g., [37,46,61,62]), but as we showed, it is not a problem to expand the system in terms of the size parameter N and recover, in this way, the corresponding deterministic rate equations in the large N limit.
Some of the results we covered here, such as the existence of a Hopf bifurcations, can only be recovered when there is no external immigration of consumers. Since natural systems are most of the time open and subject to external inputs, this means that nice and stable consumer-resource dynamics (limit cycles) should be very difficult to observe in nature due to the stabilizing role of external immigration [63]. This does not preclude recovering stable cycles under experimental, close-to-immigration, controlled conditions [64,65].
The way we set up the subset of reactions controlling feeding dynamics has also the potential to clarify much of the discussion about predator-dependent functional responses of the Beddington-DeAngelis type [20,[66][67][68]. We defined interference between consumers through structures that require multiple individuals to interact and stay together for an amount of time. Under this assumption, incidentally, we showed that, by considering only interference between handing consumers and free consumers, the exact Beddington-DeAngelis functional form cannot be fully recovered. We believe this point requires careful analysis that we will develop in a further publication.
The minimal set of reactions that we conceived reproduces consumer-resource dynamics in terms of four ODEs, Equations (20)-(23), in the deterministic limit. This involves the description of the different processes driving dynamics at the individual level. Our main result in this work has to do with the comparison between two alternative ways of deriving functional responses. First, an asymptotic approximation for the mean field version of the complete set of reactions, borrowing slaving arguments from [46], gives rise to a consumer-resource model, which predicts a functional form for the average per capita rate at which consumers deplete resources. Secondly, in a rather classic way [14,19], we derived the functional responses by describing the setting of a typical feeding experiment, that is the same system in chemostatic conditions, by only considering the subset of reactions characterizing the feeding interaction. In the first case, when going from the fourequation to the two-equation system, the dynamics of the usual kind, i.e., predator-prey equations with Holling type I (Equations (47) and (48)), type II (Equations (50) and (51)), and Beddington-DeAngelis (Equations (55) and (56)), are recovered by carefully assuming separation of time scales in the processes involved. Moreover, depending on the particular assumptions behind the separation of time scales, different functional forms may arise. In general, our analysis showed that predator feeding rates in the 2D consumer-resource models do not exactly match the typical functional responses presented in the literature, which we mostly recovered here under chemostatic conditions. Therefore, our results clearly demonstrated a discrepancy between the functional responses that emerge from the analysis of the full consumer-resource system through asymptotic derivations and separation of time scales and the functional responses derived under chemostatic conditions. For example, the attack rate and the handling time of type II functional response obtained under chemostatic conditions differ from the same parameters of the type II functional response that results from asymptotic derivations.
Although finding effective low-dimensional representations from high-dimensional dynamical systems is not an easy task, which formally requires methods from singular perturbation theory [69,70], we believe that the origins of the discrepancy we report is not related to the separation of time scales we assumed in order to go from the full, fourequation ODE system to the typical predator-prey 2D model. We rather think that it has to do with the simple way in which consumers transform resources into new consumers, the so-called numerical response of consumers in the ecological literature [48]. The instantaneous coupling between consumption and reproduction we assumed here, which is also assumed in simple predator-prey models, is not realistic and might be at the basis of this inconsistency. Structured population models, which assume that consumers accumulate mass or energy as they feed and reproduce at a later stage [71], may shed new light on the relation between individual feeding dynamics and macroscopic functional responses. Other possible generalizations, such as the explicit consideration of spatial dynamics [67] (see also Appendix C), may also help explain the relation between individual feeding dynamics and coarse-grained descriptions leading to effective functional responses. Future avenues of research include developing more robust methods to make inference from experiments of consumer-resource systems based on stochastic dynamics [26,72,73] rather than on simple ODE systems.
In sum, we demonstrated that the use of simple predator-prey models to analyze both experiments and natural predator-prey interactions should be done with caution. This includes food-web theory and applications. Models are simple representations of reality. As such, it is not rare to find inconsistencies when we try different types of models to analyze the same system. The art comes when theory is able to clearly establish the range of situations in which a certain mathematical model matches reality, which allows for both predictions and further experiments. However, a successful model of this kind should never claim that the processes considered occur in exactly the same way as they do in nature. Most of the time, process representation is a strong idealization. In this sense, we believe that ecological theories, and probably theories in general, are always effective theories.
Author Contributions: All authors contributed equally to the conceptualization, methodology, software, formal analysis, and writing. All authors read and agreed to the published version of the manuscript. We also acknowledge the Theoretical and Computational Ecology group at the Center for Advanced Studies of Blanes (CEAB-CSIC) for providing a nice and supportive working environment. We thank an anonymous reviewer for useful comments that helped improve the clarity of our work.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A. Van Kampen Expansion of the Master Equation
In the absence of triplets, the master Equation (18) reduces to: In this Appendix, we denote n = (n R , n A , n [AR] ). The expansion proceeds by decomposing each abundance as a term associated with a macroscopic density plus a term associated with noise, where ξ = (ξ R , ξ A , ξ [AR] ) stands for the vector of noise terms. The expansion is based on the change of variables n → ξ. In the new variables, we denote Π(ξ, t) = P(n, t). Here, we use the shorthand X to denote each one of the labels in the set X := {R, A, [AR]}.
Observe that E X changes n X into n X + 1 = N f X + N 1/2 ξ X + N 1/2 N −1/2 . Therefore, after applying E X , the noise ξ X changes into ξ X + N −1/2 . This yields the following asymptotic expansions for the operators E ± X in the limit of large N, The time derivative in (A1) is taken at constant n. Therefore, taking time derivatives in (A2), we obtain: Now, we apply the change of variables n → ξ. The chain rule yields: The l.h.s. of (A1) contains powers of N 1/2 and N 0 . We expand the r.h.s. of (A1) up to the leading and next-to-leading terms in N. We proceed term by term. The first term, (E −1 R − I)(T + R P), reduces to: Up to order N 0 , this yields: Expanding up to order N 0 the following terms of the master equation, we obtain: The remaining terms are a bit convoluted, [AR] (νξ [AR] Π) , respectively, yield a differential equation, which together form the following macroscopic, mean field system of ODEs: which coincides with (20)-(23) for χ = 0 = η and changing back to the original variables n X = N f X (X ∈ {R, A, [AR]}) in the limit of large N (i.e., ignoring the noise). Next-to-leading terms yield the Fokker-Plank equation for the noise distribution Π(ξ, t), with a drift vector µ whose components are given by: and diffusion matrix D whose entries are defined as:

Appendix B. The Method of Characteristics
Here, we give details about the derivation of probability generating function associated with the Holling type II consumer-resource dynamics. We characterized the configuration of the system by n, the number of accumulated feeding events, and the number of free predators, n A , ready to attack resources, at any given time. We were interested in the probability distribution of cumulative feeding events, n, realized by the total number of consumers, n 0 A , between Time 0 and t. We calculated this distribution under the assumption that, initially, at t = 0, there were a total of n 0 A free consumers and, by definition, no feeding events yet. If we write this probability distribution as P(n, n A ; t), the initial condition should be specified as: According to the feeding process, the stochastic dynamics is governed by the following total probability rates: where, for simplicity, we defined m := n A , m 0 := n 0 A . Recall also that θ = αn 0 R /N, as usual. This leads to the master equation, which should be always seen as a system of coupled ODEs, in our case, for m = 0, . . . , m 0 , and n, in principle, taking integer values from −∞ to ∞: By definition, the probability generating function is: Multiplying each equation in the ODE system (A14) by the corresponding factor x n y m and summing over n and m, we obtained an equation in partial derivatives for the probability generating function, The initial condition can be written in terms of the probability generating function in a very compact form, G(x, y, 0) = y m 0 . Our objective was to find the function that fulfills both Equation (A16) and this initial condition.
We first note that x plays the role of a parameter. The relevant variables are y and t. Therefore, we looked for an integral surface U x (y, t) ≡ G(x, y, t) satisfying Equation (A16). Notice that our solution z = U x (t, y) can be regarded as a surface embedded in the 3D space defined by the variables t, y, and z. This method emphasizes that any surface in a 3D space can be characterized by a family of curves. These would be curves that, as a real constant changes, cover and define the whole surface. These curves are called characteristic curves. An equivalent way of writing our integral solution would be Z(t, y, z) = 0 with the function Z(t, y, z) := U x (t, y) − z. Furthermore, we could write the initial PDE in a very compact form, as the following dot product: where v is defined as: and n is the gradient of Z(t, y, z), that is n = (Z t , Z y , Z z ), where: Since n is the gradient of Z, it is normal to the integral surface at each and every point, (t, y, z). Therefore, any curve on the surface should have a tangential direction, defined by the vector v, that should be perpendicular to n at every point. Now, we write a curve in parametric form: and its tangent vector, a, is therefore written as: After some algebra, respectively, the solutions of the first and second ODE become: e νm 0 (y−1)t G(x, y; t) = C 2 , where C 1 and C 2 are integration constants, and: Recall that Equations (A23) and (A24) define a family of characteristic curves on our integral surface. This means that these curves draw this surface as a real parameter continuously changes, which implies that C 1 and C 2 cannot be freely chosen, but should depend on each other. This dependence can be written in terms of an arbitrary function, C 1 = Ψ(C 2 ). In fact, one can check that the function: is a general solution of the initial PDE given by Equation (A16) whatever the function Ψ(w) is. It is the initial condition that fully determines this function. We require that G(x, y; 0) = y m 0 : One can check that this function should be: Plugging this expression into the general solution Equation (A25), we obtain: After bringing G(x, y; t) to the left-hand side of the equation, we obtain: G(x, y; t) = e νm 0 (y−1)t    which is Equation (74) of the main text. One can check that this function is a particular solution of Equation (A16) satisfying the initial condition G(x, y; 0) = y m and the normalization requirement G(1, 1, t) = 1 for all t.

Appendix C. Generalization to Spatial Dynamics
In this Appendix, we describe the dynamics of discrete individuals of a given species X moving in a two-dimensional discrete spatial lattice. The number of individuals in each site of the lattice (x, y) at time t is given by n(x, y; t) with n ≥ 0, n ∈ N, x ∈ [1, · · · , L], y ∈ [1, · · · , L], and t ∈ R, where the total number of nodes is M ≡ L × L.
The process is completely defined by the lattice edge L > 0, L ∈ N, the initial number of individuals in each site n(x, y; 0), (x = 1, . . . , L, y = 1, . . . , L), the possible movements, and the per capita movement rate of each individual into neighboring sites across the lattice. Assuming the same rate µ for every movement, the total rate of the process at time t is given by: This rate defines the distribution of times between movement events. This Markovian process, in the limit of continuum densities, can be described by the following coupled ODE system: for i = 1, . . . , M. Moreover, the definition of µ as a per capita random movement rate between patches ensures that the discrete model so defined also converges to the diffusion equation in the continuum limit, in the limit of the lattice step tending to zero.
In addition, the model can also be regarded as a metapopulation model where populations are located at every node of a network. General network structures can be implemented without much trouble. For instance, assume a network of patches at given physical distances, d ij , from each other. By using the Hanski convention, that is that migration decays exponentially as between-patch Euclidean distance increases, then the per capita movement rate between patch i and j is defined as: In this case, the total rate given by Equation (A30) is now written as: whereμ (x i , y i ) is defined, as in the case forμ i , analogously, as: Throughout the main text, we described processes occurring in a single site, i.e., without spatially explicit dynamics. This is usually called the reaction part of the dynamics. However, in this Appendix, we showed that the diffusion part can be easily added by prescribing a metapopulation network topology in which individuals move from node to node at a certain per capita movement rate, where each node represents a local community.