1 Introduction and motivation

The study of differential equations with uncertainties is naturally motivated by the key role that differential equations play when modeling real-world phenomena. In this setting, the parameters (initial/boundary conditions, source term and/or coefficients) of the corresponding differential equations need to be set from data that usually contain uncertainties associated with error measurements, lack of knowledge of the physical process (in a wide sense) because of its inherent complexity, etc. These facts make it more realistic to describe the dynamics of the phenomenon under study by means of differential equations that take into account randomness in their formulation. To this end, one mainly distinguishes two approaches: stochastic differential equations (SDEs) and random differential equations (RDEs) (Øksendal 2003; Soong 1973). According to (Banks et al. 2014, p. 258), the theory of RDEs has been much less advanced than that for SDE, despite the fact that RDEs have interesting advantages from a mathematical modeling point of view as highlighted by some recent works (Caraballo et al. 2019; Ke and Xu 2023). Indeed, RDEs offer greater flexibility when they are applied to model real-world problems since instead of assuming a driving stochastic process for describing the uncertainties (such as the standard Wiener process in the case of Itô-type SDE), we can assign appropriate probability distributions to each model parameter (or even a joint distribution) of the corresponding RDE so that its solution captures data uncertainty. As indicated in a number of contributions (see for example, the motivating reasons exhibited in (Caraballo et al. 2019, Sect. 1)), in the setting of biology, and in particular, in the study of population models, it is a major advantage w.r.t. SDEs since these latter equations may provide unrealistic answers (non-positive or unbounded behavior for modeling populations). Although in the last decade there has been a notable increase in the applications of RDEs, they still seem to be less abundant than those of SDEs.

It is important to point out that when solving an RDE, it is not only important to answer the same classical questions as in its deterministic counterpart, namely, calculating, exact or approximately, its solution, stability, etc. It is also relevant to determine the main probabilistic properties of the solution, which is a stochastic process, such as its mean or variance functions. However, a more desirable goal is to determine its finite distributions (also termed fidis), with a particular interest in calculating the first probability density function (1-PDF) since from it one can determine all the one-dimensional moments as well as the probability of any measurable event of interest (Soong 1973, ch. 3). In the setting of RDEs, the random variable transformation (RVT) technique has proven to be useful for facing this problem. The RVT technique is a conceptually straightforward method that in its simplest formulation allows determining the PDF, \(p_X(x)\), of a random variable, X, that is related to another random variable Y (with PDF \(p_Y(y)\)) by a one-to-one transformation, \(X= g(Y)\), admitting a computable inverse, \(Y=h(X)=g^{-1}(X)\). Then, it can be shown that

$$\begin{aligned} p_X(x)=|h'(x)|p_Y(h(x)). \end{aligned}$$
(1)

In higher dimensions, i.e., for \(\textbf{X}\) and \(\textbf{Y}\) random vectors, the previous result permits computing the joint PDF of \(\textbf{X}\) in terms of the joint PDF of \(\textbf{Y}\) replacing \(h'(x)\) in (1) by the Jacobian of the transformation (Soong 1973, pp. 24–25).

The RVT method has been applied to many different problems with random parameters or uncertainties, including in the continuous case, ordinary (Dorini et al. 2016), partial (Hussein and Selim 2009), fractional (Burgos et al. 2021), etc., differential equations, and in the discrete scenario, difference equations, as well as systems of these types of equations (Cortés et al. 2017). However, the applicability of the RVT method has usually been focused on problems where an explicit solution is available. This note aims to emphasize that the RVT method can be nicely applied to far more general problems than those usually considered. As many contributions have mainly focused on applications of the RVT technique to growth population models (Dorini et al. 2018; Bevia et al. 2020, 2023), we here present how to apply this technique to rather general single-species models. Nevertheless, it must be emphasized that it could be similarly applied to problems in other scientific and technical areas.

2 A general class of population growth models

Let \(x\equiv x(t)\) be the population number, density, or biomass at time \(t>0\). We consider the general growth model

$$\begin{aligned} x'=rxg(x), \quad t\ge 0, \quad x(0)=x_0>0, \end{aligned}$$
(2)

where \(r>0\) is the intrinsic per capita growth rate, and \(g(x)\in C^1[0,\infty )\) satisfying the following assumptions:

  1. 1.

    there exist \(K_0, K\), \(0\le K_0< K\), such that \(g(K_0^+)>0\) and \(g(K)=0\),

  2. 2.

    \((x-K)g(x)<0\) for \(x\in (K_0,\infty )\), \(x\ne K\).

Under these conditions, \(V(x)=x-K-\log (x/K)\) is a Liapunov function for (2) in \((K_0,\infty )\), and for any \(x_0>K_0\ge 0\) the population tends to K (the carrying capacity) as \(t \rightarrow \infty \) (Goh 1980; Takeuchi 1996).

This general growth model embraces many of the most usual population models, including several models where a closed-form solution for x(t) can be obtained. Some of these models have been studied in the random setting taking advantage of the RVT method, such as the logistic model (Dorini et al. 2016, 2018),

$$\begin{aligned} g(x)=1-\frac{x}{K}, \quad K_0= 0, \end{aligned}$$
(3)

the Gompertz model (Bevia et al. 2020),

$$\begin{aligned} g(x)=-\log \left( \frac{x}{K}\right) , \quad K_0= 0, \end{aligned}$$
(4)

or Gilpin and Ayala (1973) generalised logistic model (Bevia et al. 2023),

$$\begin{aligned} g(x)=1-\left( \frac{x}{K}\right) ^\rho , \quad K_0= 0. \end{aligned}$$
(5)

Considering now the intrinsic growth rate as a random variable, R, so that x(t) is also a random variable written as \(X\equiv X(t)\) for fixed \(t>0\), it is clear that R can always be explicitly expressed in terms of X,

$$\begin{aligned} R=h(X)=\frac{1}{t}\int _{x_0}^{X} \frac{\textrm{d}s}{sg(s)},\quad x_0>0, \end{aligned}$$
(6)

even when a closed-form expression for x(t) in the corresponding pathwise deterministic problem is not available. Thus, denoting by \(p_R(r)\) and \(p_{X(t)}(x)\) for the PDF of the random variable R and the 1-PDF of the stochastic process X(t), respectively, and applying the RVT method (for t arbitrary but fixed), one has

$$\begin{aligned} p_{X(t)}(x)=|h'(x)|p_R(h(x))=\frac{1}{tx|g(x)|}p_R\left( \frac{1}{t}\int _{x_0}^{x} \frac{\textrm{d}s}{sg(s)}\right) ,\qquad t>0,\, x>x_0>0.\nonumber \\ \end{aligned}$$
(7)

Remark 1

In many situations, as in the following example, the integral in (7) can be explicitly obtained, but even if that were not the case, it could be carefully computed numerically for given t and x values.

Example 1

(A growth model with a strong Allee effect) Consider model (2) with \(g(x)=\left( \frac{x}{K_0}-1\right) \left( 1-\frac{x}{K}\right) \). This model exhibits critical depensation or strong Allee effect, with the per capita growth rate, rg(x), being negative at low densities until reaching a minimum threshold size (Gruntfest et al. 1997). Thus, for \(0<x_0<K_0\) the population goes extinct, while for any \(x_0>K_0\) it tends to the stable positive equilibrium value K.

Although the solution of this model can only be expressed implicitly, when the intrinsic growth rate is a random variable the 1-PDF of the stochastic process \(X\equiv X(t)\) can be obtained from (7),

$$\begin{aligned} p_{X(t)}(x)=\frac{1}{tx\left| \frac{x}{K_0}-1\right| \left| 1-\frac{x}{K}\right| }p_R\left( \frac{1}{t}\int _{x_0}^{x} \frac{\textrm{d}s}{s\left( \frac{s}{K_0}-1\right) \left( 1-\frac{s}{K}\right) }\right) . \end{aligned}$$
(8)

Hence, for \(K_0<x_0<K\) one gets

$$\begin{aligned} p_{X(t)}(x)=\frac{K_0K}{tx\left( x-K_0\right) \left( K-x\right) }p_R\left( h(x)\right) , \end{aligned}$$
(9)

where

$$\begin{aligned} h(x)=\frac{1}{t(K-K_0)}\log \left( \left( \frac{K-x_0}{K-x}\right) ^{K_0}\left( \frac{x-K_0}{x_0-K_0}\right) ^{K}\left( \frac{x_0}{x}\right) ^{K-K_0}\right) . \end{aligned}$$
(10)

Figure 1 shows the 1-PDF of X(t) at the time instants \(t\in \{1,5,20 \}\) when \(R\sim \textrm{Ga}(\alpha ,p)\), i.e. it has a Gamma distribution with parameters \(\alpha >0\) (rate) and \(p>0\) (shape) whose PDF is \(p_R(r)=\frac{ r^{p-1}}{\alpha ^p (p-1)!}\textrm{e}^{- r/\alpha }\). When \(p=1\), R becomes an exponential distributed random variable with mean \(\alpha \): \(R\sim \textrm{Exp}(\alpha )\). The results for this case are shown in Fig. 1 (left), while Fig. 1 (right) corresponds to \(p=2\).

Fig. 1
figure 1

1-PDF of the stochastic process \(X(t)\equiv X\) in Example 1 with parameters \(K_0=1\), \(x_0=2\), \(K=4\). It has been at the time instants \(t=1\) (red); \(t=5\) (blue) and \(t=20\) (green), assuming that the intrinsic growth rate is a random variable with gamma distribution, \(R\sim \textrm{Ga}(\alpha ,p)\) with \(\alpha =0.2\), and \(p=1\) (left) or \(p=2\) (right). Computations have been carried out using (9) and (10) (color figure online)

Remark 2

So far, we have assumed that the only random parameter in the growth model (2) is the intrinsic per capita rate r. However, we can also assume that the carrying capacity K is not deterministic but random due to uncertain fluctuations in the environment (Braumann 2008). In such a case, the function g(x) in (2) will also depend on K as it happens in the logistic and Gompertz models (see (3) and (4), respectively). Analogously, for the generalized logistic model (5) the \(\rho \) parameter controlling how fast the limit K is approached can also be regarded as a random variable since it will depend on environmental, genetic, etc., factors. When the above-mentioned situations happen, i.e., \(g(x)=g(x;\varvec{\theta })\) being \(\varvec{\theta }=(\theta _1,\ldots ,\theta _n)\) a random vector collecting the model parameters (\(\varvec{\theta }=K\) in models (3) and (4), and \(\varvec{\theta }=(K,\rho )\) in model (5)), our approach can be extended using the RVT technique. Indeed, it is enough to introduce the random vector \(\textbf{T}=\varvec{\theta }\) and define the mapping \(\mathbb {R}^{n+1} \longrightarrow \mathbb {R}^{n+1} \) such that \((\textbf{T},R)\longrightarrow (\varvec{\theta },R) \) whose Jacobian is \(h'(x)\), then the 1-PDF of X(t) is given by

$$\begin{aligned} p_{X(t)}(x)=\int _{\mathbb {R}^n} \frac{1}{tx|g(x,\varvec{\theta })|}p_{\varvec{\Theta },R}\left( \varvec{\theta },\int _{x_0}^{x} \frac{\textrm{d}s}{g(s,\varvec{\theta }}\right) \textrm{d}\varvec{\theta }, \end{aligned}$$
(11)

where \(p_{\varvec{\Theta },R}(\varvec{\theta }, r)\) denotes the joint PDF of the random vector \((\varvec{\Theta },R)\). As the number n of random parameters \(\varvec{\theta }=(\theta _1,\ldots ,\theta _n)\) is high, the computation of the 1-PDF given in (12) using quadrature rules could become unaffordable. In such a case, assuming that the growth rate R is independent of \(\varvec{\theta }\) (which is a plausible hypothesis from a practical standpoint), the 1-PDF \(p_{X(t)}(x)\) given in (12) can be alternatively computed via the following expectation

$$\begin{aligned} p_{X(t)}(x){} & {} = \int _{\mathbb {R}^n} \frac{1}{tx|g(x,\varvec{\theta })|}p_{\varvec{\Theta }}\left( \varvec{\theta }\right) p_{R}\left( \int _{x_0}^{x} \frac{\textrm{d}s}{g(s,\varvec{\theta })}\right) \textrm{d}\varvec{\theta } \nonumber \\ {}{} & {} = \mathbb {E}_{\varvec{\Theta }}\left[ \frac{1}{tx|g(x,\varvec{\theta })|}p_{R}\left( \int _{x_0}^{x} \frac{\textrm{d}s}{g(s,\varvec{\theta }}\right) \right] . \end{aligned}$$
(12)

This expression is simpler since it is enough sampling the random vector \(\varvec{\Theta }\) from its joint PDF \(p_{\varvec{\Theta }}\) and evaluate the argument within the above expectation and then averaging to approximate the 1-PDF over a range of x such that \(\int _{\mathbb {R}} p_{X(t)}(x)\, \textrm{d}x=1\), for t fixed.

As exemplified in different works applying the RVT method to model with multiple random parameters (e.g., Dorini et al. 2018; Bevia et al. 2023), computing \(p_{X(t)}(x)\) for particular growth models and distributions of the random parameters, either analytically or with a numerically efficient method, may not be straightforward, possibly requiring special particular approaches.

3 Autonomous models

We consider now a more general growth model in the form of an autonomous equation,

$$\begin{aligned} x'=xg(x,q), \quad t\ge 0, \quad x(0)=x_0>0. \end{aligned}$$
(13)

For the sake of clarity, we single out the case of one random parameter, but the multiparameter case can be tackled as indicated in Remark 2.

From (13) one gets

$$\begin{aligned} t=\int _{x_0}^{x} \frac{\textrm{d}s}{sg(s,q)}. \end{aligned}$$
(14)

Hence, if q is the realization of a random variable Q, consequently x(t) is the pathwise solution at time t of a random variable X. Considering the fixed time t as the realization of a random variable T with Dirac delta PDF, by applying the RVT method one gets

$$\begin{aligned} p_{X(t)}(x)=\int _{\mathbb {R}} p_Q(q)\frac{1}{x|g(x,q)|}\delta \left( t-\int _{x_0}^{x} \frac{\textrm{d}s}{sg(s,q)}\right) \textrm{d}q. \end{aligned}$$
(15)

Example 2

(A growth model with harvesting) A strong Allee effect may be typical in some fisheries, which can also be harvested. Adding proportional harvesting to the model in Example 1, one gets a model of the type (13),

$$\begin{aligned} x'=x\left( r\left( \frac{x}{K_0}-1\right) \left( 1-\frac{x}{K}\right) -q\right) , \quad t\ge 0, \quad x(0)=x_0>0, \end{aligned}$$
(16)

where none of the parameters can be expressed explicitly in terms of x.

Parameter q, fishing mortality, the product of fishing effort and catchability, may not be easy to fix without uncertainty. We consider in this example that it might be in the range \(q_1-q_2\), without further knowledge, so we assume that it is a random variable, Q, with uniform distribution (non-informative distribution) in the interval \([q_1,q_2]\). Hence, from (15) one gets, for \(K_0<x_0<K\),

$$\begin{aligned} p_{X(t)}(x)=\int _{q_1}^{q_2} \frac{1}{q_2-q_1}\frac{1}{xg(x,q)}\delta \left( t-\int _{x_0}^{x} \frac{\textrm{d}s}{sg(s,q)}\right) \textrm{d}q, \end{aligned}$$
(17)

where

$$\begin{aligned} g(x,q)=\left( r\left( \frac{x}{K_0}-1\right) \left( 1-\frac{x}{K}\right) -q\right) >0. \end{aligned}$$
(18)

Figure 2 (left) shows the distribution of the stochastic process X(t) at the time instants \(t\in \{1,2,3\}\) when the fishing mortality Q is a uniform random variable in the interval [0.1, 0.2]. For each t, X(t) takes values in the interval defined by the pathwise solutions x(t) corresponding to \(q=0.1\) and \(q=0.2\). The dynamics of the expectation \(\mathbb {E}[X(t)]\) and the confidence interval centered at it and radius one standard deviation, \(\sigma [X(t)]\) is presented in Fig. 2 (right).

Fig. 2
figure 2

Left: 1-PDF for the stochastic process \(X(t)\equiv X\) in Example 2, with parameters \(r=0.4\), \(K_0=1\), \(x_0=2\), \(K=10\), at the time instants \(t=1\) (red); \(t=2\) (blue) and \(t=3\) (green), assuming that the fishing mortality is a uniform random variable, \(Q\sim \textrm{Uniform}[0.1,0.2].\) Right: Expectation (red line) plus/minus the standard deviation (grey lines), \(\mathbb {E}[X(t)]\pm \sigma [X(t)]\) (color figure online)

Remark 3

(Time dependent separable models) A similar approach might be applicable to more general separable models. Consider for instance the model in Example 1 with a time-declining intrinsic growth rate, possibly due to degrading environmental factors,

$$\begin{aligned} x'=r\textrm{e}^{-\frac{\alpha t}{1+t}}x\left( \frac{x}{K_0}-1\right) \left( 1-\frac{x}{K}\right) , \quad t\ge 0, \quad x(0)=x_0>0, \end{aligned}$$
(19)

We can write, as in (15),

$$\begin{aligned} R=h(X)=\frac{1}{\int _{0}^{t}\textrm{e}^{-\frac{\alpha s}{1+s}}\textrm{d}s}\int _{x_0}^{X} \frac{\textrm{d}s}{sg(s)}, \end{aligned}$$
(20)

and proceed accordingly.

4 Conclusion

In this paper, we have shown how the RVT method can be effectively applied to general classes of random differential equations without the requirement of having an explicit solution for the corresponding pathwise deterministic equation. We have illustrated this idea by considering the application of the RVT method to very general single-species population models, including as particular cases some of the most commonly employed population models. We expect that the ideas and examples exhibited in this note will help extend the use of the RVT technique to wider classes of differential equations with random parameters that may open new avenues in the applications of differential equations with uncertainties.