Introduction

Adaptive and non adaptive evolution is characterized by the dynamics of allele frequencies and their eventual loss or fixation. Recently, comparative population genomics have suggested that life-history strategies are good predictors of the genetic diversity maintained in populations. Indeed, species with high investment in survival and lower investment in reproduction (K strategy) show lower levels of genetic diversity than those with a high investment in reproduction and low investment in survival (r strategy) (Romiguier et al. 2014; Chen et al. 2017). Currently, we have no theoretical predictions as to why and how life-history strategies affect genetic diversity. For more than half a century, the diffusion limit of the Wright–Fisher model (Fisher 1930; Wright 1931), introduced by Kimura (1957, 1962), has provided one of the key tools in population genetics for predicting the dynamics of allelic frequencies. Due to simple and strong analytical results obtained for this general model (Kimura 1970), it has been extended to take into account populations with more general and complicated behaviors such as non-random mating and structured populations (see for example Caballero and Hill 1992; Bataillon and Kirkpatrick 2000; Roze and Rousset 2004). However, the Wright–Fisher model does not provide an appropriate theoretical framework for exploring differences in life-history strategies on allele frequency dynamics (Parsons et al. 2010). This is because it makes two simplifying assumptions: (1) all individuals reproduce and die at the same time (discrete non-overlapping generations), and (2) population size is fixed, which has led to the concept of “effective population size”, denoted Ne (and discussed below). These two assumptions are violated in most natural populations: births and deaths can be independent events (reproduction by an individual is not necessarily immediately followed by its death, see for instance Champagnat et al. 2006), the speeds at which reproduction and death occur representing different life-history strategies (i.e., r/K strategies), population size tends to vary stochastically and there can be skewed reproductive values, with few individuals effectively contributing to the next generation. New theoretical approaches must therefore be developed in which the consequences of these strategies can be accounted for. As can be seen in Wahl (2011), extensions of the Wright–Fisher model and diffusion to a variable population size framework have been defined and studied, in, for example, Waxman (2011), but this approach does not allow for a real interaction between demography and the genetic composition of the population, since population size is imposed as an external parameter.

Individual-based models, that simulate populations as being composed of discrete individual organisms (De Angelis and Grimm 2014), provide the ideal theoretical approach to studying the interaction between population size dynamics on the microscopic scale (demographic changes due to independent births and deaths) and probabilities of fixation (Champagnat et al. 2006; Champagnat and Lambert 2007; Parsons et al. 2010; Uecker and Hermisson 2011). Demographic parameters can be defined so as to represent different rates of reproduction and survival, the ensuing demographic behavior of the population and the linked allelic dynamics arising naturally. The importance of macroscopic demographic events can also be considered in such models (i.e. bottlenecks or expansions), as Romiguier et al. (2014) have suggested that the consequences of life-history strategies on genetic diversity may overwhelm any traces of strong demographic perturbations on a macroscopic scale, a hypothesis that has yet to be tested. Furthermore, individual-based models can also account for the feedback between genetics and demography, a central aspect in models of evolutionary rescue (Orr and Unckless 2008; Glemin and Ronfort 2013), as it can have a major impact on population viability, notably when selection is relatively strong. Previously, life-history strategies have been studied using deterministic analysis (hence ignoring the effects of stochasticity), in Lin et al. (2012); and in Parsons et al. (2010), the authors explored the consequences of different life-history strategies and proposed an individual-based model with “quasi-neutral” selection so that the impact of population genetics on population demography can be neglected, thus neglecting any consequences of demo-genetic feedback.

In existing theoretical models studying allele dynamics, Ne is a central notion which aims at bringing any population as “close” as possible (the definition of closeness being dependent on the indicators of interest) to a classical Wright–Fisher diffusion. Many theoretical approaches rely on this concept, notably to quantify the genetic diversity of populations. It therefore seems important to find a way to link this quantity to the behavior of individuals, possibly presenting different life-history strategies. Previous works have found that the harmonic mean of the population size could provide a good proxy for Ne when taking demographic behavior into account (Wright 1938; Kimura and Ohta 1969; Otto and Whitlock 1997). The harmonic mean of the population size is also used in coalescent models to represent the Ne when population size varies stochastically as long as the fluctuations occur at a faster scale than coalesence events (see cited works within Sjödin et al. 2005). On the other hand, Iizuka et al. (2002); Iizuka (2010) showed that the harmonic mean size is sometimes an inadequate definition and the authors proposed a new definition for Ne (the heterozygosity effective size). Indeed, depending on the speed of the demographic fluctuations in relation with coalescence events, an effective population size as such, may not be definable. When fluctuations occur at a similar time-scale as coalescence events, they have a non-linear stochastic effect on the timescale of the coalescent (see Sjödin et al. 2005). In this case, the coalescent effective population size is a stochastic variable that needs to be re-calculated at every time step in order to account for the effects of changes in population size. In Parsons et al. (2010), the authors found that they could not define an appropriate Ne for which a classical neutral Wright–Fisher diffusion would give the same mean time to absorption and fixation probability as their model. Mean times to fixation of neutral alleles, and eventually the distribution of these times, in the Wright–Fisher diffusion depend on the population’s Ne (Kimura and Ohta 1969) and are thus expected to be affected by a population’s demographic dynamics (notably due to macroscopic events such as bottlenecks, expansions and extinctions, as can be deduced from works on coalescent theory, Greenbaum 2014). On the contrary, the fixation probability of a neutral allele is always expected to be equal to its initial frequency. That Parsons et al.’s (2010) results for quasi-neutrality are better described by a Wright–Fisher diffusion with selection (Fig. 4 in their paper) thus raises three questions: (i) What role do life-history strategies play in the probabilities and times to fixation? (ii) If genotypes under selection present different demographic behaviors (i.e., growth rate), how is the ensuing change in population size likely to influence the probabilities and times to fixation? (iii) How should Ne and fitness be defined in individual-based models in order to render them, if possible, comparable to a Wright–Fisher framework?

Here we propose an individual-based model, in that the behavior of the population depends on parameters affecting the demographic behavior of the individuals it is composed of and not on parameters at the population level (i.e., a general population growth rate), in order to study the absorption times and fixation probabilities in a demo-genetic context. Contrary to previous models, where individuals were haploid (Champagnat et al. 2006; Champagnat and Lambert 2007; Parsons et al. 2010), we consider a sexually reproducing diploid population, with general dominance relationships between alleles, the possibility of self-fertilization and allow for extinction in finite time. In this probabilistic model (which is properly defined with a more general form of selection but without the possibility of fertilization in Coron (2016, 2015)) both the demography and genetics of a given population are defined through the stochastic dynamics of each individual within the population, which themselves are dependent on demographic parameters that can be estimated (Moran 1953). As population size is directly determined by frequent birth and death events, it changes stochastically with time, and can also depend on the population’s genetic composition. We provide a measure of the effective population size that renders the diffusion of this model comparable to a Wright–Fisher diffusion, which assumes a fixed population size, in order to asses whether the Wright–Fisher diffusion is able to capture allele frequency dynamics due to differences in life-history strategies. The differences in life-history strategies are due to a natural behavior of the model and depend directly on the demographic parameters (as in, e.g., Parsons et al. 2010), being in no way forced. Due to the bi-dimensional nature of this model (both genetic frequencies and population size are stochastic), there are no simple analytical results to predict times and probabilities of fixation; all results were therefore obtained using simulations of the stochastic trajectories of the diffusion process.

Our main findings are that:

  1. (i)

    Despite the individual-based behavior of our model, we show that it can be seen as a generalization of the Wright–Fisher diffusion model, as letting some parameters of the model go to +∞ (namely the growth and competition rates), we obtain the Wright–Fisher diffusion. This implies that, as shown in our results, the behavior of populations with r life-history strategies can be well captured by the Wright–Fisher diffusion when using the appropriate effective size (which in some cases is equivalent to the mean inbreeding effective population size).

  2. (ii)

    We find that when population turnover is low due to high survival and low reproductive rates (K life-history strategies), times to fixation of a rare allele (even one under negative selection) are generally over-estimated in the Wright–Fisher diffusion model. This discrepancy is further accentuated when taking into account external sources of population size variability, notably following rapid expansions or bottlenecks. We would therefore expect weaker purifying selection in species with K life-history strategies, and that predictions concerning the expected rates of the decay of genetic diversity in natural populations may be overly optimistic when using methods based on the Wright–Fisher model.

  3. (iii)

    Any demographic consequences of an allele under selection can greatly influence allele frequency dynamics, especially in the case of populations with K strategies. This impacts the probabilities and times to fixation in a way that cannot be fully captured by the proposed effective population size.

Materials and methods

Model and the limiting diffusion process

We consider a population of diploid individuals, characterized by their genotype at a single bi-allelic locus with alleles A and a. The population is modeled by a 3-dimensional stochastic birth-and-death process (detailed in Appendix A) giving the respective numbers of individuals with genotype AA, Aa and aa. Contrary to previous models where population size is a parameter, here it is a random variable, emerging from the behavior of each individual. The dynamics of population size is stochastic, and population extinction occurs with probability 1. As we will be focusing on the diffusion limit of an individual-based model (detailed in Appendix A), throughout this article we will be preferentially using the term “population mass”, as population size will be considered as being effectively infinite. Population mass therefore represents a comparative of populations with very large/infinite sizes.

Limiting diffusion process

Let us focus on the two following variables: the population mass \({\cal N}_t^K\) at time t and the proportion \(X_t^K\) of allele a at time t. As explained in Appendix A and shown in Coron (2016), under a large population assumption and after an appropriate re-scaling of birth and death rates, the process \(\left( {{\cal N}_t^K,X_t^K} \right)_{t \ge 0}\) converges toward a bi-dimensional diffusion process \(\left( {{\cal N}_t,X_t} \right)_{t \ge 0}\) whose equation can be written as:

$$\begin{array}{*{20}{l}}{d{\cal N}_t} = {\sqrt {2\gamma {\cal N}_t} dB_t^1 + {\cal N}_t\left[ {\rho - \xi {\cal N}_t + \sigma X_t\left( {2h} \right.} \right.} \\\qquad \quad {\left. {\left. { + X_t(1 - 2h) + F(1 - X_t)(1 - 2h)} \right)} \right]dt,} \end{array}$$
(1a)
$$\begin{array}{*{20}{l}}{dX_t} = \sqrt {\frac{{2\gamma X_t(1 - X_t)}}{{2\frac{{{\cal N}_t}}{{1 + F}}}}} dB_t^2 + \sigma X_t(1 - X_t) \\ \qquad\quad\times \left[h + X_t(1 - 2h) + F(1 - X_t - h + 2X_th)\right]dt.\end{array}$$
(1b)

where \(\left( {B_t^1,B_t^2} \right)_{t \ge 0}\) is a bi-dimensional standard Brownian motion (stochastic component of the equation). This diffusion model can be generalized without difficulty to any finite number of alleles, as presented in Coron et al. (2017). Equations (1a) and (1b) with F = 0 can seem different than the one given in Remark 2 of Coron (2016). This is due to the fact that we consider here (for an easy comparison with population genetics models) the proportion of allele a, whereas the proportion of allele A was considered in Coron (2016). Without loss of generality, we can assume that the time scaling parameter γ is equal to 1/2, thus simplifying the above equations. In this case, if the stochastic quantity \(\frac{{{\cal N}_t}}{{1 + F}}\) is artificially replaced by a fixed parameter Ne, then the model given in (2a) and (2b) is the Wright–Fisher diffusion with selection and self-fertilization presented in Caballero and Hill (1992), where the parameter σ in our model is equal to the coefficient of selection s of Caballero and Hill (1992) and Ne is the effective population mass. Increasing γ increases the speed at which individuals reproduce and die, meaning that at each time step there are more reproductive or death events. A possible interpretation of this phenomenon is that some individuals produce more offspring. This does seem to mimic sweepstakes reproduction phenomena observed in many natural populations (Hedgecock and Pudovkin 2011), but because of the binomial nature of the sampling process, this does not quite correspond to the aforementioned multiple merger coalescents (Schweinsberg 2003), as the variance of reproductive success remains close to the mean number of descendants produced. Intuitively, considering a parameter γ greater that 1/2 would thus result in dividing Ne by a factor 2γ (see Figure A.2 in the Appendix).

More interestingly, the Wright–Fisher diffusion with selection and self-fertilization can also be directly retrieved from our model, by setting ρ/ξ = Ne and letting ρ got to +∞. In order to determine whether a constant effective population mass can summarize the effects of a stochastic population mass as proposed in earlier models (Kimura 1970; Otto and Whitlock 1997), we define a fixed effective population mass Ne in such a way that the model in Caballero and Hill (1992) is adequately calibrated.

Simulating the diffusion process

In Caballero and Hill (1992), the authors provide explicit formulas for the probabilities of fixation as well as approximations for the times to loss or fixation of an allele. Due to the bi-dimensionality of our model which largely increases the difficulty of mathematical calculations, fixation probabilities as well as laws of times to fixation, loss and absorption (either loss or fixation) of allele a are determined using simulations of Eqs. (1a) and (1b). These simulations are run using a script written in C++ (which is available from Dryad). The stochastic elements of the equations, \(B_t^1\) and \(B_t^2\) are obtained by successive samplings from a normal distribution with mean 0 and variance dt. dt is the size of the time step and is a parameter fixed at the beginning of the simulation, which we have set to 10−4 for a carrying capacity \({\cal K} = 100\) and and 10−5 for \({\cal K} = 10\) and 1. Each simulation is run until the allele a is either lost or fixed and 100 thousand replicas are run for each parameter set from which the probability of fixation, as well as the means and laws of times to fixation, loss and absorption are obtained.

In order to test whether deviations in times to loss or fixation from the approximations provided in Caballero and Hill (1992) are due to demographic stochasticity or due to the approximations made, we run simulations of the Wright–Fisher Diffusion (using a fixed population mass Ne, defined below in Eq. (6)). We also run simulations to assess the effects of the feed-back between selection and demography by artificially setting σ = 0 in Eq. (1a) only. In order to evaluate the effect of the change in population mass due to the fixation of an allele under selection with an effect σ, we also consider the case where the carrying capacity is equal to (ρ + σ)/ξ.

Results

Demography

The change in population mass given in Eq. (1a) is made up of a stochastic term (dependent on \(dB_t^1\)) and a deterministic one (dependent on dt). In this diffusion model with selection and self-fertilization, the probability of extinction is equal to 1. The law of the time to extinction depends on the ecological and genetic parameters. In the neutral case where σ = 0, Eqs. (1a) and (1b) can be simplified the following way:

$$d{\cal N}_t = \sqrt {2\gamma {\cal N}_t} dB_t^1 + {\cal N}_t\left[ {\rho - \xi {\cal N}_t} \right]dt,$$
(2a)
$$dX_t = \sqrt {\frac{{2\gamma X_t(1 - X_t)}}{{\frac{{2{\cal N}_t}}{{1 + F}}}}} dB_t^2.$$
(2b)

Here population mass is independent of its genetic composition and the deterministic term of Eq. (2a) cancels out when \({\cal N}_t = {\cal K}\) where

$${\cal K} = \frac{\rho }{\xi }$$
(3)

is defined as the population’s carrying capacity. Note that \({\cal K}\) does not represent the number of individuals that can be sustained in the population (since \({\cal N}_t\) is scaled by K which goes to infinity) but is an indicator of the amplitude of demographic stochasticity, as will be shown below. In order to model and compare different life-history strategies, we change the values of ρ and ξ, while maintaining their ratio \({\cal K}\) constant. Increasing ρ represents an increased investment in reproduction, and for a fixed \({\cal K}\), a decreased competitive ability, hence lower survival rate (r strategy, high turnover rate), whereas decreasing ρ would have the opposite effect (K strategy, low turnover rate).

When population mass is smaller (resp. larger) than \({\cal K}\), it will tend to increase (resp. decrease). For a fixed value of \({\cal K}\), if ρ is large, then the population mass will remain close to \({\cal K}\), whereas for small values of ρ the mass will tend to deviate further from \({\cal K}\) (see Fig. 1). The smaller ρ the slower the population mass will come back to its pseudo equilibrium \({\cal K}\); therefore a small value of ρ can have an important impact on extinction, as can be seen in Fig. 1 (black lines). The role of \({\cal K}\) on the demographic dynamics is not as straightforward since \({\cal N}_t\) is implicated in both the stochastic and deterministic terms (therefore both terms are increased when \({\cal K}\) increases). In Fig. 1 we also see that the effect of ρ on demographic stochasticity is weaker when \({\cal K}\) is smaller.

Fig. 1
figure 1

Top: Trajectories of the population mass (Nt, t ≥ 0), for \(N_0 = {\cal K}\) and \({\cal K} = \rho {\mathrm{/}}\xi = 1\) (left), \({\cal K} = \rho {\mathrm{/}}\xi = 100\) (right), for ρ = 0.1 (black) and ρ = 10 (gray). Bottom: Trajectories of the population mass (Nt, t ≥ 0), for \({\cal K} = \rho {\mathrm{/}}\xi = 1\) and N0 = 100 (left), and \({\cal K} = \rho {\mathrm{/}}\xi = 100\) and N0 = 1 (right), for ρ = 0.1 (black) and ρ = 10 (gray). For N0 = 1, ρ = 0.1 and \({\cal K} = 100\) (bottom-right figure), we plot 3 trajectories

Effective population mass

In the neutral case (Eqs. (2a) and (2b)), variations in population mass are modeled by a logistic diffusion process (and thus are independent from the genetic composition of the population) and changes in allele frequency by a Wright–Fisher diffusion with population mass \({\cal N}_t\) at any time t. Hence, it is natural to compare this model to the neutral Wright–Fisher diffusion model of population genetics, for which the proportion \(X_t^{WF}\) of a neutral allele at all time satisfies

$$dX_t^{WF} = \sqrt {\frac{{X_t^{WF}\left( {1 - X_t^{WF}} \right)}}{{2N_e}}} dB_t.$$
(4)

Here Ne represents the effective population mass of a self-fertilizing population (as described in Caballero and Hill 1992) and is a parameter of the Wright–Fisher diffusion model.

One definition for Ne classically used is that of the inbreeding effective population size Ne(f) (Kimura 1970, Chapter 7.6). This parameter is defined as being, at time t, equal to 1/Pt, where Pt is the probability that two individuals descend from the same parent from generation t − 1. In the Wright–Fisher model with random mating and reproduction follows a Poisson distribution Pt = 1/(Nt − 1) ≈ 1/Nt when \(N_t \gg 1\), hence giving Ne(f) = Nt. In our model, the number of offspring per individual follows a geometric law whose mean and variance converge to 2 under the scaling we consider. Following the method provided in (Kimura 1970, Chapter 7.6), we find that, as for the Wright–Fisher model, Pt ≈ 1/Nt. In order to provide a general Ne(f) for a given parameter set, we assume that the mean 1/Pt from time t = 0 until the time to loss or fixation of the allele (the time to absorption) Tabs, is the inbreeding effective population size for a single simulation, and, using the definitions provided above, that the mean of this random variable over all simulations gives

$$N_{e(f)} = E\left( {\frac{{2\gamma T_{abs}}}{{{\int}_0^{T_{abs}} \frac{1}{{{\cal N}_t}}dt}}} \right),$$
(5)

where E(V) is the expectation of the stochastic variable V. When γ = 1/2, Eq. (5) gives the expected harmonic mean population size. As shown in Figure A.1 in the Appendix, though this definition given by Eq. (5) does well for large birth rates ρ, it is not appropriate for parameters resulting in highly fluctuating population mass, and we need to provide another definition of Ne.

The parameters ρ, ξ and the inbreeding coefficient F being fixed in our model, we provide another definition for a fixed effective population mass Ne that allows us to compare our model with variable population mass to a Wright–Fisher diffusion. In order to calibrate Ne, it is not enough for the probability of fixation to be the same in both models, as in the neutral case the fixation probability of an allele a is simply equal to its initial proportion. Therefore, we have chosen to calibrate Ne such that the mean absorption time (time to either loss or fixation) is the same in both models. From Appendix B, Ne is defined as:

$$N_e = \frac{{{\Bbb E}\left( {T_{abs}} \right)}}{{(1 + F){\Bbb E}\left[ {{\int}_0^{T_{abs}} \frac{{2\gamma }}{{{\cal N}_t}}dt} \right]}}.$$
(6)

This definition is close to the one provided in the appendix of Sjödin et al. (2005) for a coalescent Ne in populations where size varies at the same time-scale as coalescent events. Differences between the expression they provide and ours are due to the approach they present applying to a single population’s demographic history (making their Ne a stochastic variable), us considering times to absorption (hence coalescence), whereas they take non-coalescence as an indicator, and our modeling a bi-allelic, and not multi-allelic, locus. With these definitions (Eq. (6) and the appendix of Sjödin et al. (2005)), Ne depends on the initial frequency X0 of allele a; this dependence is illustrated in Figure A.1 in the Appendix. We obtain numerical estimations of the quantity Ne from the simulation runs of Eqs. (1a) and (1b) with varying population mass, calculating \({\Bbb E}\left( {T_{abs}} \right)\) and \({\Bbb E}\left[ {{\int}_0^{T_{abs}} \frac{1}{{{\cal N}_t}}dt} \right]\) using all repetitions run for each parameter set. In Fig. 2 (left) we plot the mean times to absorption as a function of the initial proportion of allele a, and for different values of ρ. This mean time to absorption is given for our model with varying population mass, for the Wright–Fisher diffusion (4) using the effective population mass Ne given in Eq. (6), as well the theoretical result provided in Eqs. (12) and (13) from Caballero and Hill (1992). Figure 2 therefore shows that the models are indeed correctly calibrated for different values of parameters ρ, ξ and X0 (for different population densities and the effect of the inbreeding coefficient F see Figure A.3 in the Appendix).

Fig. 2
figure 2

Mean times to absorption (left) and fixation (right) of a neutral allele (σ = 0) as a function of the initial frequency X0 of allele a, for three cases: (1) Simulations of the stochastic diffusion process Eqs. (1a) and (1b) (triangles), (2) Simulations of the Wright–Fisher diffusion using Ne defined in Eq. (6) (circles) and 3) Theoretical approximations provided by Caballero and Hill (1992) using Ne (lines). Here we considered pure random mating (α = 0), γ = 1/2, the carrying capacity \({\cal K} = 1\) and the growth rate ρ equals 0.1 (black) or 10 (gray)

In the results shown above and throughout the rest of the paper, we have concentrated only on the time scaling parameter γ = 1/2 so as to be as close as possible to the Wright–Fisher model. In Figure A.2 of the Appendix we show that increasing γ will generally decrease the effective population size. We also find that as γ increases, the differences between the Ne we have proposed and the inbreeding effect size Ne(f) more conventionally used, decreases. This is probably mainly due to the fact that, as fewer individuals contribute to the population, the stochastic noise generated decreases proportionally.

Neutral case: absorption and fixation times laws

Despite equal mean absorption times, the distributions of the times to absorption differ between our model with stochastically varying population mass and the simulation runs of the Wright–Fisher diffusion, notably when the parameters ρ and \({\cal K}\) are small. This is illustrated by Fig. 3 in which we compare the variance of the time to absorption for our model and for the Wright–Fisher diffusion (see also Supplementary Fig. 1, in which the laws of these times to absorption are given for different initial allelic proportions), and this can be understood by decomposing the absorption time into the time to loss or time to fixation of an allele at initial frequency X0. Indeed we find that mean fixation times of minority alleles are lower for the model with stochastically varying population mass (Fig. 2 (right) and Supplementary Fig. 2). This discrepancy between the results with varying and fixed population masses can be explained by the incidence of bottlenecks and extinction events, which is further accentuated by a small value of ρ. This is because a low growth rate results in a weaker impact of the deterministic forces regulating population mass (Eqs. (2a) and (2b)), further increasing demographic stochasticity. Indeed, large demographic fluctuations eventually lead to reduced population mass harmonic means, for which absorption is more rapid and fixation of minority alleles is favored. Indeed, this can be seen in Fig. 4, where despite the probability of fixation for each parameter set being equal to the initial frequency X0 of the allele a, there is a higher frequency of fixations occurring in populations with extreme demographic behaviors.

Fig. 3
figure 3

Ratio of the variance of the absorption time in our model to that of the absorption time in simulations for the Wright–Fisher model using the appropriate Ne from Eq. (6), as a function of growth parameter ρ (left), and carrying capacity \({\cal K}\) (right). On the left \({\cal K} = 1\) while on the right ρ = 0.1

Fig. 4
figure 4

Fixation probability of a rare neutral allele, as a function of effective population mass for each simulation run for a given parameter set (100 thousand simulations per parameter set). We set X0 = 0.01 and ρ = 0.1. On the left, \({\cal K} = 1\) (ξ = 0.1), while on the right \({\cal K} = 100\) (ξ = 0.001)

We can also consider that population mass changes drastically with time, allowing us to model founder effects, or drastic changes in the environment for instance. As previously, we compare the laws of the absorption time in populations with rapidly decreasing or increasing mass. The trajectories of population mass changing with time are shown in Fig. 1 (bottom), and we start with a proportion X = 0.01 of a neutral allele a. We obtain that the laws of the absorption and fixation times are very different when comparing our to the Wright–Fisher diffusion model, despite the same mean absorption times (Fig. 5). In particular, when population mass is kept constant, the frequency of small (and relatively large) absorption times is underestimated when the population mass increases, whereas the opposite is true when the population mass decreases.

Fig. 5
figure 5

Absorption (top) and fixation (bottom) time densities of a neutral allele with initial frequency X0 = 0.01 for our model and for simulations run for the Wright–Fisher model with the appropriate Ne (dotted line). On the left (decreasing population mass), we fix N0 = 100 and \({\cal K} = \rho {\mathrm{/}}\xi = 1\), while on the right (increasing population mass), we fix N0 = 1 and \({\cal K} = \rho {\mathrm{/}}\xi = 100\), with ρ = 0.1

Selection, demography and genetic feedback

In this section we introduce selection through the parameter σ in Eqs. (1a) and (1b). As mentioned above, when comparing Eq. (1b), which describes the dynamics of allelic frequencies, to the Wright–Fisher diffusion, we find that σ has the same effect on allelic frequencies as the conventionally used coefficient of selection s. However, σ is also present in Eq. (1a) and can therefore influence population mass, linking the changes in frequency of the allele a under selection to the dynamics of population mass. Despite the fact that selection is in fact weak and has a negligible impact on individual birth rates (whatever value of the selection parameter \(\sigma \in {\Bbb R}\), see Eq. (4) in the Appendix), the proportion of an allele under selection can have an important impact on the population mass dynamics. The consequences of this interaction can be quantified by the ratio σ/ξ, which is the change in the carrying capacity \({\cal K}\) when the allele under selection a is fixed. Therefore, for a same \({\cal K}\) before fixation but different values of ρ, similar values of σ can lead to very different population mass dynamics (see Fig. 6 with selection for a beneficial allele).

Fig. 6
figure 6

The dynamics of the synonymous changes in population mass and the proportion of allele a in the presence of selection. The coefficient of selection σ = 0.1, \({\cal K} = 100\), with ρ = 0.1 (black, \(\xi = \rho {\mathrm{/}}{\cal K} = 0.001\)) and ρ = 10 (gray, \(\xi = \rho {\mathrm{/}}{\cal K} = 0.1\))

Due to the differences in population dynamics, probabilities and times to fixation can be affected by the growth rate, even for small values of σ (Fig. 7). Lower ρ (K strategy) results in higher probabilities of fixation of deleterious alleles, and lower relative probabilities of fixing beneficial alleles. Furthermore, times to fixation are generally lower for populations with low growth rates, independently of the coefficient of selection.

Fig. 7
figure 7

Ratios of the probabilities of fixation (left) and of times to fixation (right) for low growth rate (ρ = 0.1) to those obtained for high growth rate (ρ = 10) as a function of the initial frequency X0 of allele a with \({\cal K} = 100\), γ = 0.5, h = 0.25 and α = 0 for σ = 0.01 and −0.01

In order to understand and quantify the consequences of the feedback of genetics on demography, it is natural to artificially remove all terms dependent on σ in Eq. (1a), hence removing any impact of changes in proportion of allele a on the dynamics of population mass. More precisely, let us for simplicity assume that F = 0, h = 1/2, and let us consider the following diffusion process \(\left( {{\cal N}_t^{(NF)},X_t^{(NF)}} \right)_{t \ge 0}\) (“NF” standing for “No Feed-back”):

$$d{\cal N}_t^{(NF)} = \sqrt {2\gamma {\cal N}_t^{(NF)}} dB_t^1 + {\cal N}_t^{(NF)}\left[ {\rho - \xi {\cal N}_t^{(NF)}} \right]dt,$$
(7)
$$\begin{array}{*{20}{l}}dX_t^{(NF)} = \sqrt {\frac{{2\gamma X_t^{(NF)}\left( {1 - X_t^{(NF)}} \right)}}{{2\frac{{{\cal N}_t^{(NF)}}}{{1 + F}}}}} dB_t^2\\\qquad\qquad + \frac{\sigma }{2}X_t^{(NF)}\left( {1 - X_t^{(NF)}} \right)dt.\end{array}$$
(8)

For this model without feedback, we can calibrate a Wright–Fisher diffusion with selection, using Eq. (6) with \({\cal N}_t = {\cal N}_t^{(NF)}\), so that the mean time to absorption and the probability of fixation are the same in both models (Fig. 8). In the presence of feed-back (Eqs. (1a) and (1b)), though we generally find that for large \({\cal K}\), large ρ (r strategy) and/or weak selection, the proposed Ne (Eq. (4)) provides a good approximation for the demographic effects on the times and probabilities of fixation, this is not the case for small values of ρ and/or \({\cal K}\). Indeed, when K life-histories are considered (small ρ) there can be some discrepancies between the probability of fixation predicted by our model with feed-back and a population with constant mass Ne when selection is intermediate. This can be seen in Fig. 8 for s = 0.1 where our model with feed-back predicts a probability of up to 10% lower than the population with constant mass Ne for low initial frequencies of the allele a. This difference is even greater for deleterious alleles with s = −0.1 (but for intermediate initial frequencies), simultaneously due to the stochastic nature of population mass and to feed-back which further contributes to decreasing the population mass in this case (Fig. 8). Times to fixation however are well predicted, with generally the model with feed-back being either closer to the model without feed-back and \({\cal K} = \rho + \sigma {\mathrm{/}}\xi\) and \({\cal K} = \rho {\mathrm{/}}\xi\) depending on the initial frequency of the allele X0. We can see from the densities of times to absorption, fixation and loss (Supplementary Fig. 3), that the laws of the times to fixation are very well captured using the constant mass model, though the times to loss are slightly underestimated. Times to fixation of a mildly deleterious allele are however slightly underestimated by the simulations run with constant mass and are closer to the times to fixation of the simulations run without feed-back and \({\cal K} = \rho {\mathrm{/}}\xi\).

Fig. 8
figure 8

Left: Probability of fixation of an allele under selection (σ = 0.1 and −0.1) with \({\cal K} = 100\) and ρ = 0.1 as a function of the initial frequency X0 of allele a for simulations with stochastic population size (triangles) and simulations with the appropriate fixed population size Ne (lines). Simulations with demo-genetic feed-back, without demo-genetic feed-back for \({\cal K} = \rho {\mathrm{/}}\xi\) and without feed-back for \({\cal K} = \rho + \sigma {\mathrm{/}}\xi\) are shown in black, dark gray and light gray respectively (full, dotted and dashed lines for simulations run with the the appropriate fixed size). Results for \({\cal K} = \rho + \sigma {\mathrm{/}}\xi\) are not shown for σ = −0.1 as \({\cal K} = 0\) in this case. Other parameter values: h = 0.25, α = 0 and γ = 0.5. Right: Time to fixation of an allele under selection as a function of its initial frequency, same parameters as the figure on the left but for σ = 0.1 and −0.01

Concerning the effect of the self-fertilization rate (which are summarized in Supplementary Fig. 4) we find that as expected from the Wright Fisher diffusion, probabilities of fixation of beneficial (respectively deleterious) alleles increase (respectively decrease) with the rate of self-fertilization α. We also find as previously predicted that the times to fixation decrease with increasing α. In all other aspects we find the same patterns as for the case without self-fertilization (α = 0).

Discussion

An interesting feature of our model is that it is individual-based, in the sense that the model is characterized by simple demographic parameters that define the behavior of individuals within the population. Using these demographic parameters we are able to model different life-history strategies and calculate an effective population mass Ne that allows us to predict the probabilities of fixation, as well as the times to absorption, using a Wright–Fisher diffusion and specify for which parameter sets this Ne is appropriate. We generally find that the proposed Ne does not fully capture the laws of times to fixation of populations with K strategy life-histories (low population turnover). This is mainly due to long-term fluctuations induced by their intrinsic demographic parameters that cannot be summarized and lead to the more rapid fixation of rare neutral alleles than expected. We also show that, contrary to expectations, despite a probability of fixation of a neutral allele being equal to its initial frequency, when examining each simulation run for a given parameter set separately, there is a higher frequency of fixation of rare neutral alleles for populations that maintain low harmonic mean masses. This result further highlights the importance of integrating demographic parameters into population genetics models.

Interpreting demographic parameters

In our model the term ρ defines the speed at which individuals reproduce (hence population growth) and ξ represents the competition for resources that in turn regulates population mass (due to increased mortality). Thus, for a given expected population mass \({\cal K} = \rho {\mathrm{/}}\xi\) a low ρ describes long-lived individuals with low death rates, whereas a high ρ describes short-lived individuals with high death rates (rapid turnover). When comparing the demographic fluctuations of two populations with different values of ρ, the short-term and long-term fluctuations observed for low ρ and very rapid short-term fluctuations for high ρ (Fig. 1) agree with the patterns observed for long- and short-lived species respectively (Figure 1.1 in Lande et al. 2003). For a same \({\cal K}\) we estimate a lower Ne for long-lived species simultaneously due to larger population fluctuations and to the differences in population turnover speeds (since for low \({\cal K}\) both high ρ and low ρ populations have similar fluctuations and yet we observe lower expected Ne), which implies that on the long run a population with a K life-history strategy (low ρ) would be expected to maintain lower diversity. This prediction is supported by the lower than expected times to fixation of both neutral alleles and those under selection, as well as higher fixation probabilities of deleterious alleles (see Fig. 7), which agrees with the observation of less efficient purifying selection in long-lived species with low reproductive rates compared to that of short-lived ones with high reproductive rates (Romiguier et al. 2014; Chen et al. 2017). Indeed, our results indicate that in a stable environment, the stochastic demographic fluctuations and the differences in the turnover speeds of species with differing r/K life strategies may suffice in explaining these observations. This could explain why Romiguier et al. (2014); Chen et al. (2017) found that past historical demographic disturbances were less explicative than life-history strategies concerning contemporary genetic diversity.

Defining selection and fitness

One of the difficulties brought on by individual-based models is how to define fitness so that it remains compatible with existing population genetics models. Indeed, several definitions of fitness do exist in literature (reviewed in Day and Otto 1; Orr 2009). Fitness is generally defined as a measure of the contribution of a given entity (allele, group of alleles, individual, …) to the next generation, but the notion of generation in an individual-based model is not obvious. A first way to define fitness is to focus on the Wrightian fitness (see Wu et al. 2013), which is defined as the mean number of progeny per individual. In the logistic birth-and-death model introduced here, the expected number of offspring for an individual with reproduction rate b, natural death rate d and competition death rate c in a population with (let us say fixed for simplicity) size N is equal to b/(d + cN). Obviously, when a population is at its demographic equilibrium N = (b − d)/c where births and deaths compensate, the fitness of each individual is equal to 1. In this framework the effect of a non-neutral allele or genotype (i.e. its coefficient of selection) can be defined as b′/(d′ + cN) − b/(d + cN) = 0 if b′/b = c′/c = d′/d (where b′, c′ and d′ respectively represent the new genotype’s birth competition and death rate). However, as shown by the results obtained for “quasi-neutral” selection in Parsons et al. (2010), where genotypes with the same Wrightian fitness but different values of b were considered, this definition is not sufficient in a continuous time-frame. Hence a second way to consider fitness is to focus on the Malthusian fitness, which is defined as the growth rate of the population size. With this definition, fitness for our logistic birth-and-death model can be defined by the quantity [b/(d + cN)] × (b + d + cN) = W × V where W is the Wrightian fitness and V measures the speed of reproduction and death of individuals. This second definition of fitness is more appropriate when studying differences in life-history strategies, as done in Parsons et al. (2010). For both of these definitions, fitness is a quantity that is not inherent to the individual but depends on one side on demographic parameters and on the other side on both the population size and, in a non neutral framework, its genetic composition. This releases the exponential growth hypothesis naturally emerging from a concept of constant individual absolute fitness (Orr and Unckless 2008).

In this present work, we have chosen to take into account only the Wrightian fitness so as to first explore the consequences of demographic stochasticity in a model with the same genetic properties as the Wright–Fisher diffusion. Our main conclusion is that, depending on the life-history strategy of a population, the Wright–Fisher diffusion is not always able to capture the trajectories of allelic frequencies. Future work on defining an expression for the coefficient of selection in which the speed of reproduction and death V is also included may provide a better bridge between individual-centered models and the more mathematically manipulable Wright–Fisher diffusion.

Implications for empirical works

Various methods have been developed to estimate the effective size of populations (see Sjödin et al. 2005 and references therein) with the aim of understanding their past and, in some cases, predicting their future evolution. However, contemporary genetic data can be greatly affected by historical events and so Ne is a parameter that is very population dependent (Wang 2005). Furthermore, from an experimental point of view, the intricacy of population dynamics and population genetics requires the definition of theoretical models whose parameters can be estimated using laboratory experiments for a better understanding of their respective behaviors (reviewed in Chapter 9 of Mueller 2009). Here we provide another definition for Ne that is a result of both the demographic parameters of a population and, in the case of selection, its genetic properties. We find, that contrary to previous works, the effects of demographic fluctuations cannot always be summarized using the mean harmonic population size (here represented as a mass) as proposed in Ewens (1967); Kimura (1970); Otto and Whitlock (1997). Using the harmonic mean size is valid only when population fluctuations are sufficiently fast compared to the coalescent times (Sjödin et al. 2005), hence for populations with a large growth rate ρ and high death rates due to competition (parameter ξ), which represent short-lived species with high reproductive rates. This remains true even for strong fluctuations in population mass when the carrying capacity \({\cal K}\) is low. However, for long lived species times to fixation cannot be summarized by Ne, this being in part due to near extinction events, often ignored in deterministic models (see Chapter 1 in Lande et al. 2003), that can contribute to lower times to fixation. Thus depending on life-history and population size, the Wright–Fisher diffusion is more or less appropriate in predicting population evolution. Though maintained genetic polymorphism is often used as a proxy for adaptive potential, one can also argue that the speed at which an advantageous allele goes to fixation is also important, especially in the face of environmental change (Glemin and Ronfort 2013). According to our model, long lived species will have a tendency to have lower probabilities of fixation of advantageous alleles, but this may be compensated by the speed at which this fixation occurs compared to that observed in short-lived species.

Previous works on integrating stochasticity into demographic models have done so by introducing a demographic variance, meant to reflect the differences between individuals in their survival and reproduction, into deterministic models (see for example Lande et al. 2003). However, as Lande et al. (2003) point out, empirical measures of demographic variance may be difficult to obtain, all the more so in the ubiquitous presence of environmental stochasticity. One of the properties of our proposed model is that inter-individual variance occurs naturally, depending on the death and birth rates, and very few parameters are required in order for this variance to be ensured. Indeed, statistical methods using time series have been developed so as to estimate parameters compatible with our model (Campillo and Gland 1989; Campillo et al. 2017). Because of the hypotheses we have made concerning birth, death and competition, our model represents a logistic population growth model with extinction. In such a setting, Campillo et al. (2017) have shown that death and birth rates can be estimated separately and so be used as parameters for our model and compare it to empirical data, either from natural or experimental populations. A natural next step would be to extend this model so as to consider multiple loci, either neutral or under selection, with possible mutation, so as to provide predictions in a more general genetic setting all the while incorporating intrinsic demographic behaviors which we may be of a great importance in shaping species diversity and evolvability.

Data archiving

Data available from the Dryad Digital Repository: https://doi.org/10.5061/dryad.rm2jn70