**Appendix S1**

** w** that specifies relative probabilities different individuals have of producing offspring. With parental weights specified this way, expectations of key demographic parameters are simple functions of

The Wright–Fisher (WF) model of reproduction is a lynchpin of evolutionary biology, as it describes how matings occur and how genes are transmitted across generations. This model also provides a direct link between the ecological consequences of abundance, which depend on census size (*N*), and the evolutionary consequences of abundance, which depend on effective population size (*N*_{e}). When population dynamics follow the standard WF model, the number of offspring per parent is approximately Poisson distributed (with variance ≈ mean), in which case the census and effective sizes are the same. Since the time of the Modern Synthesis (Huxley, 1942), theoretical population genetics has played a seminal role in shaping the development of evolutionary biology. Virtually every equation in population genetics includes a term for effective size, and it is routine to adopt the assumptions of the WF model to take advantage of this equivalence between *N* and *N*_{e}. Under WF assumptions (a single closed population with discrete generations, constant size, random mating and random variation in reproductive success), the loss of genetic diversity due to drift depends only on the number of reproductive individuals, so both demographic and evolutionary processes can be modelled with a single parameter for population size. A population that satisfies all of these assumptions is said to be ‘ideal’. These features make the WF model easy to simulate in a computer, and as a consequence it is incorporated into a wide variety of software for forward‐in‐time and coalescent simulations (NCI, 2018; Peng et al., 2015).

Despite its advantages and nearly universal appeal, the standard WF model has an important limitation: its many assumptions are compatible with essentially zero species in nature. Almost all real populations deviate from WF assumptions in ways that cause the effective size to be less than the number of adults, primarily because of skewed sex ratio and greater‐than‐Poisson variance in offspring number within sexes, and these deviations lead to a wide range of *N*_{e}/*N* ratios in nature (Frankham, 1995; Palstra & Fraser, 2012). From the evolutionary perspective, this might not be a problem, as a researcher who wants to model genetic processes in a real population with census and effective sizes of, say, *N* = 1,000 and *N*_{e} = 200, could just model a WF population with *N* = *N*_{e} = 200. However, populations with *N* = 200 and *N* = 1,000 generally are not equivalent for ecological processes such as competition, predation and individual behaviour, so exclusive reliance on WF assumptions constrains the ability of a model to adequately capture realistic eco‐evolutionary dynamics. In recent decades, it has become apparent that most problems in biology are not strictly ecological or evolutionary but rather are eco‐evolutionary in nature (Pelletier et al., 2009), and researchers have increasingly expressed the desire for more realistic models for population genetic simulations (Haller & Messer, 2019).

Because the WF model requires numerous simplifying assumptions, there are many ways to model non‐ideal populations (e.g. Chotibut & Nelson, 2017; Der et al., 2011; Eldon & Wakeley, 2006). A common approach to incorporate overdispersed variation in reproductive success is to draw offspring numbers from a negative binomial or gamma distribution, which can be scaled to produce a desired level of reproductive skew. This approach, however, is better suited to modelling population‐level processes than characteristics of individuals. Here I describe in detail an algorithm, * TheWeight*, which makes a simple change to the WF model that provides considerable added flexibility to simulate realistic, individual‐based demographics. In the standard WF model, every individual has an equal chance to produce each offspring; in

Most real populations are age structured, so the discrete‐generation assumption is an important limitation. Here I illustrate how * TheWeight* algorithm can be used to model eco‐evolutionary processes in iteroparous species with overlapping generations. The treatment here focuses on the large fraction of species that exhibit strongly seasonal, birth‐pulse reproduction (Caswell, 2001). For these species, reproductive success is commonly assessed from two different perspectives: seasonal (in which offspring number is the total produced by an individual across a reproductive season—here assumed to be years) and lifetime (in which lifetime reproductive success [

Worked examples illustrate how * TheWeight* can be used to model (a) changes in fecundity with age; (b) variation in expected reproductive success among individuals of the same age and sex; and (c) positive or negative correlations in individual reproductive success over time. This latter feature is useful for modelling common biological features such as intermittent breeding and persistent individual differences (aka ‘individual quality’; Wilson & Nussey, 2010). Using

The standard Wright–Fisher model has the following features: population size is constant; generations are discrete; selection is absent; mating is random; and every individual is equally likely to be the parent of a given offspring, regardless how many or few offspring that individual has already produced. Conceptually, reproduction occurs as follows: each individual contributes an equal and very large number of gametes to a huge (essentially infinite) pool of gametes, which unite at random to produce zygotes. Random survival of zygotes then produces the few individuals that form the next generation (Wright, 1931). A population meeting all of these criteria is said to be ‘ideal’ and has the property that the effective population size (*N*_{e}) equals (on average) the adult census size (*N*).

This latter feature can be illustrated using standard definitions of inbreeding *N*_{e} based on the mean ($$$ {\mu}_k $$$) and variance ($$$ {\sigma}_k^2 $$$) among parents in number of offspring (*k*) (Crow & Denniston, 1988):*ϕ* = $$$ {\sigma}_k^2 $$$/$$$ {\mu}_k $$$ is the ratio of variance to mean offspring number. Focus is on inbreeding *N*_{e} because it relates to the number of parents and hence is more relevant than variance *N*_{e} to the topics considered here. Furthermore, inbreeding *N*_{e} is much less sensitive to effects of sampling and hence is more flexible than variance *N*_{e}, especially for applications involving age‐structured populations (Waples, 2002, 2020). Equation 1 applies to monoecious/hermaphroditic diploids with random selfing; slight variations are available for other mating systems. Implementing the WF model leads to multinomial sampling of parents, so $$$ E\left({\sigma}_k^2\right)\approx {\mu}_k $$$. Inserting $$$ \upphi =1 $$$ into Equation 1 yields the result that *N*_{e} ≈ ($$$ {\mu}_kN‐1 $$$)/$$$ {\mu}_k $$$ ≈ *N*. [The result is exact if one uses the exact (binomial) variance $$$ E\left({\sigma}_k^2\right)={\mu}_k\left(N‐1\right)/N $$$ rather than the Poisson approximation; see Supporting Information.]

The WF model is easy to implement in a computer, the only required input parameters being the number of ideal individuals (*N*) and, if genotypes are modelled, the number of gene loci being tracked. Then, only three more steps are required to complete one generation of reproduction (Figure 1a). In Step 2, each offspring ‘chooses’ its parents randomly and with replacement from the *N* potential parents. In Step 3, at each gene locus, one of the two alleles from each parent is randomly chosen to pass on to the offspring. Step 4 completes the cycle, as offspring become potential parents of the next generation.

Conceptually, the generalized WF model differs in one important way from the standard version: the parents are allowed to make unequal contributions to the initial gene pool, with the contributions being proportional to the weight (*w*_{i}) for each parent. The first use of a weighted WF model like this was by Robertson (1961) for the special case of full‐sibling families, and the model was further developed by Waples (2020). Let $$$ {\upmu}_w $$$ and $$$ {\sigma}_w^2 $$$ be the mean and variance, respectively, of the vector of parental weights, and let *CV*_{w} = $$$ {\sigma}_w/{\upmu}_w $$$ be the coefficient of variation of ** w**. [$$$ {CV}_w $$$ is the same when calculated using the raw parental weights

In computer modelling, the only difference between the traditional and generalized WF models occurs at Step 2: instead of choosing adults with equal probability to be parents of a given offspring, the probability a parent will be chosen is proportional to its weight (Figure 1b). To deal effectively with age structure, it is also important to allow the overall number of offspring to vary from the constraint in the WF model that $$$ {\mu}_k $$$ = 2. Modelling separate sexes requires separate routines for choosing male and female parents, together with separate vectors of parental weights. Effective size can then be calculated separately for males and females (*N*_{em}, *N*_{ef}), and overall *N*_{e} can be obtained using Wright's (1938) sex ratio adjustment: *N*_{e} = 4*N*_{em}*N*_{ef}/(*N*_{em} + *N*_{ef}).

For seasonal reproduction in a discrete‐time, birth‐pulse model, age structure can be modelled using age‐specific vital rates from a life table: *s*_{x} = probability of surviving from age *x* to *x* + 1, *b*_{x} = mean number of offspring produced by an individual of age *x* and *N*_{x} = number of individuals in age class *x*. In an age‐structured model based on * TheWeight*, a simple option is to assign parental weights based on the

Assuming that *ϕ*_{x} = 1 for each age and sex might be reasonable for some populations, but that is not universally the case. Empirical data for age‐specific *ϕ*_{x} are seldom published, but (e.g.) for black bears in Michigan, USA, *ϕ*_{x} was significantly >1 for both females and males and estimated to be 10 or higher for males aged 6–10 years (Waples et al., 2018). A more comprehensive life table would then include another age‐specific vector of vital rates: *ϕ*_{x}.

To model the desired level of overdispersion at each age (indicated by *ϕ*_{x}), the following steps can be used to generate *N*_{x} parental weights. This process can be done separately for male and female parents of each offspring.

Step 1. Determine the target value for the squared CV of parental weights. By rearranging Equation 3,

Step 2. For any given $$$ {TargetCV}_{w,x}^2 $$$, it is possible to identify a Poisson distribution with mean = variance = *λ*_{x} that will produce a vector of parental weights such that $$$ E\left[{CV}_{w,x}^2\right] $$$ = $$$ \operatorname{var}\left({w}_x\right)/{\left[\mathrm{mean}\left({w}_x\right)\right]}^2 $$$ = *λ*_{x}/(*λ*_{x})^{2} = 1/*λ*_{x}. The required mean of the Poisson distribution is thus *λ*_{x} = 1/$$$ {TargetCV}_{w,x}^2 $$$.

Step 3. Simulating *N*_{x} random Poisson values using parameter *λ*_{x} will thus, on average, produce a vector of parental weights with the desired $$$ {CV}_{w,x}^2 $$$. This process can be iterated until the realized $$$ {CV}_{w,x}^2 $$$ is within a specified tolerance of the target (most results presented here used tolerance = 1%).

With the parental weights specified for each age, seasonal reproduction in the generalized WF model can proceed using either a two‐step or one‐step process.

Step 4A. In the two‐step process, for each offspring, one first determines the age of the parent(s). This can be done randomly (e.g. by sampling the parent's age from the ages of the adult life span, with relative probabilities being the product *N*_{x}*b*_{x}). Next, the actual parent can be chosen randomly using the appropriate age‐specific vector of parental weights generated in Step 3.

Step 4B. In the single‐step process, adults of all ages (and their weights) are combined into a single matrix, and the parent(s) for each offspring are chosen based on the combined vector of parental weights. This requires that the mean weight for each age $$$ \left({\overline{w}}_x\right) $$$ be proportional to the age‐specific mean fecundity (*b*_{x}). If *b*_{x} is constant, the weighting scheme described above already accomplishes this. More generally, if *b*_{x} varies with age, then for each age every parental weight has to be rescaled by multiplying by the factor *F* = *b*_{x}/*λ*_{x}. After rescaling, $$$ E\left({\overline{w}}_x\right) $$$ = *b*_{x} for each age; although both the mean and variance of the weights have changed, the squared *CV* remains the same.

Stabilizing selection is commonly modelled using a Gaussian fitness function applied to a continuous phenotypic trait *z*, such as body size (Lande, 1976). A general way to implement this using * TheWeight* is as follows:

Step 1: Define the phenotypic distribution, *p*(*z*). *z* is commonly assumed to have a normal distribution with mean = $$$ {\upmu}_Z $$$ and variance = $$$ {\sigma}_Z^2 $$$. In that case,

Step 2: Map the phenotypes to the fitness function to produce the distribution of relative individual fitness *p*(*w*), which is identical to the distribution of parental weights. Under stabilizing selection, the maximum fitness (*w*_{max}) occurs at an intermediate phenotype, denoted by *θ*, such that individual fitness values (*w*_{i}) are a function of the squared distance between the individual's phenotype and *θ*:_{w} is the ‘width’ of the fitness surface.

Steps 1 and 2 are commonly used to model selection. The advantage of using * TheWeight* is that the expected consequences of selection for key demographic and population genetic parameters can be quantified.

Equation 3 above shows that the expected value of the variance to mean ratio for offspring number (*E*($$$ {\sigma}_k^2 $$$)$$$ /{{\mu }_{k}}\left)\right. $$$ is a simple function of the squared *CV* of parental weights. A related quantity defined by Crow (1958) is *I* = $$$ {\sigma}_k^2/{\left({\mu}_k\right)}^2=\upphi /{\mu}_k $$$. Commonly referred to as the Opportunity for Selection, *I* is the variance in relative fitness, which places an upper limit on the evolutionary response to selection (Walsh & Lynch, 2018). Dividing each side of Equation 3 by the mean offspring number produces this result:*CV*.

Generic weighting schemes that assign weights randomly to individuals are easy to implement. One way to do this is to randomly assign potential parents ordered cardinal numbers *i* = 1, 2, … *N* and then give each a relative weight that is a function of their assigned number. Simple examples include power functions (*w*_{i} = *i*^{x} = 1^{x}, 2^{x}, … *N*^{x}) and harmonic functions (*w*_{i} = 1/*i*^{x} = 1/1^{x}, 1/2^{x}, … 1/*N*^{x}). Equations 2–5 can be used to predict the consequences of these weighting schemes for parameters of interest.

Analysis of *LRS* focuses on a birth cohort of individuals that are enumerated at a specified age (here assumed to be age at maturity). * TheWeight* has three general options for modelling lifetime reproductive success. The simplest approach is to generate new weights for each age to match the species' vital rates (as described in Section ‘Age‐specific vital rates’) and then assign those randomly to the survivors each year. This approach is suitable if it is reasonable to assume that an individual's reproductive success is uncorrelated over time (as assumed by Felsenstein, 1971; Hill, 1972; Waples et al., 2011).

In many species, females (and sometimes males) do not necessarily breed every year, leading to a strategy that has been called ‘skip breeding’ (Goutte et al., 2011) or ‘intermittent breeding’ (Shaw & Levin, 2011). This type of life history can be found in vertebrate ectotherms, mammals, birds and some invertebrates; it can lead to positive or negative correlations in the number of offspring an individual produces over time, depending on the time lag and pattern of skip breeding. This life history can be described by a vector *θ*, the *t*^{th} element of which (*θ*_{t}) is the probability that an individual will reproduce in the current year, given that it last reproduced *t* years before (Shaw & Levin, 2011). For example, Waples and Antao (2014) estimated that *θ*_{t} = [0.025, 0.443, 0.634, 0.743, 1] for female loggerhead turtles, reflecting substantial costs of migration and reproduction. In contrast, for female black bears in Michigan *θ*_{t} = [0.035, 0.94, 1] (Waples et al., 2018), indicating a faster recovery of reproductive potential. This life history can easily be modelled with * TheWeight*.

Step 1: For each individual, determine the value of t = the number of years since the individual last reproduced.

Step 2: With probability θ_{t}, replace that individual's weight for the current year with 0.

Persistent individual differences in reproductive success occur when some individuals are consistently above or below average (for their age and sex) at producing offspring. In iteroparous species, persistent individual differences increase lifetime variance in offspring number and reduce *N*_{e} (Lee et al., 2011, 2020). Variation in size at age can easily lead to this type of pattern: an individual that is larger (and hence more fecund) than others in its cohort at age *x* is also likely to have above‐average size and fecundity at older ages. Persistent differences could have a genetic basis or might simply reflect early‐life‐history environmental ‘silver spoon’ effects with long‐term consequences.

This life‐history feature can be modelled in * TheWeight* by introducing positive correlations between parental weights over time, which can be accomplished by retaining individual weights across lifetimes. However, because the target value of desired $$$ {CV}_{w,x}^2 $$$ is contingent on

Step 1. Using the approach outlined in the previous section, generate a vector of parental weights *w*_{1} for the *N*_{1} age‐1 individuals in a cohort, for which expected fecundity is *b*_{1} and $$$ {TargetCV}_{w,1}^2 $$$ = ($$$ {\phi}_1 $$$−1)/$$$ {b}_1 $$$. The Poisson parameter to produce the desired parental weights at age 1 is *λ*_{1} = $$$ 1/{TargetCV}_{w,1}^2 $$$. If age‐1 individuals are not mature, start this process with the age at sexual maturity.

Step 2. Now we need a vector of weights *w*_{2} that retain the same framework of individual differences but produce $$$ {TargetCV}_{w,2}^2 $$$ at age 2 = ($$$ {\phi}_2 $$$ − 1)/$$$ {b}_2 $$$. This can be achieved by adding a constant *C*_{2} to each individual weight generated at age 1. This has no effect on the variance of the weights but changes the mean, so it also changes the squared *CV*.

Step 3. Define the factor *Q*_{2} = $$$ {TargetCV}_{w,2}^2 $$$/$$$ {TargetCV}_{w,1}^2 $$$. Then, $$$ {TargetCV}_{w,2}^2 $$$ = $$$ {\sigma}_{w,2}^2 $$$/$$$ {\left({\overline{w}}_2\right)}^2 $$$ = *Q*_{2} × $$$ {\sigma}_{w,1}^2 $$$/$$$ {\left({\overline{w}}_1\right)}^2 $$$. Now $$$ {\sigma}_w^2 $$$ is the same at ages 1 and 2, so this last equation implies that $$$ 1 $$$/$$$ {\left({\overline{w}}_2\right)}^2 $$$ = *Q*_{2}/$$$ {\left({\overline{w}}_1\right)}^2 $$$ and hence $$$ {\overline{w}}_2={\overline{w}}_1/\sqrt{Q_2} $$$.

Step 4. If the increase in the mean weight is accomplished by adding a constant, it is also true that $$$ {\overline{w}}_2 $$$ = $$$ {\overline{w}}_1 $$$ + *C*_{2}. Solving these two equation yields the desired result:

Step 5. Repeat this process for each additional year of the maximum adult lifespan (*AL* years). The result is a *N*_{1} × *AL* matrix of parental weights. Each year, weights for the survivors in a cohort are taken from the appropriate column of the matrix.

Adding a constant to all individual weights changes their relative values. However, it maintains the same rank order of weights, and the pairwise correlations of the age‐specific vectors of individual weights are all *r* = 1.0. Weaker positive correlations could be introduced by adding a random error term to the individual weights each year without shuffling them.

To illustrate calculations described above and evaluate their accuracy, seasonal and lifetime reproductive success was simulated using * TheWeight* algorithm. In addition, one scenario simulated multilocus genotypes and tracked loss of heterozygosity over time. Simulations were conducted in R (R Core Team, 2021) using code available on Zenodo.

Table 1 illustrates how to compute the vectors of parental weights when modelling seasonal reproduction according to age‐specific vital rates from an expanded life table, which also includes age‐specific values for *ϕ* for a single sex, nominally male. The hypothetical species is first enumerated at age 1, matures at age 3, and has a maximum life span of 10 years. With annual survival = 0.7 and a fixed cohort size of 1,000 age‐1 males, expected numbers of males alive at subsequent age are given by the vector *N*_{x}. Expected fecundity (*b*_{x}) is proportional to age and is scaled to production of a stable population (which produces 2,000 yearling offspring per year, 1,000 of each sex). In this example, the overdispersion index *ϕ* was also chosen to increase with age, but more slowly than fecundity. For each age, Table 1 shows how to calculate the $$$ {TargetCV}_{w,x}^2 $$$ that will produce the desired level of overdispersion, and the respective Poisson parameter that can be used to simulate random weights with the desired properties. When using the two‐step process to simulate reproduction (Step 4A in Section ‘Age‐specific vital rates’), the age(s) of the parent(s) of each offspring are first chosen, and then the actual parent is chosen from that age group, with sampling probabilities determined by the parental weights. With this two‐step approach, the initial Poisson parameters (*λ*_{x}) can be used for each age. In this example, however, reproduction is modelled in a single step (as in Step 4B in Section ‘Age‐specific vital rates’), and the weights for each age have to be rescaled so that age‐specific $$$ {\overline{w}}_x $$$ = *b*_{x}. This is accomplished by multiplying the initial *λ*_{x} by an age‐specific scaling factor. Across 1,000 replicate simulated populations, mean realized $$$ {\phi}_x $$$ for each age closely agreed with the parametric expectations (Table 1).

*Note*: Total *N*: 3,239. Adult *N*: 1,539.

Most life tables do not contain data for the age‐specific parameter *ϕ*_{x}, so it is common to assume that all *ϕ*_{x} = 1. The consequences of violation of this assumption can easily be modelled using * TheWeight* by replacing empirical

These examples used data for the entire population. Subsampling offspring is easy to accomplish using * TheWeight*, as illustrated in the R code provided.

In modelling seasonal reproduction using the vital rates shown in Table 1, given that across all adults *μ*_{k} = 1.30 and mean $$$ {\sigma}_k^2 $$$ was 5.00 (Table S1), the overall annual Opportunity for Selection was $$$ I=\frac{\sigma_k^2}{{\left({\mu}_k\right)}^2}=2.96 $$$. Interpretation of raw values of *I* is complicated by its dependence on mean offspring number, which can reflect experimental design and sampling effort more than underlying biology (Downhower et al., 1987; Fairbairn & Wilby, 2001). A simple way to resolve this problem is to subtract the expected contribution from random demographic stochasticity ($$$ 1/{\mu}_k $$$), which produces an adjusted Opportunity for Selection that is independent of mean fitness (Waples, 2020):

For the vital rates shown in Table 1, mean *I* = 2.96 so $$$ {\Delta }_I $$$ = 2.96–1/1.30 = 2.19, which was also the mean value of the actual $$$ {CV}_w^2 $$$ in the simulations (Table S1). Because $$$ {\Delta }_I $$$ does not depend on mean offspring number, it can be directly compared to similar values obtained in other studies. Knowing $$$ {CV}_W^2 $$$ also allows one to predict the expected reduction in the annual *N*_{b}/*N* ratio that can be attributed to natural selection. For this example, based on Equation 5, *E*(*N*_{b}/*N*) = 1/(1+$$$ {CV}_W^2 $$$) = 1/(1 + 2.19) = 0.313, indicating that unequal expectations for reproductive success attributed to selection would be expected to drop the effective number of breeders to less than one‐third of the number of adults. In contrast, if all *ϕ*_{x} were assumed to be 1 (as in Table S1), $$$ {CV}_w^2 $$$ would shrink dramatically (to 0.15), with the remaining variation in parental weights being reduced to only the among‐age effect (variation in *b*_{x} with age). Under that scenario, the expected value of *N*_{b}/*N* would be 1/(1.15) = 0.87, for a much more modest reduction of 13%.

It should be noted that although in some cases parental weights can be equated directly to selection coefficients (as described in Section ‘Natural selection’), individuals can have unequal expectations of reproductive success for a variety of reasons that are more related to luck than to pluck (Snyder & Ellner, 2018) or individual quality (Wilson & Nussey, 2010). As shown in Equation 7, variation in parental weights is more directly related to the concept of the Opportunity for Selection, which might not be a reliable indication of the actual strength of selection (Downhower et al., 1987; Fairbairn & Wilby, 2001; Jennions et al., 2012).

The consequences for the *N*_{e}/*N* ratio of applying some simple rules for specifying parental weights are shown in Figure 2. In the first three scenarios, the weights were power functions that produced increasing amounts of reproductive skew: *w*_{i} = *i*^{1}, *i*^{2} and *i*^{3}. The next three scenarios used the analogous harmonic series: *w*_{i} = 1/*i*^{1}, 1/*i*^{2} and 1/*i*^{3}; and the final scenario used an exponential series: *w*_{i} = *e*^{i}. It is apparent from Figure 2 that the power functions produce *N*_{e}/*N* ratios that are largely insensitive to *N*, whereas for the other series log(*N*_{e}/*N*) declines approximately linearly with log(*N*). The number of possible weighting schemes is effectively unlimited, but these simple examples show that it is easy for users to pick a weighting scheme that will produce essentially any desired *N*_{e}/*N* ratio or any desired Opportunity for Selection.

Table 2 uses the vital rates in Table 1 to illustrate how to generate parental weights that produce persistent individual differences in reproductive success over time. Since ages 1 and 2 are juveniles (and hence have zero weights), this table begins with age at maturity = 3 years. First, the $$$ {TargetCV}_{w,x}^2 $$$ expected to produce weights with the desired level of overdispersion at each age is computed as (*ϕ*_{x} − 1)/*b*_{x}, and the Poisson parameter to generate weights for age‐3 adults is then *λ*_{3} = 1/$$$ {TargetCV}_{w,3}^2 $$$—all as in Table 1. Next, age‐specific constants are calculated as *C*_{x} = $$$ {\uplambda}_3\left(1/\sqrt{Q_x}‐1\right) $$$, where *Q*_{x} = $$$ {TargetCV}_{w,x}^2 $$$/$$$ {TargetCV}_{w,3}^2 $$$, and adjusted parental weights for subsequent ages are calculated as $$$ Adj\left({\overline{w}}_x\right) $$$ = *λ*_{3} + *C*_{x}. Results of the simulations show that although these adjustments changed both the means and variances of the age‐specific parental weights, they did not change $$$ {CV}_{w,x}^2 $$$, and the actual mean *ϕ*_{x} values were very close to the parametric expectations for each age (Table 2), just as they were for the example in Table 1. The adjusted weights, however, maintain the relative weights for each individual over time.

Target

$$$ {CV}_{w,x}^2 $$$

Observed

*ϕ*_{x}

Once the matrix of lifetime parental weights is established, it requires only a single line of code to switch between modelling reproductive success that is independent and perfectly correlated over time: for independence, the parental weights are randomly scrambled every year, and to model persistent individual differences they are not. This can make a large difference in terms of reproductive skew: with parental weights randomized each year, the median variance in *LRS* across 1,000 simulations for the 490 males in each cohort that reached age 3 was 30.7; with parental weights retained across lifetimes, median $$$ {\sigma}_{k\bullet}^2 $$$ more than doubled, to 76.1. Persistent individual differences also greatly skewed the distribution of *LRS* compared to a null model of independence (Figure 3). In simulations for which parental weights were retained, almost half of the males that reached age at maturity never produced any offspring, while some others produced 100 or more. When weights were shuffled each year, maximum *LRS* was <60 and null parents comprised a bit over a third of each cohort.

The examples in Tables 1 and 2 calculated means and variances of offspring number only for adults. If juveniles (all of which produce 0 offspring) had also been included, the overall means would have been lower and the variance‐to‐mean ratios would have been higher. Hence, to avoid confusion resulting from apples‐and‐oranges comparisons, it is important to clarify the groups of individuals that are included in the analysis of reproductive success.

Because the novel features of * TheWeight* algorithm all involve population demography (specifically, how parents are chosen), the previous examples have all focused on that aspect of computer simulations. Nevertheless, most users are interested in (and the richest insights are gained from) joint modelling of demography and genetics, so code is also provided to illustrate one scenario that uses

Age structure is one of the most common ways that real populations depart from Wright–Fisher assumptions. * TheWeight* algorithm can be used to precisely control the distribution of reproductive success in age‐structured populations by following a few simple rules.

The Wright–Fisher model has two distinctive features: equiprobability and independence. Under WF, every individual is equally likely to be the parent of any given offspring, so offspring can be thought of as assigned to parents randomly and with equiprobability. Furthermore, each assignment is independent, in the sense that the outcome does not depend on results of any previous assignments. In R (for example), the WF process can be modelled using the ‘sample’ function, with *size* = the number of offspring and sampling done from a vector of parental names or IDs. Under the defaults, sampling is equiprobable and done with replacement and hence independent.

In the generalized WF model (Waples, 2020), the assignments are still independent (within time steps at least) but parental assignment probabilities are allowed to vary according to the vector of parental weights, ** w**. This only requires adding a ‘prob = w’ argument to the ‘sample’ function. Unequal parental weights lead to overdispersed variance in offspring number compared to the Poisson expectation.

Another common approach to modelling overdispersed variance is to randomly assign numbers of offspring to parents based on a negative binomial or gamma distribution that can be parameterized to generate a target $$$ {\mu}_k $$$ and $$$ {\sigma}_k^2 $$$ (e.g. Anderson & Dunham, 2005). This approach is fast and simple but has some limitations compared to * TheWeight*. First, when offspring numbers are chosen randomly from a distribution, it is not easy (as it is in

The standard WF model assumes a very large gamete pool equally produced by *N* parents and random survival of zygotes until the next generation of *N* offspring is produced, leading to $$$ {\mu}_k $$$ = 2. The generalized WF model also assumes random survival of zygotes but allows for unequal parental contributions to the initial gene pool and allows mean offspring number to vary; this latter feature is important for modelling seasonal reproduction in iteroparous species. As a consequence, * TheWeight* algorithm is well suited for modelling fertility selection but does not explicitly model viability selection. However, the latter can also easily be incorporated by inserting an episode of selective mortality that relates probability of survival to a trait of interest.

Null models are increasingly important in evolutionary biology, including for the analysis of reproductive success (Tuljapurkar et al., 2020; van Daalen & Caswell, 2017; Waples & Reed, 2022). A variety of null models are easy to implement using *TheWeight*.*ϕ* = 1. For *LRS*, randomly scrambling parental weights each year replicates a null model of independence of reproductive success over time. Comparison with results for this null model can dramatically illustrate the consequences of a lack of independence (see Figure 3).

I thank Eric Anderson, Tom Reed, Ryan Waples and two anonymous reviewers for useful comments and suggestions. Ryan K. Waples implemented the model in SLiM for the scenario depicted in Figure 4.

The author declares no conflict of interest.

The peer review history for this article is available at

This study did not generate any new empirical data, except by simulation. Code to conduct the simulations and analyses described here is available at