## Abstract

Populations can adapt over short, ecological timescales via standing genetic variation. Genomic data collected over tens of generations in both natural and lab populations is increasingly used to find selected loci underpinning such rapid adaptation. Although selection on large effect loci may be detectable in such data, often the fitness differences between individuals have a polygenic architecture, such that selection at any one locus leads to allele frequency changes that are too subtle to distinguish from genetic drift. However, one promising signal comes from the fact that selection on polygenic traits leads to heritable fitness backgrounds that neutral alleles can become stochastically associated with. These associations perturb neutral allele frequency trajectories, creating autocovariance across generations that can be directly measured from temporal genomic data. We develop theory that predicts the magnitude of these temporal autocovariances, showing that it is determined by the level of additive genetic variation, recombination, and linkage disequilibria in a region. Furthermore, by using analytic expressions for the temporal variances and autocovariances in allele frequency, we demonstrate one can estimate the additive genetic variation for fitness and the drift-effective population size from temporal genomic data. Finally, we also show how the proportion of total variation in allele frequency change due to linked selection can be estimated from temporal data. Temporal genomic data offers strong opportunities to identify the role linked selection has on genome-wide diversity over short timescales, and can help bridge population genetic and quantitative genetic studies of adaptation.

Adaptation can occur over remarkably short, ecological timescales, with dramatic changes in phenotype occurring over just a few generations in natural populations. This rapid pace of adaptive change has been known to be mirrored at the genetic level since the early work of Fisher and Ford (1947) testing whether the rapid decline in a coloration polymorphism was consistent with natural selection or genetic drift. Since then, researchers have continued to use temporal data to detect selection on polymorphisms over short timescales in natural populations (Dobzhansky 1943, 1971; Fisher and Ford 1947; Kettlewell 1958, 1961; Mueller et al. 1985b), as well as quantify the rate of genetic drift (Mueller et al. 1985a; Nei and Tajima 1981; Pollak 1983; Wang and Whitlock 2003; Waples 1989). However, this line of work in sexual populations has been partially eclipsed by a vast body of work examining large-scale population-genetic and -genomic data sets from a single contemporary timepoint. More recently, studies have applied similar temporal approaches to whole-genome data to discover selected loci in contemporaneous natural populations (Bergland et al. 2014; Rajpurohit et al. 2018), evolve and re-sequence studies (Burke et al. 2010; Franssen et al. 2017; Johansson et al. 2010; Orozco-terWengel et al. 2012; Teotónio et al. 2009; Turner and Miller 2012; Turner et al. 2011), and ancient DNA (Fu et al. 2016; Mathieson et al. 2015). These approaches have identified a number of compelling examples where selection has driven extreme allele frequency change at particular loci that is inconsistent with drift alone. However, most adaptation on ecological timescales likely involves selection on phenotypes with polygenic architecture and abundant standing variation (Endler 1986; Hendry and Kinnison 1999; Kinnison and Hendry 2001; Kopp and Hermisson 2009b). We know from theory that adaptation on such traits can result from very subtle allele frequency changes across the many loci that underlie the trait (Bulmer 1980), at least for the short-term evolutionary response (Chevin and Hospital 2008; Hermisson and Pennings 2005; Jain and Stephan 2015, 2017; Thornton 2018). These changes may be individually indistinguishable from genetic drift in temporal data. This poses a challenge for population genetic approaches to quantify selection: rapid phenotypic adaptations occurring on ecological timescales may leave a signal on genome-wide patterns of diversity that is undetectable by methods focused on individual loci.

Here, we explore an alternative: rather than aiming to find selected loci, we can use temporal data to quantify the genome-wide effects of linked selection during polygenic adaptation. Linked selection introduces a new source of stochasticity into evolution, as a neutral allele’s frequency change depends on the fitness of the set of random genetic backgrounds it finds itself on (Gillespie 2000). The impact linked selection has on neutral loci is mediated by their associations (linkage disequilibria, or LD) with selected loci and hence their recombination environment; neutral loci tightly linked to selected sites experience greater reductions in diversity than more loosely coupled sites. Studies using a single timepoint have long exploited this idea, with some of the first evidence of pervasive natural selection being the correlation between diversity and recombination in *Drosophila* (Aguade et al. 1989; Begun and Aquadro 1992). Various forms of linked selection give rise to such patterns with much attention focusing on the hitchhiking (positive selection; Maynard Smith and Haigh 1974), or background selection models (negative, or purifying selection; Charlesworth et al. 1993; Hudson and Kaplan 1995). Recent genomic studies have modeled patterns of genome-wide diversity considering substitutions, functional constraint, and recombination environments to estimate parameters of hitchhiking and background selection models, and have begun to differentiate between these models (Elyashiv et al. 2016; Hernandez et al. 2011; McVicker et al. 2009). Acrosstaxa comparisons have shown that signals of linked selection are present in many sexual organisms, and that in some species a proportion of the stochastic change in allele frequencies is due to the randomness of linked selection instead of genetic drift (Coop 2016; Corbett-Detig et al. 2015; Cutter and Payseur 2013). Likewise, in asexual and facultatively sexual organisms both theory and empirical work show that linked selection and interference are a primary determinant of the levels of genetic diversity (Good et al. 2017, 2014; Neher and Shraiman 2011; Neher 2013).

In this paper, we extend this well-established approach of quantifying genome-wide selection through its indirect impact on linked neutral sites to temporal genomic data. We show that during rapid polygenic selection, linked selection leaves a signal in temporal genomic data that can readily be differentiated from neutral processes. Specifically, selected alleles perturb the allele frequency trajectories of neighboring linked neutral loci, increasing the variance of neutral allele frequency change and creating covariance between the neutral allele frequency changes across generations. Earlier work has modeled this effect on neutral alleles as a long-term reduction in the effective population size (J A Woolliams, N R Wray, R Thompson 2008; Robertson 1961; Santiago and Caballero 1995, 1998; Wray and Thompson 1990), but the increasing availability of genome-wide frequency data across multiple timepoints allows us to directly quantify the extent of linked selection over short ecological timescales (tens of generations). We develop theory for the variances and covariances of neutral allele frequency change under selection, and show that analogous to diversity in a single timepoint study, their magnitude depends on the local fitness variation, recombination, and linkage disequilibria environment. Furthermore, we show our theory can (1) directly partition the variation in genome-wide frequency change into the components caused by drift and selection, (2) estimate the level of additive genetic variation for fitness and how it changes over time, and (3) detect patterns of fluctuating selection from temporal data. Overall, we believe our approach to modeling temporal genomic data will provide a more complete picture of how selection shapes allele frequency changes over ecological timescales in natural populations, potentially allowing us to understand short-term effects of linked selection that would otherwise not be perceptible from studies using a single timepoint.

## 1 Outline of Temporal Autocovariance Theory

We first give an outline of how selection affects linked neutral sites through time. We summarize a neutral allele’s frequency trajectory as the differences in adjacent timepoints, Δ*p*_{t} = *p*_{t+1} *p*_{t}, where *p*_{t} is the population frequency at time t, and we assume a closed population with discrete, non-overlapping generations. Throughout, we assume that allele frequency changes can be measured every generation. Measurement in every generation may not be feasible for all study systems; however, the same approach can be extended to observations from non-consecutive generations. Our goal is to model linked selection’s effects on the variances and across-generation covariances of these allele frequency changes at neutral polymorphisms. Here, we think about linked selection in a quantitative genetics framework, where a large number of polymorphisms contribute to fitness variation. Therefore, we think about the response to selection as being the result of heritable variation for fitness in the population, i.e. additive genetic variance for offspring number; we will use this terminology throughout. When a population lacks heritable variation for fitness, a neutral allele’s frequency in the next generation is determined entirely by genetic drift: the random number of offspring each parent produces and the stochasticity of Mendelian segregation in heterozygotes. Changes in a neutral allele’s frequency due to drift are directionless, such that when averaged over evolutionary replicates the expected change in allele frequency is 𝔼(Δ*p*_{t}) = 0. Assuming a Wright– Fisher model of reproduction where each of the N individuals in the population has a multinomial number of offspring, the variance of allele frequency change is: Var(Δ*p*_{t}) = ^{pt(1−pt)}/(2*N*). Higher non-heritable variation in offspring number increases the rate of drift (Wright 1938), and this and a wide-range of different mating systems can be accommodated under the Wright–Fisher model by replacing N with N_{e}, the variance effective population size (Charlesworth 2009; Crow and Kimura 1970).

When individuals in the population have heritable differences in fitness, this increases the variance in neutral allele frequency change (Var(Δ*p*_{t})). There is still no net direction to this change (𝔼(Δ*p*_{t}) = 0) because the set of highor low-fitness genetic backgrounds a neutral allele resides on is random, but the higher variance leads the neutral allele to experience a faster rate of *apparent* ‘drift’. This has traditionally been thought of as a reduction in the long-run effective population size, as fitness-determining alleles persist on their backgrounds until disassociated by segregation and recombination (Robertson 1961; Santiago and Caballero 1995, 1998), but this heuristic ignores the profound ways in which heritable fitness variation affects neutral allele frequency change over shorter timescales. Specifically, heritable variation in fitness increases the variance in neutral allele frequency change in two ways. First, any additional variation in offspring number beyond that expected by the Wright–Fisher multinomial model increases the variance of allele frequency changes beyond the level expected under neutral drift. To understand how this and other factors contribute to the change in a neutral allele’s frequency, we can partition this change into three uncorrelated components (following Santiago and Caballero, 1995, see our Appendix Section A.1 for proof),
where, Δ_{N} p_{t}, Δ_{M} p_{t}, and Δ *p*_{t} are the neutral allele’s frequency changes due to non-heritable variation in fitness, Mendelian sampling of heterozygotes into offspring, and heritable variation in fitness (we refer to this as the *heritable change* in neutral allele frequency), respectively. Since each component is uncorrelated with the others, the variance in allele frequency change is

The terms Var(Δ_{N} p_{t}) and Var(Δ_{M} p_{t}) capture the variance due to the random reproduction process, and the former can accommodate extra non-heritable variance in offspring number (as long as individuals are exchangeable with respect to their genotype; Cannings 1974), while the term Var(Δ_{H} p_{t}) captures heritable fitness variation, due to systematic differences in the fitness of individuals caused by their genotypes.

Second, heritable fitness variation creates *temporal autocovariance* in allele frequency change across generations. We can see the contribution of covariance by writing the total cumulative allele frequency change as the sum of allele frequency changes each generation,

These covariance terms are expected to be non-zero only when there is heritable variation in fitness, since the effects of Mendelian segregation and non-heritable variation in reproductive success (the factors that contribute to Δ_{M} p_{t} and Δ_{N} p_{t}) are independent across generations (assuming there is neither non-Mendelian segregation nor covariance between parental and offspring environment, e.g. as in Heyer et al. 2005).

The temporal autocovariances are due to persistence over generations of the statistical associations (linkage disequilibria) between a neutral allele and the fitnesses of the random genetic backgrounds it finds itself on. These random associations develop as new mutations arise on the neutral allele’s genetic background or recombine on. Neutral alleles that are, on average, present on beneficial haplotypes will tend to leave a greater number of descendants, Δ_{H} p_{0} > 0 (light blue line in Figure 1A), while those on average associated with disadvantageous haplotypes will leave fewer, Δ_{H} p_{0} < 0 (orange line Figure 1A). As some fraction of the associations between the neutral allele and selective alleles persist across the generations, heritable variation for fitness makes the change in one generation predictive of the change in later generations, as illustrated by the fact that Cov(Δ*p*_{2}, Δ*p*_{0}) > 0 for both the blue and orange curves in Figure 1A.

Temporal autocovariance is broken down by the two forces that disassociate neutral alleles from their fitness backgrounds: segregation and recombination. Both these forces break up haplotypes and shuffle alleles among chromosomes, leading to the disintegration of the statistical associations between neutral alleles and their fitness backgrounds. Population genetic models of linked selection have tended to focus on the strongest of these associations: those between very closely linked loci. These tight associations persist over long timescales, leading to lasting impressions in local genome-wide diversity around sweeps. These signatures are detectable in single contemporaneous samples, but diversity recovers to background levels quickly away from the selected site. By contrast, quantitative geneticists first considered the weakest forms of associations: between unlinked loci within an individual (Morley 1954; Robertson 1961; Santiago and Caballero 1995). These distant associations are quickly established but are rapidly broken down by segregation and independent assortment, yet still can have a marked effect on diversity (Robertson 1961; Santiago and Caballero 1995). We show temporal autocovariance is created under these two regimes of linked selection, and below, develop expressions for its magnitude that are applicable to both. Finally, we emphasize that with temporal genomic data, one can directly measure the levels of temporal variances and autocovariances of allele frequency change in the population.

## 2 A model for multilocus temporal autocovariance

Here, we develop theory for the temporal autocovariance in a neutral allele’s frequency changes through time, generated by the presence of heritable fitness in the population. We measure the temporal autocovariance Cov(Δ*p*_{t}, Δ*p*_{s}) at a single diallelic neutral locus. Since only allele frequency changes due to heritable variation in *fitness* contributes to temporal autocovariance, we can focus exclusively on the behavior of Δ_{H} p_{t} in deriving our expressions for the autocovariance across timepoints. We imagine that an individual *i* has fitness *f*_{i}, i.e. that their expected number of children is *f*_{i}. We assume a constant population size, and so the population average fitness 𝔼_{i}(*f*_{i}) = 1. Additionally, we assume that all fitness variation has an additive, polygenic architecture. Then, with *L* loci contributing to fitness, we can write individual *i*’s fitness as , where the *α*_{t,l} is the effect size in generation *t* and g_{i,l} ∈ {0, 1, 2} is individual *i*’s gene content at locus l. This formulation is approximately equivalent to exponential directional selection on some additively determined trait; see Appendix A.2 for more detail.

When fitness variation exists in the population (that is, Var_{i}(*f*_{i}) > 0), the frequency of the neutral allele changes stochastically, as more fit individuals leave more descendents that inherit the neutral allele they carry and less fit individuals leave fewer. Across the population, stochastic associations can form between the genetic components of an individual fitness and the neutral allele they carry, leading the neutral allele frequency to change due to fitness differences across individuals. The total heritable change in neutral allele frequency Δ_{H} p_{t} can then be partitioned into each individual’s contribution to this change based on their fitness *f*_{i} and the number of the tracked neutral alleles they carry, x_{i} ∈ {0, 1, 2*}*, giving us

Substituting each fitness *f*_{i} with its genetic basis and simplifying (see Appendix Section A.2 for details) gives,
where *D*′_{t,l} is the *gametic* linkage disequilibrium between the neutral allele and the allele at the selected site l on the same gamete, whereas *D′′*_{t,l} is the *non-gametic* linkage disequilibria, or the covariance *across* the neutral and selected allele on the two different gametes forming an individual (see Weir 1996, p. 121 for details and Appendix Figure 8A for an illustration). Intuitively, this expression tells us that the heritable change in neutral allele frequency is determined by the gametic and non-gametic linkage disequilibrium between the neutral site and all sites that affect an individual’s fitness, scaled by the magnitude of each selected locus’s effect. Alternatively, we can see this as the multivariate breeder’s equation, where the neutral allele is a correlated trait responding to selection on other traits/loci (Lande and Arnold 1983). This expression is the multilocus analog of the change in a neutral site’s frequency due to hitchhiking at a single linked site (see e.g. equations (2) and (3) in Stephan et al. 2006).

Because the effects of the non-gametic LD are relatively weak compared to the gametic LD for tightly linked loci (see Appendix Section A.5 for an expression of their strength), we ignore these, and from hereafter omit the primes in our notation so that D_{t,l} refers to *D′*_{t,l}. Since 𝔼(Δ_{H} *p*_{t}) = 0, we can write the covariance Cov(Δ_{H} *p*_{t}, Δ_{H} *p*_{s}) as 𝔼(Δ_{H} *p*_{t}Δ_{H} *p*_{s}). Hereafter, we also omit the subscript H since Cov(Δ*p*_{t}, Δ*p*_{s}) = Cov(Δ *p*_{t}, Δ *p*_{s}). Expanding these terms, the covariance between the allele frequency changes at generations *t* and s can be written as

This statement for temporal autocovariance is fairly general, as it can handle fluctuating selection (e.g. when *α*_{t,l} varies with time t) and any additive multilocus evolution (as long the linkage disequilibria dynamics can be specified). Looking at the first term in this sum, we see the temporal autocovariance is determined in part by the terms 𝔼(D_{t,l}D_{s,l}). These expected LD products reflect the degree to which the association between the neutral locus and a selected site persists from generation *t* to s (here, *t* < s). Intuitively, the higher the initial association between the neutral and selected loci, and the slower rate of decay of LD between sites, the greater temporal autocovariance will be.

### 2.1 The multilocus temporal autocovariance model with directional selection

Thus far, in reaching Equation (6) we assume only that fitness is additive across loci. In this section, we develop a model of how temporal autocovariance behaves specifically under directional selection beginning at a specific point in time. To do so, we make three assumptions to simplify our expressions. First, we assume that the effect size remains constant through time, such that *α*_{l}:= *α*_{t,l} for all *t* (we relax this assumption in Section 3.2). Second, we ignore the contribution of the second term of Equation (6), 𝔼(D_{t,k}D_{s,l}) (for k = l), to temporal autocovariance. Under the case where the population is initially at mutation-drift-recombination equilibrium, we expect this product to be zero as there is no directional association between the two selected sites and the neutral site. Third, we assume that the selected sites increase in frequency independently, such that the dynamics of the linkage disequilibria between the neutral and selected sites pairs can be modeled using two-locus dynamics. Using a deterministic continuous-time model for the dynamics of the linkage disequilibrium between the selected and neutral site, we rewrite the 𝔼(D_{t,l}D_{s,l}) terms in the expression for temporal autocovariance as
where is the square of the correlation between the neutral site and selected site *l* at time *t* (a common measure of LD; Hill and Robertson 1968), and r_{l} is the recombination fraction between the neutral site and selected site *l*.

We can further simplify this expression by assuming that there is no covariation between the additive genic variation at a selected site and the linkage disequilibrium between that selected site and the neutral site (see Appendix Section A.2 for more detail). This allows us to factor out the average additive genic variation for fitness at time s and write the covariance as
where *V*_{a}(*s*) is the additive genic variance for fitness, which is the additive genetic variance for fitness (V_{A}) without the contribution of linkage disequilibria between selected sites, .

This expression allows us to calculate the temporal autocovariance in cases where we know the vector of recombination fractions between the neutral and each of the selected sites, r_{1}, r_{2}, …, r_{L}. Often we do not know the exact positions of these sites, but we can treat these positions as randomly placed on a chromosome and further simplify our model to understand the factors that determine temporal autocovariance.

### 2.2 Temporal autocovariance for an average neutral polymorphism

In the second part of our derivation, we develop a simple intuitive model of how temporal autocovariance is determined by a few key parameters when we make two additional assumptions. First, we assume selected sites are randomly and uniformly distributed along the chromosome, such that a site’s position on the genetic map is a random variable (where R is the region’s length in Morgans), and the focal neutral site with which we calculate temporal autocovariance lies in the middle of this idealized chromosome at the origin (as depicted in Figure 1B). Then, the recombination fraction between the focal neutral site and a selected site at random position g is given by the mapping function r(g), which maps the position g to a recombination fraction. A simple choice for *r(g)* is Haldane’s mapping function, , (Haldane 1919; note we take the absolute value of g to translate the position g to a distance to the focal neutral site) and we use that here. Second, we assume the linkage disequilibrium between each selected site and the focal neutral site depends only the recombination fraction *r(g)* between the two loci, and not their absolute positions or effect sizes; then, we rewrite as the function . For example, if the population was initially at drift-recombination balance, this would be where ρ = 4*Nr(g)* (Hill and Robertson 1968; Ohta and Kimura 1969). We then write the temporal autocovariance experienced by a neutral allele in a region *R* Morgans long containing *V*_{a}(s) fitness variation at time s as
(see Appendix Section A.2 for details).

This integral is the sum of the initial LD between a typical neutral locus and selected site, weighted by the decay of LD due to recombination over s *t* generations. Selection enters here through the total additive genic variance for fitness for the region divided by the genetic map length of the region (^{Va(s)}/*R*). Thus a key compound parameter in describing the temporal covariance is the additive genic variance per Morgan, a quantity somewhat similar to the ratio of new adaptive mutations per basepair to recombination per basepair, ^{νBP}/*r*_{BP}, that occurs in models of recurrent sweeps (Stephan et al. 1992). Note that we could further include the effects of genome-wide fitness variation by adding an additional term encompassing the additive variation residing on other chromosomes, but because the magnitude of these effects is roughly similar to those of the non-gametic LD, we could no longer ignore the D_{t′′,l} terms as we did after Equation (5).

To validate our theory, we simulate a fixed region of R Morgans and calculate the covariance in allele frequency changes by averaging over many uniformly distributed neutral sites within this region. Then, the random distance between a neutral site’s position n and a selected site’s position g is c = |*n–g*|, where *n, g*∼*U*(0, *R*); this random variable c has a triangle distribution, f(c) = 2(R c)/R^{2}. Averaging over the positions of both randomly placed neutral and selected sites, the temporal autocovariance is
where 𝔼_{n}(*•*) indicates an expectation taken over the position of the randomly placed neutral sites, and we define *A*(*R*, t, s) as the average linkage disequilibrium between selected and neutral sites that persists from generations *t* to *s* (*t* ≤ *s*). As is common with estimating the expected values of other ratios like F_{ST} (Bhatia et al. 2013), we use a ratio of expectations rather than the expectation of the ratio.

We can also use this expression to calculate the variance of allele frequency change. The standardized variance Var(Δ* p_{t}*)/

*p*(1

^{t}*−*) has two components: the drift term and the heritable variance in offspring number. Adding these independent contributions, the standardized variance is where

*p*_{t}*V*

_{N}is the non-heritable variance in offspring number. Under a Wright–Fisher model of reproduction,

*V*

_{N}≈ 2, this simplifies to

When combined, this expression for the variance in allele frequency change and our expression for temporal autocovariance are in agreement with Robertson (1961) and Santiago and Caballero (1995; 1998) when predicting the total variance in allele frequency change; see Appendix A.6.

### 2.3 Modeling the dynamics of additive genic and genetic variation

Our expressions for temporal autocovariance (Equation 10) requires an expression for *V*_{a}(*t*), the additive genic variation through time. However, we lack general expressions for the dynamics of the additive genic variation during selection, as these dynamics are quite complex for a few reasons. First, since our theory considers polygenic selection at a finite number loci in a region, additive genic variation is not constant as it would be under an infinitesimal model (Bulmer 1980). Second, we allow for arbitrary levels of recombination from very tight linkage to loose linkage. Previous work has shown that predicting the dynamics of additive genic variation in a system with an arbitrary level of recombination is difficult, as both the additive genic and genetic variances depend on the higher-order moments of linkage disequilibrium (see Barton and Turelli 1987, and p. 607 of Turelli and Barton 1990).

A primary determinant of the additive genic variation is the heterozygosity of the selected sites. Assuming effect sizes are constant through time and across loci, we can rewrite the additive genic variation, *V*_{a}(*t*) = 2*α*^{2} ^{∑}_{l} *p*_{l}(*t*)(1 *− p*_{l}(*t*)), as
where *SSH( t)* = 2

_{l}

*p*

_{l}(

*t*)(1 −

*p*

_{l}(

*t*)) is the sum of site heterozygosity at time t. Ideally, we would directly use SSH(

*t*) in a region; however, this would require knowing

*a priori*which sites are being selected. Instead, we assume that the trait is sufficiently polygenic that frequency changes due to selection are weak, and that the change in heterozygosity at neighboring neutral polymorphic sites approximately mirrors that at selected polymorphisms. Then, using the sum of site heterozygosity at neutral sites, SSH

_{n}(

*t*), as a proxy for the sum of site heterozygosity at selected sites, where we define

*ssh*

_{n}(

*s*) =

*SSHn*(

*s*)/

*SSH*(1) as the factor by which

_{n}*V*

_{a}(1) decreases at time s, approximated by neutral sites’ allele frequency changes. Under this approximation, the dynamics of genic variation are determined by one free parameter,

*V*

_{a}(1), and the directly measurable sum of site heterozygosity at neutral sites through time.

Our focus here is on the short-term response of a population, and so we look at the decay of genetic backgrounds present at the onset of directional selection. In reality, new mutations consistently create additive genetic variation for fitness; thus, an equilibrium level of additive genetic variance in the population can be maintained. The long-run affect of linked selection under this equilibrium model is handled by Santiago and Caballero (1995, 1998); see Appendix A.6.

### 2.4 Multilocus Simulation Details

To test our theoretical expressions, we have conducted extensive forward simulations of directional selection on a polygenic trait. We vary four critical parameters in these simulations: (1) the level of additive genetic variance at the onset of selection (V_{A}), (2) the level of recombination (R in Morgans), (3) the number of selected sites in the region (L), and (4) the population size (N). We choose our grid of the selection and recombination parameters based on the levels we would expect across a wide variety of organisms; see Appendix Section A.7 for details. We used three different population sizes (N ∈ {100, 500, 1000}), but note that we use N = 1000 and a subset of the other parameters in our figures to prevent overplotting.

Before the onset of selection, we create the initial diploid population from a pool of gametes created by msprime (Kelleher et al. 2016), such that the initial allele frequency distribution and linkage disequilibria between sites is at mutation-drift-recombination balance. Then, we pass this pool of gametes into a forward Wright–Fisher-with-recombination simulation routine and let it evolve for four generations neutrally before initiating selection on the fifth generation. These first four generations of neutral evolution (without mutation) serve as a control to validate that the variance in neutral allele frequency change is as expected under a Wright–Fisher model and that temporal autocovariance between a generation before selection and during selection is zero.

We generate genetic variation for fitness by choosing L random loci from the neutrally-evolved sites, and randomly assign them an effect size in *α*, such that the expected total amount of additive genic variation is the *V*_{a} parameter (note that the initial additive genic and genetic variance are equal, *V*_{a} = *V*_{a}, as the LD contribution is zero for randomly chosen sites). This approach creates some additional variance around the target level of additive genic variation, as the sum of site heterozygosities will vary stochastically across simulation replicates. At the onset of selection, an individual *i*’s trait value is calculated as where g_{i,l} is their number of alleles with effect size *α* at locus l. Then, their absolute fitness is calculated using an exponential fitness function w(z_{i}) = *e*^{zi}(Turelli and Barton 1990, p. 17). Under our Wright–Fisher model, we sample the parents of the next generation according to a multinomial distribution, where the probability of individual i being a parent is .

We record 50 generations of evolution total, after which we compute the empirical standardized temporal variance-covariance matrix , for each replicate. After marking frequencies reaching fixation or loss as missing values, we calculate a vector of allele frequency changes using each neutral locus n’s τ + 1 observed generations. Then, we calculate the τ × τ standardized variance-covariance matrix , averaging over M neutral loci such that element q_{t,s} is calculated as

Sums over missing values only use pairwise-complete observations, implemented by R’s cov() function’s `use=’pairwise.complete’` argument.

We have extensively validated our simulation procedure in a neutrally evolving population, ensuring that the decay of linkage disequilibrium and the allele frequency change match expectations (see Supplementary Figures 1, 2, and 3).

### 2.5 Comparing theory to simulation results

To validate our expressions for temporal autocovariance, we compare the levels of autocovariance and variance predicted by Equation (10) and (12) to the average levels observed across simulation replicates. To calculate the theoretic values of temporal autocovariance and variance, our expression requires the additive genic variation at s, *V*_{a}(*s*); however, as described in Section 2.3, we lack an analytic expression for the dynamics of genic variation to plug into *V*_{a}(*s*). Following the approach of others in evolutionary quantitative genetics (Turelli and Barton 1994, p. 930), we substitute the numerical values calculated directly from the simulation data for *V*_{a}(*s*). Additionally we consider two other numerical values related to the additive genic variance: the observed additive genetic variance from our simulations (V_{A}(*s*) = Var_{i}(z_{i}) at time s, which includes the contribution of LD between selected sites), and the additive genic variation at time s as approximated by the observed decay in the sum of site heterozygosity at neutral sites (V_{a,sshn} (1), as described in Section 2.3).

Figure 2 compares the fit of our theory with differing additive genetic variances with the empirical covariances from our multilocus simulations. In each panel, we plot the level of temporal autocovariance between the allele frequency change across the first two generations of selection (Δ*p*_{5}) and some later allele frequency change Δ*p*_{s} where s varies along the x-axis. Each point represents the temporal autocovariance (calculated across all sites in a region according to Equation 16) averaged across 100 replicate simulations, with the color of the point indicating the number of selected sites in the region. Within each panel, the temporal autocovariance predicted by Equation (10) is plotted as a set of three lines, one for each of the three different types of variance we have substituted in for *V*_{a}(*s*). Overall, the fit is close but varies depending on the type of variance used for *V*_{a}(*s*); we discuss each in turn below.

Using empirical additive genic variation (solid lines), our theory provides a good fit to the simulation results for a short period after selection is initiated (5 generations) in regions with tighter linkage (R = 0.01 Morgans) across a range of additive genetic variation parameters (0.01 *V*_{a} ≤ 0.05; see Supplementary Figure 6 for *V*_{a} varying over orders of magnitude). With looser linkage (R ≥ 0.1 Morgans), our theory using the empirical additive genic variation fits much more closely over a longer duration (∼10-15 generations). Note that some variability is caused by the noise of each simulation replicate around the target initial additive genetic variation *V*_{a} (see Section 2.4), as each replicate samples sites from a neutral coalescent. Our theory also accurately predicts the temporal autocovariance for different choices of reference generation, i.e. varying t, see Supplementary Figure 5.

When we use the sum of site heterozygosity at neutral sites (V_{a,sshn}, shown as a short-dashed lines) as a proxy for additive genic variation, the theory fits simulations over the same timespan as using the empirical additive genic variation. This is because (1) the SSH at neutral sites closely matches the SSH at selected sites, and (2) both closely follow the dynamics of additive genic variation through time (see Supplementary Figure 4). Using V_{a,sshn} has the advantage that we can directly measure neutral SSH, which proves useful later in Section 3, as we use this approach to help infer the initial additive genic variation at the onset of selection.

Finally, we find using the additive genetic variance V_{A}(*s*) = Var_{i}(z_{i}) accurately predicts the dynamics of temporal autocovariance over tens of generations (see the long-dashed lines in Figure 2). Furthermore, calculating the temporal autocovariance using the empirical additive genetic variation better fits simulation data in regimes with tight recombination, where using genic variation performs poorly after the first few generations (e.g. the column of panels where R = 0.01). Thus using the additive genetic variance in our framework provides a good fit to the temporal dynamics over relatively long time spans.

What differentiates V_{A}(*s*) from *V*_{a}(*s*) that could explain this better fit? The additive genic variation *V*_{a}(*s*) ignores the contribution of linkage disequilibria between selected sites. We can write the additive genetic variance as
where D_{i,j}(*s*) is the LD between selected sites i and j at time s. At the onset of selection, there is no expected linkage disequilibria between selected sites since the sites and effect sizes were randomly sampled — in other words, 𝔼(D_{i,j}(*s*)) = 0. We see this in Figure 2, as the temporal autocovariance predicted with *V*_{a}(*s*) match those of V_{A}(*s*) when s = 6 (see also Supplementary Figure 4, which plots the empirical additive genic and genetic variances over time). Over time, these two quantities diverge as negative linkage disequilibria build up. While negative linkage disequilibria between selected sites build up due to epistasis under some forms of selection (known as the Bulmer effect, Bulmer 1971; Bulmer 1980), this is known not to happen under multiplicative selection (Bürger 2000, p. 50, 177) that is equivalent to the exponential directional selection fitness surface we have used in our simulations. Instead, the build up of negative linkage disequilibria between selected sites is likely due to Hill-Robertson interference (HRi) between selected sites (Hill and Robertson 1966), which affects the total additive genetic variation that selection is acting on. HRi refers to the creation of negative LD among beneficial alleles in finite population resulting from the fact that beneficial alleles that are on the same haplotype move more quickly through the population than beneficial alleles on deleterious backgrounds, resulting in negative LD. This negative LD among beneficial alleles lowers *V*_{a} compared to the genic *V*_{a} (Barton and Otto 2005; Crouch 2017; Good et al. 2014). Importantly, our simulation results suggest that the negative linkage disequilibria created by selective interference only affects the temporal autocovariances through the variance term *V*_{a}(*s*), and that the actual variance determining temporal autocovariance is the additive genetic variance, V_{A}(*s*).

In addition to modeling autocovariance through time, our theory can predict the total temporal variance in allele frequency, Var(*p*_{t} *p*_{0}), when there is heritable variation for fitness. Furthermore, from Equation (3) recall that we can decompose Var(*p*_{t} *p*_{0}) into variance and covariance components. The variance components are determined by both the magnitude of drift (1/2*N*) and selection according to Equation (11), and the covariance components are determined solely by selection according to Equation (10) (assuming no inheritance of environmental factors). Using our theory, we have predictions for each of these components given the amount of additive genic/genetic variation for fitness, the population size (N), and the amount of recombination (R). In Figure 3, we compare the magnitudes of these components (averaged over the replicates of our simulations) to our theoretic predictions. We depict the predictions for the variance and covariance components using both the empirical additive genetic variance (V_{A}) and the neutral sum of site heterozygosity proxy (V_{a,sshn}) as adjacent bars, each around a point range with the point representing the average value over simulation replicates, and the bars indicating the lower and upper quartiles over simulations.

Finally, we have found that across a wide range of recombination and additive genetic variation parameters, the temporal autocovariance Cov(Δ*p*_{t}, Δ*p*_{s}) is largely determined the compound parameter ^{VA}/*R* and the number of generations between *t* and s, which is a factor in Equation (9). We show in Figure 4 that the temporal autocovariance Cov(Δ*p*_{5}, Δ*p*_{s}) from simulations across a wide range of *V*_{a} and R parameters fall roughly on the same curve for each number of elapsed s–t generations.

### 3 Estimating linked-selection parameters from temporal autocovariance

Our multilocus theory provides analytic expressions for the expected variances and covariances for a neutral allele’s frequency; thus a natural approach to parameter estimation is to equate these expectations to averages from the data and apply the method-of-moments. We describe a method-of-moments procedure below to estimate the initial additive genetic variance at the onset of selection (*V*_{A}(1)) in the first generation, and the drift-effective population size (*N*) from temporal data within a single region *R* Morgans long, and then show a simple extension that allows this to be applied to genome-wide data. Our basic approach is to calculate first the sample variances and covariances of the τ observed generation-to-generation allele frequency changes, averaging over all of the putatively neutral sites in a region. We then equate these sample variances and covariances to our analytic expressions for the variance and covariances, leaving us with an overdetermined system of equations, which we solve using least squares. We demonstrate this simple estimation procedure provides accurate estimations of initial additive genetic variance and the drift-effective population size.

From our multilocus theory, we have analytic expressions for each element of the τ τ covariance matrix of allele frequency changes in a region. To model the additive genic variance through time, we use the empirical neutral sum of site heterozygosity approximation as described in Section 2.3. This approximates the rate that additive genic variation decreases through time from some initial level, V_{A}(1), which we wish to estimate. In total, we have τ + ^{τ (τ −1)}/2 unique moment equations, which for the variance and covariance are defined as

Here the first line gives the form of τ equations for the variance of allele frequency changes between subsequent generations, which includes the effect of genetic drift, . The second line gives the form of the covariances of allele frequency changes among different generations. The term A(R, t, s) is the average level of linkage disequilibrium after the s–t generations that have elapsed, given there are R Morgans of recombination. In our multilocus theory section and simulations, this is equal to the integral in Equation (10). However, we can also directly calculate a sample from observed linkage disequilibrium in a region (for details, see Appendix Equation (53)).

Following the method-of-moments, we equate each of these independent τ + ^{τ (τ −1)}/2 equations for Q_{t,s} to the observed sampling moments, the elements q_{t,s} of the upper triangle of the observed heterozygosity-normalized covariance matrix described in Equation (16). This yields τ + ^{τ (τ −1)}/2 equations with 2 unknown parameters: and . We solve this overdetermined system of equations using least squares, an approach similar to the generalized method-of-moments in econometrics (Hansen 1982). This approach finds parameter estimates that minimize the squared error between the moment-based parameter estimate and the true parameter value, with respect to the true parameter value. We write the elements q_{t,s} of the upper triangle of the observed covariance matrix in the vector , and write the method-of-moments equations as,
where the elements of and , in the same order as , are given by
where δ_{t,s} is an indicator variable that is 1 when s = *t* and zero otherwise.

Then, we can readily estimate the parameters and using least squares. We then obtain estimate of by taking . Since these equations are not statistically independent, we cannot assume . However, this does not affect our estimates and , as the least squares procedure is unbiased regardless of the covariance structure between the error terms (Christensen 2011, p. 26).

Using this method-of-moments approach, we sought to infer the parameters of 20 of the replicates across the 254 parameter combinations (the same as used in Figure 2). We use the first five generations after the onset of selection to infer and , as for this short timespan the additive genetic variance is well approximated using sum of neutral site heterozygosity approach (see Section 2.5). Each simulation replicate includes around 500 neutral sites (the exact number is random, see Appendix A.7 for details).

Applying our approach to these simulations, we find we can infer both the initial level of additive genetic variation V_{A}(1), and the effective population size N from multilocus temporal data. In Figure 5A, we show our method-of-moments gives reasonable estimates for the initial level of additive genetic variance over orders of magnitude of additive genetic variation, and different recombination regimes. As additive genetic variation for fitness becomes weaker (the left side of the figure), our estimates become more noisy. In Figure 5B we show the simultaneously estimated population size N closely matches the true value, across all different levels of recombination.

We can extend this approach to whole-genome data by imagining partitioning up the genome into B non-overlapping windows of length w_{BP} in basepairs (e.g. megabase windows). We first assume that windows contribute uniformly to the genome-wide level of additive genetic variance for fitness, and show how our method-of-moments approach can be used to estimate a global V_{A}(1). Assuming a uniform distribution of genetic variance across basepairs, the total additive variance is V_{A}(1) = v_{A}(1)Bw_{BP}, across our B windows, where v_{A}(1) is the additive genetic variance per basepair. As each window i contributes to v_{A}(1)w_{BP}, our least squares approach given by Equation (20) becomes

However, we expect *a priori* that windows containing more coding bases might disproportionately contribute to the total additive genetic variance. This suggests an alternative model to fit where partitions of the additive genetic variance across windows are proportional to the number of coding bases, similar to background selection and other linked selection models (CorbettDetig et al. 2015; McVicker et al. 2009; Rockman et al. 2010). Thus, we could write total where w_{CBP,i} is the number of coding or exonic basepairs in window i (this could be any quantifiable annotation feature in the window), and is the total number of coding bases in the genome. With window i contributing v_{A}(1)w_{CBP,i} to the additive genetic variance and having map length R_{i}, we now define and as having elements given by the equations

Again, the parameters of this model, and , can be estimated with least squares. When analyzing genome-wide data, these various models could potentially be compared by an out-of-sample procedure, using inferred parameters to estimate the mean-squared predictive error between the two models for the remaining windows (Elyashiv et al. 2016). The confidence intervals for our method-of-moments estimates could be obtained through bootstrapping genomic windows since the errors are not identically and independently distributed.

### 3.1 Estimating the proportion of allele frequency change due to linked selection

We can also estimate what fraction of allele frequency change over *t* generations (^{Var(pt−p0)}/*t*) is due to linked selection acting to perturb the frequency trajectories of neutral alleles. We have developed two approaches: first, a more conservative approach that considers only the contribution of selection to the temporal autocovariance, and second, a more exact approach that uses the estimated effective population size to include the contribution of selection to both variances and covariances of allele frequency change.

First, a simple estimate of the total fraction of the variance in allele frequency change (G) caused by linked selection is

However, this estimator is conservative because it ignores the contribution that linked selection has on the variance in allele frequency change across a single generation (the Var(Δ *p*_{t}) term in Equation 2). If we include these variance terms, we have a less-conservative estimator we call G*′*,

We can think of the numerator of the second term in Equation (25) as the variance in allele frequency change in a Wright–Fisher population without selection. Recall that under a Wright– Fisher model, the standardized variance across *t* generations is approximately (1–exp(–*t*/2*N*)) ≈ *p*_{0}(1 − *p*_{0}) *t*/2*N*, where this second approximation works for short time spans (*t*/2*N* 1). This suggests that we can use our method-of-moments estimate of the effective population size without the effects of selection, , and compare the fraction of standardized variance we expect under this rate of drift to the empirical standardized variance,

Figure 6 shows the estimated G′ from the method-of-moment estimates using 20 replicates of simulated data. We learn three important points about our G′ estimator. First, for low V_{A}, or *V*_{a} = 0, the estimator is quite noisy. Second, although the signal can be noisy for low V_{A}, the relationship between G′ and level of recombination is consistent with selection affecting the total variance in allele frequency changes across the genome. Finally, this suggests that a negative relationship between G′ and recombination rate, calculated in windows across the genome, is a robust signal of linked selection impacting the total variance in allele frequency change. Furthermore, we would expect a positive relationship between the number of coding basepairs per window (when such information is available) and G′, which could serve as another robust signal of linked selection impacting the total variance in allele frequency change.

### 3.2 Fluctuating Selection

Thus far we have assumed that fitness effect sizes are constant through time, that is *α*_{t,l} = *α*_{s,l}, for all t, s. In natural populations, changes in the environment or composition of the population may cause these effect sizes to change through time, due to changing selection pressures and changes in the epistatic environment experienced by alleles. If these changes occur within the timeframe of recorded allele frequency changes, the levels of temporal autocovariance will differ from the levels predicted from our directional selection theory. However, from Equation (6) we can see that the magnitude of temporal autocovariance is determined in large part by E(*α*_{t}*α*_{s}).

Here, we discuss how temporal autocovariance behaves under an example of strong fluctuating selection: when selection on a trait changes direction at some point. Specifically, we change the fitness function w(z_{i}) = *e*^{zi} to w(z_{i}) = *e*^{−zi} after some timepoint *t**; this is equivalent to changing *α*_{s,l} = −*α*_{t,l} iff *s* ≥ *t**, and *α*_{s,l} = *α*_{t,l} otherwise for all other *s* < *t**.

When such a strong change in the direction of selection occurs, the temporal autocovariance between timepoints before and after the change becomes negative, since temporal autocovariance is determined by the product *α*_{t}*α*_{s} for *t* = s (here we are holding effects constant across loci). We have validated this using the same simulation procedure as described in Section 2.4, except on generation 15 we reverse the direction of selection on the trait by changing the fitness function w(z) = *e*^{z} to w(z) = *e*^{−z}. In Figure 7A, we show the temporal autocovariance Cov(Δ*p*_{5}, Δ*p*_{s}) for varying *s* along the x-axis (in this case, *V*_{a} = 0.05, R = 0.1, and L = 500). During the first five generations, the temporal autocovariance behaves as it does under directional selection, decaying due to the decrease in additive genetic variance and the breakdown of linkage disequilibrium. Then, on the 15^{th} generation, the direction of selection on the trait with breeding value z_{i} reverses and temporal autocovariance becomes negative since *α*_{s,l}*α*_{t,l} < 0 for all *s* ≥ *t** and *t* ≥ *t**. Under this simple flip in the direction of selection pressure, the genic variance, , in the expressions for the temporal autocovariance can be replaced with , akin to a genetic/genic covariance. In Figure 7A, the gray line is our predicted level of temporal autocovariance proportional to V_{A}A(R, t, s) given by Equation (8) before generation 15, and after generation it is proportional to V_{A}A(R, t, s) (using the empirical additive genetic variance). Note, however, that the dynamics of additive genetic variance under fluctuating selection are more complex than under directional selection. Whereas under directional selection the genetic variance decays as selection proceeds, under fluctuating selection there can be a transient increase in the additive genetic variance (seen in Figure 7A between generations 15-24). This transient inflation of the additive genetic variance is caused by the increase in the heterozygosity of haplotypes that had experienced reduced heterozygosity due to directional selection. With the direction of selection reversed, previously selected haplotypes move to more intermediate frequencies, which increases the additive genetic variance until selection proceeds and this variance decays (generations 25 and onwards). Overall, the dynamics of additive genetic variance under fluctuating selection are more complicated than under directional selection which makes inference using our sum of site heterozygosity approximation infeasible.

Since fluctuating selection can create *negative* temporal autocovariance, the total amount of autocovariance over time (e.g.∑_{t≠s} Cov(Δ*p*_{t}, Δ*p*_{s})) can misrepresent the actual amount that linked selection is affecting allele frequencies on shorter timescales. This, in turn, leads our estimator G, for the fraction of variance in allele frequency due to linked selection, to underestimate the total contribution of linked selection to variation in allele frequencies over the time period. We show an example of this in Figure 7B, which depicts the total variance in allele frequency change ^{Var(pt−p0)}/*t* through time, partitioned into variance and covariance components and colored according to whether the generation was before and after the reverse in directional selection. The covariances ∑_{t≠s} Cov(Δ*p*_{t}, Δ*p*_{s}) increase as they would under directional selection, but after generation 15, the contribution of covariance begins to decrease as negative autocovariances accumulate.

By generation 20, the total covariance terms have a net negative effect, and actually act to decrease the total variance Var(*p _{t}*−

*p*

_{0})/

*t*for a few generations below the constant level expected under drift and heritable variation.

To more fully capture the contribution of selection allele frequency change, we modify *G*, using the absolute value of the covariances,
which prevents negative temporal autocovariances from canceling out the effects of positive temporal autocovariances, since both are a reflection of linked selection acting on neutral allele frequency changes. We show G_{abs} in Figure 7C, where even after the change in the directional selection we see a steady accumulation of covariance contributing to total variance ^{Var(pt−p0)}/*t*. This also suggests one plausible way to check for genomically wide-spread fluctuating selection would be to test if G_{abs} > G. However, we note that in contrast to our simulations, it is likely that in natural populations only a subset of alleles change their relationship to fitness, and so different approaches may be needed to identify fluctuations.

## 4 Discussion

Currently, the prevailing empirical approach to studying linked selection relies on using samples from a single timepoint and modeling the patterns of diversity subject to different functional constraints and in different recombination environments. The early theoretic work underpinning empirical analyses of linked selection’s effects on diversity were primarily full sweep, recurrent hitchhiking models, where beneficial mutations arise in the population and then sweep to fixation (Kaplan et al. 1989; Maynard Smith and Haigh 1974; Stephan et al. 1992). Furthermore, by looking at the patterns of diversity around amino acid substitutions or the site frequency spectrum in low recombination regions, researchers have teased apart the effects of background selection and hitchhiking in *Drosophila* (Begun et al. 2007; Elyashiv et al. 2016), humans (Hernandez et al. 2011; McVicker et al. 2009), and some plants species (Beissinger et al. 2016; Nordborg et al. 2005; Schmid et al. 2005; Williamson et al. 2014). Yet, as other theoretic models of hitchhiking incorporating changes in the environment (Kopp and Hermisson 2007, 2009a,b), sweeps originating from standing variation (Hermisson and Pennings 2005), and multiple competing beneficial haplotypes (Pennings and Hermisson 2006) have been developed, it has become rather more difficult to detect the signal of these hitchhiking phenomenon in empirical data. We’ve proposed here that temporal autocovariance offers a unique and measurable signal of linked selection over shorter timescales that provides a fuller picture of the ways in which genome-wide diversity has affected by these other hitchhiking phenomena.

### 4.1 Empirical Applications and Future Directions

Here, we’ve developed expressions for temporal variances and autocovariances, and applied these to model temporal variances and covariances during directional selection on a trait. We’ve demonstrated how one can (1) estimate the additive genetic variance for fitness, (2) estimate the fraction of variance in allele frequency change due to linked selection, and (3) evaluate whether fluctuating selection is operating from these temporal variances and autocovariances. However we recognize a series of limitations and difficulties when applying these methods to empirical data and natural populations.

First, one difficulty with temporal sampling of natural populations is the risk that the genetic composition may change drastically due to migration or biased sampling across timepoints. Since our theory assumes a constant-sized and isolated population, migration into the sampled population presents a serious potential confounder. For example, seasonal migration could create an influx of new alleles that could at best dampen signals of directional selection across seasons, or at worst create a signal of artificial covariance between like seasons. Similar biases could occur if a sampling method incidentally preferred certain subgroups in a stratified population. This could occur, for example, if individuals differ in some behavior affecting their likelihood of being sampled across different temporal environments, which could cause spurious covariances. While such sampling issues and migration might be able to be detected *post hoc* from exploratory data analysis approaches like PCA, studying isolated natural populations and carefully designing sampling schemes would lead to the best inference. Importantly, the effects of gene flow and other temporal inhomogeneities could differ across recombination environments, as among population differentiation will be more pronounced in regions of low recombination and high functional density (Burri 2017; Keinan and Reich 2010; Nachman and Payseur 2012). In situations where migration is a factor, one way forward might be to study the contribution of linked selection after partitioning out the effects of gene flow across recombinational and functional environments by extending admixture inference approaches that estimate the genome-wide effect of drift and admixture.

Second, our method-of-moments approach relies on assuming we can approximate the dynamics of additive genetic variance through time by using the empirically observed changes in sum of site heterozygosity in a region as a proxy for its decay. While we have shown this model works under directional selection in a relatively idealized setting, inference in natural populations may be complicated by changes in the environment that induce the effect sizes across loci to vary across timepoints. While our fluctuating selection results show that our directional selection theory extends to changes in the direction of selection with minor adjustments (e.g. Figure 7), having the effect sizes vary across each generation would complicate the dynamics of additive genetic variance through time and make inference of *V*_{a} difficult. Similarly, we assume that effect sizes are constant across sites. Variance in effect sizes across a region will not bias our results unless there is covariance between effect size and local recombination rate. Further work is required to develop statistical methods to test for violations of our assumptions about effect sizes remaining constant across time, and to potentially incorporate these complications into inference.

Along similar lines, we have focused on directional selection under a multiplicative model. However, selection experiments, a natural place to apply our method, often use truncation selection, which generates systematic epistasis and thus linkage disequilibria among loci (Bürger 2000; Walsh and Lynch 2018). Similarly, in natural populations stabilizing selection will act on many traits, which can also generate LD among loci. These selective processes will act to rapidly reduce the additive genetic variance for fitness across time, especially in low recombination regions, and to reduce the initial additive genetic variance in low recombination regions. Simulating the effect of truncation selection and stabilizing selection on temporal covariances in allele frequencies seems a useful direction. Our model may prove to be a useful null model of selection that the complications of epistasis could be tested against.

Finally, while we demonstrate our method-of-moments estimation approach is simple and leads to unbiased estimators, we see there are opportunities for simple extensions and other inference procedures. Differences in recombination rates and coding density are relatively easily accommodated (Equation 23). In fitting our model we assumed a parametric form to the initial LD between neutral and selected loci; however, in practice the initial linkage disequilibria between neutral polymorphisms and putatively functional sites could be estimated empirically. Using the empirical LDs in Equation (23) could make the inference somewhat analogous to LD Score regression (BulikSullivan et al. 2015). The LD Score of a SNP is simply the sum of the R^{2}’s of the focal SNP to all SNPs within some large physical genomic window, which could be used in place of the integral in Equation (10). Using this equation, *V*_{a} could be estimated by regressing the temporal covariance of a SNP on its LD Score. An alternate approach would be to use likelihood methods to model each neutral site’s frequency changes using the set of pairwise linkage disequilibria and recombination distances between the neutral site and all neighboring polymorphic sites. Then, genome-wide or region-wide estimates could be found via composite likelihood methods, in a similar manner to McVicker et al. (2009) and Elyashiv et al. (2016). Furthermore, one could include different V_{A} parameters for neighboring polymorphic sites with specific functional annotations, such as those in genic regions, introns, exons, etc. to see how different classes of sites contribute to the additive genetic variance for fitness. Our hope is that statistical methods to quantify the effects of linked selection over short timescales will improve and be combined with measures of phenotypic change, leading to a more synthetic view of how selection on ecological timescales occurs at the genetic and phenotypic levels.

### 4.2 Reconciling Temporal Linked Selection with Single Timepoint Studies

Our goal in this paper is to suggest that quantifying variance and autocovariance using temporal data sets can help us understand the impact linked selection has across the genome on short timescales, which supplements our current view informed mainly by single timepoint studies. A range of approaches to estimate the parameters and impact of models of linked selection from a single contemporary timepoint have been developed (Begun and Aquadro 1992; Elyashiv et al. 2016; Hudson 1994; McVicker et al. 2009; Sella et al. 2009; Wiehe and Stephan 1993). These estimates necessarily reflect linked selection over tens to hundreds of thousands of generations. One question is whether these estimates of the proportion of allele frequency change due to linked selection should line up with those over shorter time periods? Some forms of linked selection may be fairly uniform over time, whereas rare, strong sweeps will have a huge impact on long-term patterns of variation but may be hard to catch in temporal data. Conversely, as we discuss below, fluctuating selection may lead to stronger signals of linked selection on short timescales than seen in long-term snapshots.

Studies of contemporary data have revealed multiple lines of evidence for the effect of linked selection in a variety of taxa. If linked selection is pervasive across the genome, diversity could be severely dampened as most sites would be in the vicinity of selected sites, thus reducing the genomewide level of diversity without leaving strong local signals differentiated from the background. This is one proposed resolution of Lewontin’s paradox, the observation that diversity levels occupy a narrow range across taxa with population sizes that vary by orders of magnitude (Gillespie 2001; Leffler et al. 2012; Lewontin 1974; Maynard Smith and Haigh 1974). Elyashiv et al. (2016) estimated a 77 89% reduction in neutral diversity due to selection on linked sites in *Drosophila melanogaster*, and concluded that no genomic window was entirely free of the effect of selection. Similarly, Corbett-Detig et al. (2015) has found evidence of a stronger relative reduction in polymorphism due to linked selection in taxa with larger population sizes. However, these reductions fall short of the many orders of magnitude required for linked selection to explain Lewontin’s paradox (Coop 2016).

One limitation of these approaches is that they require estimating π_{0}, the level of diversity in the absence of linked selection, usually from the diversity in high-recombination regions with low gene content. The average genome-wide reduction of diversity can then be judged relative to π_{0}. Ideally, π_{0} would be a measure of the average diversity due entirely to drift and demographic history, i.e. unaffected by heritable fitness variation. However, there are two complications with this. First, as Robertson (1961) first showed, even a site completely unlinked from sites creating heritable fitness variation experiences a reduced effective population size due to the total additive genetic variance for fitness at these unlinked sites, and thus lower diversity (see also Santiago and Caballero 1995). The second complication is that if linked selection is sufficiently strong, the bases used to measure π_{0} may not be sufficiently unlinked from fitness-determining sites to plateau to the Robertson (1961) level of diversity, a known potential limitation (Coop 2016; Elyashiv et al. 2016). Overall, the empirical studies relying on present-day samples from a single timepoint could be underestimating the effects pervasive linked selection has on diversity. If linked selection can be observed over suitable timescales in temporal data, we might be able to disentangle some of these effects. For example, if high recombination regions still show temporal autocovariance in allele frequency change, we would have evidence that even these regions are not free of the effect of linked selection and we might be able to estimate its long term impact on levels of diversity.

Temporally or spatially fluctuating selection has long been discussed as a explanation for abundant, rapid phenotypic adaptation over short timescales, yet over longer timescales both phenotypic changes and molecular evolution between taxa are slow (Gingerich 1983; Hendry and Kinnison 1999; Messer et al. 2016). However, most of our approaches to population genomic data are built on simple models with constant selection pressures, as typically we have not had the data to move beyond these models (Messer et al. 2016). Currently, many approaches to quantify the impact of linked selection due to hitchhiking assume classic sweeps, where a consistent selection pressure ends in the fixation of a beneficial allele (Hernandez et al. 2011; Sella et al. 2009; Wiehe and Stephan 1993). However, fluctuating selection can have a larger effect on reducing diversity than classic sweeps (Barton 2000) depending on the timescales over which such fluctuations occur. In fact as Barton (2000) points out, the total effect of classic Maynard-Smith and Haigh-type sweeps on diversity is limited by the relatively slow rate of substitutions. We show that when the direction of selection on a trait abruptly reverses, this creates negative autocovariance between the allele frequency changes before and after the reverse in direction. We can observe the shift by plotting autocovariances over time and noting when they become negative, indicating a negative additive genetic covariance between fitness at two timepoints. Here we assume a simple form of fluctuating selection: where selection pressures on all of our sites flip at some timepoint. In reality, selection pressures will change on only some traits, and some of the genetic response will be constrained by pleiotropy, thus only some proportion of the additive genetic variance will change. Still, we expect some level of negative covariance after a reversal in the direction of selection, and there is additional signal of fluctuating selection by comparing how the strength of temporal autocovariance varies with recombination and the initial level of linkage disequilibrium in the genome.

### 4.3 Reconciling Estimates of *V*_{A} from Temporal Genomic Data and Quantitative Genetic Studies

_{A}

The temporal covariance of allele frequencies potentially offers a way to estimate the additive genetic variance for fitness, as illustrated by our method-of-moments approach across genomic windows. The additive genetic variance for fitness can, like any other trait, be estimated through quantitative genetics methods, which exploit the phenotypic resemblance between relatives and their known kinship coefficients (Kruuk 2004; Shaw and Shaw 2013; see Hendry et al. 2018 for a review), and these methods have been applied to estimate the additive genetic variance for fitness from natural populations (Burt 1995; Mousseau and Roff 1987). Ideally, one could reconcile quantitative genetic measures of fitness variance with estimates from allele frequency covariance. For example, Charlesworth (2015) undertook a similar analysis in *Drosophila melanogaster*, comparing population genetic estimates of fitness variance to quantitative genetics estimates, highlighting a discordance potentially consistent with undetected large-effect alleles that are likely maintained by some form of balancing selection. By allowing us to directly measure fitness variation from population genetic data over very short timescales, temporal data could help untangle the causes of this discordance. A natural extension of this would be to see which regions contain the greatest inferred levels of additive genetic variance for fitness, and test for functional covariates such as the number of coding bases, etc. Whereas previous temporal studies have focused on finding loci under selection, inferring the level of additive genetic variance could provide a more complete view of how much selection operates over short timescales.

### 4.4 Concluding Thoughts

With temporal data we can directly partition the total variance in allele frequency change across generations, Var(*p*_{t} *p*_{0}) into components according to the underlying process governing their dynamics: drift and linked selection. Since the trajectory of a neutrally drifting polymorphism does not autocovary, evidence of temporal autocovariance across neutral sites in a closed population is consistent with linked selection perturbing these sites’ trajectories. If we consider drift to be the process by which non-heritable variation in reproductive success and Mendelian segregation cause allele frequencies to change, then this is estimable from and separable from the effects of linked selection using temporal data. This helps frame the long-running debate about the roles neutral drift and linked selection have in allele frequency dynamics into a problem that can potentially be directly quantified by the contribution of each distinct process with temporal data.

## 5 Code and Data Availability

All code and simulation data to reproduce these results are available on GitHub at https://github.com/vsbuffalo/tempautocov.

## B Supplementary Figures

### B.1 Validation of simulation routine

#### B.2 Dynamics of Variances

#### B.3 Supplementary Temporal Autocovariance Figures

## 6 Acknowledgments

We thank Matt Osmond and Doc Edge for feedback on previous versions of the manuscript, and Nick Barton, Dave Begun, Sarah Friedman, Bill Hill, John Kelly, Chuck Langley, Sally Otto, Jonathan Pritchard, Anita To, Michael Turelli, and members of the Coop lab for helpful conversations. This research was supported by an NSF Graduate Research Fellowship grant awarded to VB (1650042), and NIH (R01-GM108779) and NSF (1353380) awarded to GC.

## A Appendix

## A.1 Decomposition of Allele Frequency Change

This decomposition of *neutral* allele frequency change between two consecutive generations is based on that of Santiago and Caballero (1995). We imagine a closed Wright–Fisher population of N diploids, where each diploid i contributes k_{i} ∼ Multinom(*f _{i}*/

*N*, 2N) gametes to the next generation. We assume the population size is constant, such that one diploid begets one diploid and thus 𝔼

_{i}(

*f*

_{i}) = 1. The neutral allele frequency in the next generation can be thought of as each of the N parents passing their average genotype

*xi*/2 (where x

_{i}∈ {0, 1, 2

*}*is the number of tracked neutral alleles individual

*i*carries) to their k

_{i}gametes, plus a random Mendelian deviation b

_{ij}∈ {0,

*−*1/2, 1/2} to each offspring

*j*. Then, the frequency in the next generation can be written as where b

_{ij}= δ

_{x,1}(1/2 B

_{j}), B

_{j}∼ Bernoulli(1/2) and δ

_{x,1}is an indicator function that is one when the individual i is a heterozygote (i.e. x

_{i}= 1), and zero otherwise.

If we further decompose the number of offspring of individual i into the genetic and non-genetic contributions, k_{i} = f_{i} + d_{i}, then
and the change of the neutral allele’s frequency is the difference Δp = *p*_{1} *− p*_{0} where . Then,

These d’s broadly capture non-genetic variation in an individual’s offspring number, with E[d_{i}] = 0. In a quantitative genetics framework Var_{i}(d_{i}) can include non-genetic variation in the lifetime reproductive success of individuals (V_{E}), in population genetic models Var_{i}(d_{i}) can accommodate the sampling of parents to form the next generation, e.g. multinomial sampling of individuals from fitnesses (Santiago and Caballero 1995). From now forwards, we assume that variation in these d’s is non-heritable. We note that in non-panmictic populations, chance covariances could be created between a neutral polymorphism and environmental component of their phenotype, especially as a population expands its range into new environments that affect the phenotype, and variants “surf” to higher frequencies (Edmonds et al. 2004; Excoffier and Ray 2008; Hallatschek and Nelson 2008).

Note that by construction, the allele frequency change components Δ_{N}*p*_{t} Δ_{M}*p*_{t}, and Δ_{H}*p*_{t} are orthogonal within each individual, given the neutral allele frequency x. Partitioning the allele frequency change for an individual i into its components,
where .

Two random variables X, Y are said to be uncorrelated if Cov(X, Y) = 𝔼(XY) 𝔼(X)𝔼(Y) = 0, and are orthogonal if either has an expected value of zero such that E(XY) = 0. We show briefly that taking expectations *over conceptual evolutionary replicates*, the terms are orthogonal. First, the terms x(f *−* 1) and xd are orthogonal (dropping i subscripts),
since across evolutionary replicates due to the assumption that population size is constant, and x f, as across all evolutionary replicates, there is no dependence between a particular neutral allele an individual carries and their fitness (though in particular replicates, such associations occur). Similarly, for the case x = 1 (other cases are all zero, and can be ignored), it can be shown using the law of total expectation that Cov(xd, ^{d}/2 M(d)) = 0 (and likewise with x(f 1) and ^{f}/2 M(f)). Note that across individuals within a population, there are weak covariances in their number of offspring as the total number of offspring must sum to N; under a Multinomial offspring distribution, these are of order 1/*N*.

## A.2 Temporal variance and autocovariance under multilocus selection

We assume the phenotype of an individual i has an additive polygenic basis, such that their phenotype is their breeding value deviates around a mean of zero, where *α*_{t,l} is the additive effect size at locus l in generation t, and g_{i,l} ∈ 0, 1, 2 is individual *i*’s allele count at this locus (note that effect of non-heritable environmental noise affecting the trait is accounted for in the d_{i} terms above). We impose directional selection on this trait using an exponential fitness function, such that individual *i*’s fitness is (assuming ). If we assume individuals’ phenotypic values do not deviate too far from their mean value of zero, we can approximate f_{i} as: . Then, we can write the change in neutral allele frequency due to only heritable variation in fitness (Δ_{H}*p*_{t}) as a covariance between fitness and the neutral allele frequency across individuals in generation *t*,
which is the is the Robertson-Price covariance.

Now, we break up the genotypic value x_{i} into the contributions of each of the two gametes that formed individual *i*, , and likewise with the trait locus where , and are all indicator variables. Expanding out the covariances, we have

Each of these covariances is between the neutral allele and a selected allele, either on the same gamete (either maternal or paternal) or across gametes. These covariances can be written as linkage disequilibrium terms,
where D_{L}^{′} is the linkage disequilibrium between alleles on the same gamete (the gametic LD), and the D_{l}^{′′} is the across-gamete LD (non-gametic LD); see Weir (1996), p. 121.

We ignore non-gametic linkage disequilibria D_{l}^{′′} as these are weak under random mating, and write the multilocus temporal covariance between the allele frequency changes Δ*p*_{t} and Δ*p*_{s} as
since 𝔼(Δ_{pt}) = 0.

### Modeling the dynamics of LD between selected and neutral sites

Here, we outline a model of the changes in linkage disequilibria between the focal neutral site and selected sites, which allows us to derive an expression for the first term in Equation (39). Typically, models of multilocus selection track the genetic changes in a population by transforming between a representation of haplotype frequencies to a representation of allele frequencies, linkage disequilibria, and higherorder linkage disequilibria (Barton and Turelli 1987, 1991; Turelli 1988; Turelli and Barton 1990). We for the moment avoid the difficulty of a full multilocus treatment by assuming that the linkage between selected sites is loose enough that one selected site’s frequency change is independent of the change at other selected sites, e.g. there is no selective interference; this was an assumption in past treatments (Santiago and Caballero 1995, 1998; see Barton 2000 for discussion of this). Specifically, we model the dynamics of the LD between the neutral site and each selected site as they would behave under a single sweep model.

We adapt Barton’s (2000) model for LD dynamics during a sweep. We imagine a polymorphic neutral locus has alleles B_{1} and B_{2} with frequencies p and 1 p. We partition the allele frequency of B_{1} by conditioning on which allele at the selected site (either A_{1} or A_{2}) is carried on the same background, e.g. P (B_{1} A_{1}), and P (B_{1} A_{2}), such that P (B_{1}) = P (B_{1} A_{1})P (A_{1}) + P (B_{1} A_{2})P (A_{2}). Then, the linkage disequilibrium between neutral and selected sites can be expressed as D = P (A_{1})P (A_{2})(P (B_{1}*|*A_{1}) *−* P (B_{1}*|*A_{2}))). To simplify notation, we denote the frequency of the neutral allele on the different fitness backgrounds at time *t* by P (B_{1}*|*A_{1}) = p^{(1)} and P (B_{1}*|*A_{2}) = p^{(2)} and the selected allele at locus l frequency as *p*_{t,l}, we have the LD between the focal neutral site and selected site l at time *t* is

Selection changes the frequency *p*_{t,l} through time, and recombination acts to disassociate the neutral allele with its backgrounds. The expected difference is maintained with probability (1–r_{l}) each generation (Barton 2000). If the initial generation is *t* and the future generation is s (s > t), and r_{l} is the recombination rate between the focal neutral locus and selected site *l*, this leads to

Then, we can use this to describe the dynamics of D_{s,l} to generation *t*,
(c.f. Stephan et al. 2006, equations (30) and (31)). Now, we can find the expected product 𝔼(D_{t,l}D_{s,l}) by multiplying both sides by D_{t,l} and taking expectations. We treat the allele frequency trajectory as deterministic, giving us,

Then, we simplify this by replacing with is the square of the correlation between the neutral site and selected site *l* at time *t*; Hill and Robertson 1968),

Returning to Equation (39) and replacing the 𝔼(D_{t,l}D_{s,l}) terms with our expression above,
again ignoring the cross-associations between selected sites. Dividing our temporal covariance by the neutral site’s *p*_{t}(1 – *p*_{t}), we can write the multilocus temporal covariance in a standardized form (analogous to Wright’s F),

We can approximate Equation (46) by noticing that the terms *α*_{t,l}*α*_{s,l}*p*_{s,l}(1 − *p*_{s,l}) are similar to an additive genic variation if effect sizes remain constant through time. We make that assumption here, writing *α*_{l}:= *α*_{t,l} = *α*_{s,l}, leading to

We can further simplify this by assuming that there is no covariance between the additive genic variation at a selected site, and the LD between that selected site and the neutral site. We write the additive genic variation at site l at time s as , and the average additive genic variation across loci as . Then, each locus’s additive genic variation can be expressed as: . Substituting this, the autocovariance is

We assume that this last term, which is non-zero in expectation only if there is covariance between the additive genic variation at a selected site and the expected LD between the selected and the neutral sites is zero. Rewriting the total genic variation as *V*_{a}(*s*),

### Continuous approximation to chromosomes

Currently, we have treated the positions of the selected sites are fixed, conditioning on knowing that a selected site l has a recombination fraction r_{l} away from the focal neutral site site. Here, we make a few further assumptions. First, we assume the L selected loci are each independently and identically uniformly distributed along a *continuous* region of R Morgans in length (g∼U(*R*/2, *R*/2)), and we now calculate the covariance at a focal neutral site at the origin by taking expectations over the random positions of these sites. Second, we assume that the LD between the neutral and selected site l only depends on the recombination fraction between the sites. Since g is the genetic distance, the recombination fraction is now provided by a mapping function *r(g)* that maps genetic distances to recombination fractions. Throughout the paper and in the simulations, we use Haldane’s mapping function, (note the absolute value translates positions on [−*R*/2, *R*/2] to distances to the focal neutral site). Next, we assume the LD between two sites can be completely determined by the distance between the focal neutral site and a random selected site, allowing us to rewrite as the function . Now, letting 𝔼_{rl} (⋅) represent the expectation taken over the random positions of selected sites on the genetic map,
since the 1/*L* cancels with the L from the sum of expectations.

As our trait is neutrally evolving before directional selection starts we use the expected neutral LD, 𝔼(*R*^{2}) = (10 + ρ)/(22 + 13ρ + ρ^{2}) where ρ = 4N*r(g)* (Hill and Robertson 1968; Ohta and Kimura 1969) when *t* is the first generation selection begins.

## A.3 Averaging covariance across multiple loci

Thus far, our covariance assumes that a single neutral site is positioned in the center of a region R Morgans long, with selected sites uniformly distributed along this region. In our simulations, however, we simulate a region that contains many neutral sites which we average over in calculating the temporal autocovariance. In this case, we average over the random distance between a neutral site’s position n and a selected site’s position g, which is c = |n – g|, where n, g ∼ U(0, R). This random variable c is distributed according to the triangle distribution, f(c) = 2(R c)/R^{2}; we replace the uniform PDF in Equation (50b) with the triangle density PDF and average over the distance between sites,
where 𝔼_{n}(⋅) indicates we take the expectation also over neutral sites, and we use *A*(R, t, s) to denote the average linkage disequilibrium between selected and neutral sites that persists from generations *t* to *s* (*t* ≤ *s*). Note that in calculating the standardized covariance above, we use a ratio of expectations rather than the expectation of the ratio (Bhatia et al. 2013).

## A.4 Empirically Calculating the Average LD Persisting Across Generations

In the previous expressions for temporal autocovariance, we stepped through a conceptual model for the average levels of linkage disequilibria between neutral and selected sites that persists across s *t* generations (*A*(R, t, s)), where the positions of selected and neutral sites are randomly distributed along a chromosomal region. In systems with a known recombination map and studies where linkage disequilibria can be calculated, we have the recombination fraction r_{i,j} and the pairwise linkage disequilibria between between two loci *i* and *j* (where **R**^{2} is the M *×* M matrix of pairwise LD calculated at time t). Since we do not *a priori* know whether a site is selected or not, so we sum over all polymorphic M loci, thus characterizing the average linkage disequilibria in a region as

This sum is the empirical analog to the integral in Equation (10).

## A.5 The Strength of Unlinked and Non-gametic Associations

Here, we characterize the contribution of completely genetically-unlinked loci segregating for fitness variation to the change in frequency of our neutral allele. Across evolutionary replicates, there is no expected covariance between the neutral allele an individual carries and their fitness (𝔼(Δ_{H} *p*_{t}) = 𝔼(Cov(x_{i}, *f*_{i})) = 0); rather, for unlinked loci, chance associations are created from the variance around this sampling process of neutral alleles into individuals with varying fitness (Var(Δ *p*_{t}) = Var(Cov(x_{i}, *f*_{i}))). As the neutral allele and fitness variation independently assort themselves into individuals, the chance associations that form have a variance given by Var(Cov_{i}(x_{i}, *f*_{i})). This has the form of the sampling variance of a covariance, which for random variables X and Y is given by Kendall et al. (1994, p. 472),
where µ_{X} and µ_{Y} are the means of X and Y respectively. Then, applying this to our covariance Δ *p*_{1} = Cov_{i}(x_{i}, *f*_{i}),

Thus the chance covariances that form between the neutral alleles individuals carry and their fitness have a variance proportional to ^{Var(fi)}/2*N*.

### Non-gametic linkage disequilibrium’s contribution to temporal autocovariance

Throughout the paper, we ignore the effects of non-gametic linkage disequilibria, , the disequilibria that occurs between the two gametes (maternal and paternal) at two loci (see Figure 8 (A) for an illustration of gametic LD D′ and non-gametic LD D^{′′}). Following Weir’s equation for the sampling variance of non-gametic LD D_{A/B} (p. 124, 1996), the chance non-gametic disequilibrium that builds up sampling 2N gametes into N individuals is,

Note the similar form to Equation (56) as both the unlinked and non-gametic LD arise from the random sampling of alleles at different loci into individuals.

There is no expected covariance between our gametic and non-gametic LD within a generation , assuming random mating. However, 0 for *s* > *t*, as a fraction of the non-gametic LD may be converted into gametic LD in the next generation. Specifically, following Santiago and Caballero (1995), we can write the product of the non-gametic LD in generation *t* with the gametic LD in generation s as
where a proportion r the non-gametic LD in generation *t* is converted into gametic LD, and a proportion (1 − r)^{(s−t−1)} of this is carried forward unbroken by recombination over the remaining s − *t* − 1 generations (see Figure 8B for an illustration of this process).

In our analysis in the main text, we ignore these terms as is expected to be small due to its inverse dependence on N. However, these terms are necessary for the analysis of looser linkage (Santiago and Caballero 1995, 1998).

## A.6 Connecting our model with the models of Robertson (1961) and Santiago and Caballero (1995, 1998)

Here, we describe the models of Santiago and Caballero (1995, 1998), relating their work on the long-run effective population size experienced by a neutral allele where there is (1) unlinked heritable fitness variation (their 1995 paper), or (2) linkage, where fitness-determining sites are randomly scattered along a chromosome (their 1998 paper). Overall, their models are formulated in a quantitative genetics tradition, where the population genetic dynamics at the selected loci are not explicitly modeled (although these links are made more explicitly in their ’98 paper). In contrast, in deriving our expressions for temporal autocovariance and variances, we use a population genetic approach, modeling the dynamics at selected sites (though we simplify from the full multilocus treatment, e.g. we assume selected loci experience independent sweeps and we ignore the LD between selected sites). We show that we can reconcile the two approaches, and demonstrate that the temporal autocovariance expressions we develop in our models are implicit in their model. We also work through their expressions for N_{e} with heritable variance, because it represents quite useful result but their original presentation was spread across two papers (and a change in notation).

### Santiago and Caballero’s 1995 and 1998 models for N_{e}

While our goal in the main text of our paper was to develop expressions for the temporal variances and autocovariances in allele frequency change when there is heritable fitness variation in the population, the goal of both the 1995 and 1998 Santiago and Caballero papers is to derive an expression for the long-run N_{e} when there is heritable variation for fitness in the population. In their 1995 paper, they find the effective population size for large *t* (see p. 1018, equation 16) to be
where C^{2} is the heritable variation for fitness (*V*_{a} in our notation), and V_{n} is the non-heritable variation in offspring number (i.e. under a Wright–Fisher model, V_{n} 2). For a neutral locus completely unlinked from fitness variation (the situation first considered by Robertson 1961), (Santiago and Caballero 1995, equation 17; note that we’ve simplified their expressions by assuming no assortative mating). Santiago and Caballero (1995) assume that continual artificial selection maintains a constant level C^{2} of fitness variation in the population each generation, yet the *particular* fitness backgrounds the neutral allele is stochastically associated only contributes a fraction G in the next generation, G^{2} in the generation after, and so on, as selection reduces genetic variation for fitness (note: in their 1998 paper, they use Z instead of G). Similarly, the associations between the neutral and fitness backgrounds decay at a rate 1/2 due to independent assortment. Note that Robertson (1961) assumed that the fitness backgrounds that become stochastically associated with the neutral allele do not experience any decay in their fitness variation (G = 1); in this case, Q = 2 as Robertson’s work found. With an arbitrary amount of linkage between the focal neutral and fitness backgrounds, Santiago and Caballero (1998) show that only Q is affected, and derive an expression for Q that only depends on G and the size of the genome in Morgans, L (equation 6, 1998).

In our main text, we model the temporal autocovariance created by heritable fitness variation, which also impacts the cumulative variance in allele frequency change Var(*p*_{t} *p*_{0}). To illustrate how our model connects with theirs, below is the cumulative variance in allele frequency change for three generations in their 1995 notation, with the corresponding changes in allele frequency below,

Grouping terms by the generation that the initial association was formed, we see how Santiago and Caballero (1995) define the Q_{i} terms in their notation,
since the associations created in generation i (0 < i ≤ t) persist with probability (1–r)^{t−i}, with proportion G^{t−i} of its original fitness variation in generation t. In general, the cumulative impact of the associations formed i generations ago has coefficient . Using these Q_{i} terms simplifies this equation to
or, in general,

Then, Santiago and Caballero (1995) note that assuming V_{n}, C^{2}, and population size *N* are constant across generations, the magnitude of all of the effects , and are constant across all generations (for all i, so we omit the i subscript for these terms), except for a geometric decay due to drift at a rate (1 – 1/2*N _{e}*) per generation that effects all terms. Such that, when we include the decay in the variance due to drift,
(cf. p. 1018 of Santiago and Caballero 1995). In the long run, the variance in the neutral allele’s frequency change hits a balance. Many copies of the neutral allele segregating in the population are on fitness backgrounds it has recently become stochastically associated with, as segregation and recombination have not broke these associations apart. A few copies of the neutral allele are on fitness backgrounds they became associated with many generations ago, that have by chance survived to remain associated. In all cases, the effect these associations have on present-day allele frequency change is weakened by the fact that natural selection has reduced the genetic variance of these fitness backgrounds. Since the long-run variance in allele frequency under drift in a Wright– Fisher population is

One can estimate the effective population size N_{e} using the observed difference in variances Var(*p*_{t}) and Var(*p*_{t1}). (Note that this is different a different long-run effective population size used by others, N_{e} = *p*_{0}(1 − *p*_{0})t/2 Var(*p*_{t} − *p*_{0}), Crow and Kimura 1970) Santiago and Caballero use Equation (66), taking the difference Var(*p*_{t}) Var(*p*_{t1}) and rearranging to end up with the large *t* estimator of N_{e},
(cf. p. 1018, Santiago and Caballero 1995). Rearranging,

This very conveniently simplifies the sum in Equation (65), as we can show with the case of *t* = 3,
or, generally,

Inserting this into Equation (68), the long-run effective population size can be written as
where Q_{∞} = 1 + 1/2 + 1/4 + … = 2 in Robertson’s (1961) model, and Q = 1/(1 G(1 r)) in Santiago and Caballero’s (1995) model. (Note: r here represents the recombination fraction between fitness variation and neutral sites, which differs from Santiago and Caballero (1995) equation 17, where r represents the correlation between parental fitness).

Then, Santiago and Caballero (1995) show,
(cf. Santiago and Caballero 1995, equation 11). Inserting these into Equation (70), we have
which is a simplified version of Santiago and Caballero’s equation 16, and which further simplifies to N_{e} = N when V_{n} = 2 and C^{2} = 0, the effective population size of a Wright–Fisher population of N hermaphroditic individuals.

### The covariances caused by fitness associations

With an understanding now of the basics of Santiago and Caballero’s (1995, 1998) models, how they connect to our notation, and how they reach their expression for the long-run effective population size, we turn now to finding the temporal autocovariances implicit in their model. We start by looking at the variance in allele frequency between generations 0 and 4 (Equation (61)), including an additional generation so the pattern is clearer later,

The cross-terms like 𝔼(D_{1}D_{2}), 𝔼(H_{1}D_{1}) and 𝔼(S_{1}S_{2}) are all expected products of independent random variables, where the expectation of each random variable is zero, and consequently are all zero. The only non-zero cross terms are products of . When we look at the covariances with the allele frequency change in the initial generation and a later generation s, Cov(Δ_{H}*p*_{1}, Δ_{H}*p*_{s}),
where the 1/2 coefficient comes from the fact that in Santiago and Caballero’s work, the products represent *both* the Cov(Δ_{H}*p*_{t}, Δ_{H}*p*_{s}) and Cov(Δ_{H}*p*_{s}, Δ_{H}*p*_{t}) terms, so a single temporal autocovariance in our notation is half their joint covariance term.

However, if our reference generation is different, say 2, the associations from earlier generations that have persisted to that generation can also lead to covariances to later generations. Looking at the covariances

Likewise, the covariances Cov(Δ_{H}*p*_{3}, Δ_{H}*p*_{s}) include the associations that persist from earlier generations. In general,

This expression is more complex than our expression for temporal autocovariance because its modeling the LD in generation *t* as it builds up from generations 1 to t. In contrast, our expressions for covariance incorporate all of this build up of LD as the initial LD term 𝔼(*R*_{t}) (for a single locus case). This expression for autocovariance implied by Santiago and Caballero’s (1995) work matches our expression for autocovariance (for a single locus) when the arbitrary first generation is *t* rather than 1

Using the expression for E(S^{2}_{t}) (equivalent to Var(Δ_{H}*p*_{t}) in our notation) derived in Appendix Section A.5,

This is analogous to Equation (8) for a single locus, where C^{2}G^{s−t} is the additive variation in generation s (equivalent to our *V*_{a}(*s*)), and the factor 1/2*N* represents the chance build up of LD between the neutral site and an unlinked fitness background. In our expression, we condition on existing linkage disequilibrium between the neutral site and its fitness background, whereas they assume a buildup of linkage disequilibria to a drift-recombination equilibrium. We can see this by returning to the Δ *p*_{4} term of Equation (61),
where following Santiago and Caballero’s (1995, p. 1018) approach, we can replace each 𝔼(S_{i}) with and let *G* = 1 as we focus on the buildup of LD. This gives us the general equation,
and taking this geometric series to infinity converges (since (1 − r)^{2}(1 − 1/2*N*) < 1) and replacing 𝔼(S^{2}) with the chance associations that build up gametes sampled into individuals (Equation (56)),

When we assume r *→* 0 and 1/N *→* 0 and Nr is a constant, this gives us
which is analogous to the 𝔼(*R*^{2}) measure of linkage disequilibrium, standardized to rescale the fitness variation. The right-hand side is identical to Sved’s identity by descent equilibrium 𝔼(*R*^{2}) under drift-recombination balance (1971). Note that our expression can be recovered from Equation (82) when the reference generation *t* → ∞ such that the LD hits its equilibrium level,
which is identical to our expression for temporal autocovariance when initial LD is due to a neutral drift-recombination balance, and the change in *V*_{a} during selection is modeled as a geometric decay at rate G. Note that the terms in underbraces indicate the corresponding terms in Equation (8) for a single locus.

## A.7 Multilocus simulation details

### Targeting an initial level of Additive Genetic Variation

We choose θ for the coalescent simulations to target a total number of segregating sites L + M, where L is the number of selected sites (a parameter we vary in our multilocus simulations), and at least M = 200 randomly placed neutral sites over which we can calculate the temporal autocovariance. Then, the total number of target sites M + L is then inflated by a factor of 1.5 to ensure a sufficient number of sites given the random mutation process. The L selected sites are randomly chosen from the segregating sites, and all remaining mutations are neutral. Thus, using Watterson’s expression for the expected number of segregating sites under the coalescent (1975), we have θ = 1.5(M + L)/(γ + log(2N)) where γ 0.577 is Euler’s Gamma. Each of the L selected sites is given a random effect size of with equal probability, where we choose by targeting a specific level additive genic variation where is the sum of site heterozygosity of the L neutrally evolving sites that will be selected once selection begins. Under neutrality, . Then, we set . We empirically validate that our target genic variation is close to the empirically observed level.

### Choosing the simulation parameter range

We simulate over a grid of parameter ranges, varying the number of loci L, the target additive genic variation *V*_{a} in the region (by varying *α*), and the recombination map length of the region R in Morgans. We have varied these parameters over ranges that encompass a wide range likely to be encountered in natural populations. To do this, we found that additive genetic variation for lifetime reproductive success varied over orders of magnitude, from 0 (e.g. in male red deer, Kruuk et al. (2000)) to 1.1 in male red-billed gull (Teplitsky et al. 2009). These values of additive genetic variation are for the entire genome (we write these as V_{A,GW}, where GW indicates genome-wide); our simulations model a region of varying map length. We expect most recombination map lengths to be roughly over the scale of 5 50 Morgans in length, and we chose to investigate how temporal autocovariance behaves across a spectrum of recombination, from a completed linked region (R = 0), to the scale over which a strong classic hardsweeps could affect diversity (0.5 centiMorgans) to a region where the ends are approximately unlinked (4.5 Morgans), overall giving us a parameter range of R 0, 0.005, 0.01, 0.05, 0.1, 0.5, 1.5, 4.5. Over this grid of our region recombination map lengths, and the total organism recombination map lengths, we get a rough estimate of the number of regions we would expect with this level of recombination in the organism’s total genome, imagining homogeneous recombination rate, by taking G/R. Using this estimate of the number of regions in the genome, we calculate the genetic variation per region over our grid of parameters as ^{VA,GW R}/*G*, and target a level of additive genic variation per region *V*_{a} equal to this regional additive genetic variation V_{A}. From preliminary simulations, we had found we can not detect much temporal autocovariance below *V*_{a} < 0.001 with the initial level of linkage disequilibrium from mutation-drift balance, so we ignore parameters less than this value (other than *V*_{a} = 0 as a control). Additionally, to reduce the number of simulations, we exclude *V*_{a} > 0.1 as this only excludes a small region of the parameter grid and preliminary simulations demonstrated the behavior of temporal autocovariance with high *V*_{a} is evident with the included values. Overall, this gives us a spectrum of target additive genic variation per region of *V*_{a} 0.001, 0.002, 0.005, 0.01, 0.02, 0.05, 0.08, 0.1. Note that to prevent our plots from being too dense, we include only a representative subset of this parameter grid in our figures.