{'fraction_non_alphanumeric': 0.04960902748513368, 'fraction_numerical': 0.018682399213372666, 'mean_word_length': 4.082698714897668, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Convergence of Likelihood Ratios and Estimators for Selection in non-neutral Wright-Fisher Diffusions

A number of discrete time, finite population size models in genetics describing the dynamics of allele frequencies are known to converge (subject to suitable scaling) to a diffusion process in the infinite population limit, termed the Wright-Fisher diffusion. In this article we show that the diffusion is ergodic uniformly in the selection and mutation parameters, and that the measures induced by the solution to the stochastic differential equation are uniformly locally asymptotically normal. Subsequently these two results are used to analyse the statistical properties of the Maximum Likelihood and Bayesian estimators for the selection parameter, when both selection and mutation are acting on the population. In particular, it is shown that these estimators are uniformly over compact sets consistent, display uniform in the selection parameter asymptotic normality and convergence of moments over compact sets, and are asymptotically efficient for a suitable class of loss functions.


Introduction
Mathematical population genetics is concerned with the study of how populations evolve over time, offering viable models to study how various biological phenomena such as selection and mutation affect the genetic profile of the population they act upon. Many models have been proposed over the years, but perhaps the most popular is the Wright-Fisher model (see for instance [12,Chapter 15,Section 2]).
Under a suitable scaling of both space and time, a diffusion limit exists for the Wright-Fisher model, which is referred to as the Wright-Fisher diffusion, (8), and is the main focus of this article. The Wright-Fisher diffusion is robust in the sense that a broad class of Cannings [2] models converge to it when suitably scaled. Furthermore, it has the neat property that the only contribution to the diffusion coefficient comes from random mating whilst other features such as selection and mutation appear solely in the drift coefficient. This facilitates inference as one can concentrate on estimating the drift, treating the diffusion coefficient as a known expression.
In this article we focus on a continuously observed Wright-Fisher diffusion describing the allele frequency dynamics in a two-allele, haploid population undergoing both selection and mutation. In Section 2 we start by considering a general scalar diffusion taking values in an arbitrary bounded interval [l, r] (with −∞ < l < r < ∞) whose boundary points are either regular or entrance. In this setting, we derive verifiable criteria to establish ϑ-uniform ergodicity (see Definition 2.1), and further extend these conditions to allow for ϑ-uniform ergodicity with respect to a specific class of unbounded functions. Subsequently we introduce the Wright-Fisher diffusion, and by making use of the previously derived criteria, we show that the diffusion is ergodic uniformly in both the selection and mutation parameters, and that the associated family of measures induced by the solution to the stochastic differential equation (SDE) is uniformly locally asymptotically normal (provided the mutation parameters are greater than 1). In Section 3 we then shift our focus onto the properties of the maximum likelihood (ML) and Bayesian estimators for the selection parameter s ∈ S ⊂ R (which measures how much more favourable one allele is over the other), under the assumption that the mutation parameters are a priori known. We briefly discuss some technical issues associated with conducting joint inference for the selection and mutation parameters in Remark 3.1.
We point out here that by observing the path continuously through time without error, one can establish and analyse explicitly the statistical error produced by an estimator based on the whole sample path, which then sets a benchmark for the statistical performance of alternative estimators based on less informative (e.g. discrete) observations. In a discrete observation setting, in addition to the above mentioned statistical error, one also has to deal with observational error. One certainly cannot hope for an estimator that performs better in a discrete setting than in a continuous one, so our analysis may be viewed as the 'best possible' performance for inference from a discretely observed model.
Inference for scalar diffusions, particularly proving consistency of estimators under specific observational schemes, has generated considerable interest over the past few years [6,13,16,17,18,21,22,24]. However, most of the work so far has considered classes of diffusions which directly preclude the Wright-Fisher diffusion, for instance by imposing periodic boundary conditions on the drift coefficients or by requiring the diffusion coefficient to be strictly positive everywhere. The asymptotic study of a variety of estimators for continuously observed ergodic scalar diffusions has been entertained in great depth in [13]; see in particular Theorems 2.8 and 2.13 in [13], which are respectively adaptations of Theorems I.5.1, I. 10.1 and I.5.2, I.10.2 in [9]. However Theorems 2.8 and 2.13 in [13] cannot be applied directly to the Wright-Fisher diffusion as certain conditions do not hold, namely the reciprocal of the diffusion coefficient does not have a polynomial majorant. This discrepancy makes replicating the results for the Wright-Fisher diffusion with selection and mutation highly non-trivial. Instead we exploit the explicit nature of (8), below, to prove, in our main result Theorem 3.2, uniform in the selection parameter over compact sets consistency, asymptotic normality and convergence of moments, as well as asymptotic efficiency for both the ML and Bayesian estimators. We achieve this by showing that the conditions of Theorems I.5.1, I. 10.1 and I.5.2, I.10.2 in [9] still hold for the Wright-Fisher diffusion and that this diffusion is ergodic uniformly in the selection and mutation parameters (a term we define in Section 2). Note that the uniformity in our results for the ML and Bayesian estimators is particularly useful as it controls the lowest rate (over the true parameters) at which the parameters of interest are being learned by the inferential scheme. We further highlight that the conditions derived in Theorem 2.2 provide a straightforward way to verify whether a positively recurrent diffusion on an arbitrary interval with regular or entrance boundaries is uniformly in the parameter ergodic, whilst Theorem 2.3 illustrates additional conditions necessary to extend this notion for a specific class of unbounded functions when the diffusion has solely entrance boundaries.
The Wright-Fisher diffusion with selection but without mutation was tackled specifically by Watterson in [24], where the author makes use of a frequentist framework. Having no mutation ensures that the diffusion is absorbed at either boundary point 0 or 1 in finite time almost surely, and by conditioning on absorption Watterson computes the moment generating function, proves asymptotic normality, and derives hypothesis tests based on the Maximum Likelihood Estimator (MLE). Watterson's work however does not address the Bayesian estimator, nor does it readily extend to the case when mutation is present because the diffusion is no longer absorbed at the boundaries. In this sense the results obtained in Theorem 3.2 are complementary to those obtained by Watterson under the assumption that the mutation parameters are known. Although this is a restriction, we are observing the path continuously over the interval [0, T ] and subsequently sending T → ∞, so these parameters could be inferred by considering the boundary behaviour of the diffusion. More precise details about this can be found in Remark 3.1 in Section 3, whilst a related argument applied to the squared Bessel process can be found in [19,Remark 2.2].
The rest of this article is organised as follows: in Section 2 we start by considering a general diffusion on a bounded interval with entrance or regular boundaries, and proceed to provide verifiable criteria which ensure that the diffusion is ϑ-uniformly ergodic in Theorem 2.2. We then proceed to extend this notion to a specific class of unbounded functions for diffusions with entrance boundaries in Theorem 2.3, before moving on to introduce the Wright-Fisher diffusion and proving that this diffusion is ergodic uniformly in both the selection and mutation parameters, as well as uniformly locally asymptotically normal by making use of the general results we derive. Section 3 then focuses on the ML and Bayesian estimators for the selection parameter, proving that these estimators have a set of desirable properties in Theorem 3.2. The results are then supported via numerical simulations in Section 4, whilst Section 5 concludes with a discussion. The proofs of Theorems 2.2 and 2.3 can be found in Appendices A and B respectively.

ϑ-uniform ergodicity for scalar diffusions
We start by considering an arbitrary fixed interval [l, r] on which we define the SDE where ν is an arbitrary initial distribution on [l, r], (W t ) t≥0 a standard Wiener process defined on a given filtered probability space, µ and σ are such that the SDE admits a unique strong solution which we denote by Y := (Y t ) t≥0 , −∞ < l < r < ∞ are both either entrance or regular boundaries for Y , and the observation interval is fixed to [0, T ]. We denote by P (ϑ) ν the law induced on the space of continuous functions mapping [0, T ] into [l, r] (henceforth denoted C T ([l, r])) by the solution to (1) when the true diffusion parameter is set to ϑ, and Y 0 ∼ ν (with dependence on T being implicit). Furthermore we denote taking expectation with respect to P Assume further that Y is positive recurrent, then using standard one-dimensional diffusion theory (see Theorem 1.16 in [13]), we get that the unique invariant density is given by In what follows, we denote taking expectation with respect to f Y ϑ by E (ϑ) , where the omission of the subscript will indicate that we start from stationarity, and henceforth always assume that ξ ∼ f Y ϑ .
In order to derive the results in Section 3, we will need a slightly stronger notion of ergodicity which we now define. The idea here is that we can extend pointwise ergodicity in the parameter ϑ to any compact set K ⊂ Θ by finding the slowest rate of convergence which works within that compact set. More rigorously, we introduce the following definition.
Definition 2.1. A process Y is said to be ergodic uniformly in the parameter ϑ (or ϑ-uniformly ergodic), if ∀ε > 0 we have that holds for any K compact subset of the parameter space, and for any function h : [l, r] → R bounded and measurable, where ξ ∼ f Y ϑ .
In the context of scalar diffusions defined on a bounded interval [l, r] with −∞ < l < r < ∞, where both boundaries are either regular or entrance we have the following theorem: Let Y be defined as above as the solution to (1), with boundary points l and r either entrance or regular, and that the expressions are bounded away from 0 on any compact set K ⊂ Θ, and any l < a < b < r. Then Y is ϑ-uniformly ergodic for any initial distribution ν.
We postpone the proof to Appendix A.
Note that the definition of ϑ-uniform ergodicity involves only bounded functions h, however the result above can be extended to a specific class of unbounded functions if one restricts their attention to diffusions on [l, r] where −∞ < l < r < ∞ are both entrance boundaries.
Theorem 2.3. Let Y be as in Theorem 2.2, and suppose that all the conditions stated there hold, but that both l and r are now entrance boundaries. Assume further that the function h is integrable with respect to the invariant density f Y ϑ but possibly unbounded, that for any l < a < b < r, sup y∈[a,b] h(y) < ∞, and that for any x < b the following hold for any compact set K ⊂ Θ, and T b := inf{t ≥ 0 : Y t = b}. Then (3) holds for the function h.
The proof can be found in Appendix B.
Remark 2.4. Note that the above conditions imply that h is only unbounded at the end points (because the supremum between a and b of h is finite for any l < a < b < r), which in particular ensures that all integrals of the form T 0 h(Y t )dt above are well-defined as both boundary points are unattainable (in view of them being entrance).

The Wright-Fisher diffusion
We now give a brief overview of the Wright-Fisher diffusion before showing that the diffusion is ergodic uniformly in the selection and mutation parameters, and subsequently use this to prove the uniform local asymptotic normality (LAN) of the family of measures associated to the solution of the SDE.
Consider an infinite haploid population undergoing selection and mutation, where we are interested in two alleles A 1 and A 2 . Suppose that ϑ = (s, θ 1 , θ 2 ) ∈ Θ = R × (0, ∞) 2 are the selection and mutation parameters respectively, where s describes the extent to which allele A 2 is favoured over A 1 , alleles of type A 1 mutate to A 2 at rate θ 1 /2, and those of type A 2 mutate to A 1 at rate θ 2 /2. Let X t denote the frequency of A 2 in the population at time t. Then the dynamics of X t can be described by a diffusion process on [0, 1], which, after expressing the parameters on an appropriate timescale, satisfies the SDE with X 0 ∼ ν for some initial distribution ν, and [0, T ] the observation interval. We point out that (8) with s = 0 is commonly referred to as the neutral Wright-Fisher diffusion, whilst s = 0 is known as the non-neutral case. A strong solution to (8) exists by the Yamada-Watanabe condition (see Theorem 3.2, Chapter IV in [10]), but weak uniqueness suffices for the results in Section 3. In abuse of notation, we redefine P (ϑ) ν to be the law induced on C T ([0, 1]) by the solution to (8) when the true diffusion parameters are ϑ = (s, θ 1 , θ 2 ), and X 0 ∼ ν, and similarly for the expectation with respect to P ν , and with respect to the stationary distribution, E (ϑ) (the existence of which we discuss below).
We assume that θ 1 , θ 2 > 0, for if at least one is 0 then the diffusion is absorbed in finite time and we are back in the regime studied by Watterson [24]. The boundary behaviour depends on whether the mutation parameters are either less than or greater or equal to 1, but in either case the diffusion is ergodic as long as θ 1 , θ 2 > 0 (see Lemma 2.1, Chapter 10 in [5]).
Substituting µ WF and σ WF into (2) and simplifying terms leads to the following density for the stationary distribution of the Wright-Fisher diffusion (8) where G ϑ is the normalising constant with the beta function. As above we will always assume that ξ ∼ f ϑ .
To the best of our knowledge, it has not been shown that the Wright-Fisher diffusion is ergodic uniformly in its parameters, which motivates the following corollary to Theorem 2.2.
Proof. We show that the conditions of Theorem 2.2 hold for the Wright-Fisher diffusion. Positive recurrence follows immediately from (10), whilst the existence of a unique strong solution is guaranteed by the Yamada-Watanabe condition. That the boundary points 0 and 1 are either entrance or regular is a consequence of the fact that the mutation parameters are assumed to be strictly positive (see (6.18) and (6.19) in [12,Chapter 15,Section 6]). It remains to show that both expressions in (4) are bounded away from 0 for any K ⊂ R × (0, ∞) 2 . To this end let which follows by observing that As the RHS of both (11) and (12) are bounded away from 0 on K, the result follows by applying Theorem 2.2.
For the remainder of this section we restrict our attention to the parameter space where Θ is open and bounded, for if either of the mutation parameters were less than 1 then the measures P (ϑ) ν within this region would be mutually singular with respect to one another and thus their Radon-Nikodym derivative undefined. Restricting our attention to mutation parameters within the range [1, ∞) 2 thus ensures that the family of measures {P (ϑ) ν , ϑ ∈ Θ} are equivalent, and we have that with P (ϑ) ν -probability 1, where we assume the initial distributions {ν(ϑ, ·)} ϑ∈Θ are mutually equivalent and admit a density with respect to some common dominating measure λ(·), which in abuse of notation we denote by ν(ϑ, ·). Proofs of the above claims regarding the equivalence of the Wright-Fisher diffusion and the form of the Radon-Nikodym derivative can be found in [3], Lemma 7.2.2 and Section 10.1.1. We emphasise here that we have allowed the starting distribution ν to depend on the parameters, as is evident from the first ratio in (13). However if there is no such dependence then this ratio is equal to 1 and our results still apply.
Furthermore, restricting to mutations greater than or equal to 1 ensures that the diffusion boundaries now become entrance (see equations (6.18) and (6.19) in [12, Chapter 15, Section 6]), and as done in Theorem 2.3, (3) can be extended for a particular class of unbounded functions. We focus on two such functions for this class of diffusions, as they turn out to be an essential ingredient necessary to prove local asymptotic normality.
Corollary 2.6. For the Wright-Fisher diffusion with mutation and selection parameters ϑ ∈ The result holds in particular for the case ν = f ϑ .
Proof. The result follows immediately if we show that all the conditions of Theorem 2.3 are satisfied for the above functions. The conditions of Theorem 2.2 have already been shown to hold in Corollary 2.5, whilst integrability with respect to the invariant density is guaranteed as we are considering mutation rates (θ 1 , θ 2 ) ∈ (1, ∞) 2 . That sup y∈[a,b] h(y) < ∞ for any pair 0 < a < b < 1 is immediate, so it remains to show (5), (6), and (7). Observe that so (5) holds as the RHS is continuous in ϑ and thus can be bounded from above in ϑ over any and thus (6) holds in view of condition (17). In the case when ν = f ϑ , we get that Finally, using the recursions in (47) and (48), we get that for x < b, and again the corresponding RHS can be bounded from above over any compact set K ⊂ Θ using continuity in ϑ, such that (7) holds and so the result follows by Theorem 2.3.
We end this section by introducing the concept of local asymptotic normality (LAN) and show that the Wright-Fisher diffusion is uniformly LAN, which will be essential in the next section. ν , ϑ ∈ Θ} is said to be locally asymptotically normal (LAN) at a point ϑ 0 ∈ Θ at rate T −1/2 if for any u ∈ R 3 , the likelihood ratio function admits the representation where ·, · denotes the Euclidean inner product on R 3 , and ∆ T (ϑ 0 , X T ) is a random variable such that with I(ϑ 0 ) the Fisher information matrix evaluated at ϑ 0 , i.e.
whereμ(ϑ, ξ) T is the transpose of the vector of derivatives of µ(ϑ, x) with respect to ϑ. Moreover, the function r T (ϑ 0 , u, X T ) satisfies The family of measures is said to be LAN on Θ if it is LAN at every point ϑ 0 ∈ Θ, and further it is said to be uniformly LAN on Θ if both convergence (14) and (15) are uniform in ϑ ∈ K for every compact K ⊂ Θ.
on any compact set K ⊂ Θ with C K > 0 constant, is uniformly LAN on Θ, with the likelihood ratio function Z T,ϑ (u) admitting the representation In particular the result holds for ν = f ϑ .
Proof. From (13), we have that the log-likelihood ratio is given by where we show that (15) holds. The first term goes to 0 as T → ∞ by (16), and in particular ν = f ϑ as given in (9) is continuous in ϑ. Thus we deduce that (15) follows if we can prove that for any Observe that the expression inside the probability in (19) is made up of six distinct differences between the averages of the six distinct entries of the Fisher information matrix with respect to time and the stationary density. Thus if we are able to show that each individual difference displays the same convergence as in (3), (19) follows. Now, as (8), we can apply Corollary 2.5 to the first four terms directly. The remaining two differences involve the unbounded functions (1 − x)x −1 and x(1 − x) −1 , for which (19) has been shown to hold in Corollary 2.6 with ν satisfying (17). Thus (15) holds (we also show in Corollary 2.6 that (17) holds in the case ν = f ϑ ), and (14) follows from Proposition 1.20 in [13] which we can invoke in view of the above proved (19) and the fact that We point out here that if the mutation parameters are known, condition (17) becomes redundant and Theorem 2.8 holds for any initial distribution satisfying lim ε→0 ν(s + ε, x)/ν(s, x) = 1 for any x ∈ [0, 1].

Properties of the ML & Bayesian Estimators for the Wright-Fisher diffusion
We henceforth assume that the mutation parameters θ 1 , θ 2 > 0 are known, and thus focus on conducting inference solely on the selection parameter s ∈ S ⊂ R with S open and bounded.
Remark 3.1. The continuous observation regime entertained here would enable one to infer the mutation parameters: on ϑ ∈ R × (0, 1) 2 this is immediate as the family of measures {P (ϑ) ν : ϑ ∈ R × (0, 1) 2 } are mutually singular. In particular, when either mutation parameter is less than 1, the diffusion hits the corresponding boundary in finite time almost surely, and as it does so, the diffusion coefficient (i.e. noise) vanishes sufficiently quickly allowing the mutation parameters to be inferred without error. Indeed, by looking at the integrands on the RHS of (18), we observe that as the path approaches either boundary, the likelihood ratio explodes. On ϑ ∈ R × [1, ∞) 2 the family of measures {P (ϑ) ν : ϑ ∈ R × [1, ∞) 2 } are now mutually absolutely continuous, with both boundary points unattainable. However, the process can get arbitrarily close to either boundary as T → ∞, and again the noise vanishes sufficiently quickly that the corresponding mutation parameters can be inferred to any required precision. In the case when one mutation parameter is less than 1 and the other is greater than or equal to 1, similar arguments apply.
Actually incorporating inference of the mutation parameter into the inferential setup below leads to some technical difficulties which we discuss in Section 5, so for simplicity we assume them to be known. Nonetheless all the notation introduced above and definitions carry through by replacing ϑ by s.
We start by defining the MLEŝ T of s in (8) aŝ where s 0 ∈ S is arbitrary and its only role is to specify a reference measure whose exact value does not matter. Observe that now (13) simplifies to with initial distributions {ν(s, ·)} s∈S admitting a density (which we denote ν(s, ·)) with respect to some common dominating measure λ(·). In order to be able to define the Bayesian estimator, we introduce the class W p of loss functions ℓ : S → R + for which the following stipulations are satisfied: A1. ℓ(·) is even, non-negative, and continuous at 0 with ℓ(0) = 0 but not identically zero.
A3. ℓ(·) has a polynomial majorant, i.e. there exist strictly positive constants A and b such that for any u ∈ S, A4. For any H > 0 sufficiently large and for sufficiently small γ, it holds that As remarked above, we assume that S is an open and bounded subset of R, and we denote by p(·) the prior density on S, which we assume belongs to where A and b are some strictly positive constants, andS denotes the closure of S. With p(·) ∈ P c and ℓ(·) ∈ W p , we define the Bayesian estimators T of s in (8) as where the minimization is over estimatorss T =s T (X T ). We introduce the last class of functions we will need, namely denote by G the class of functions satisfying the following two conditions: 1. For a fixed T > 0, g T (·) is a monotonically increasing function on [0, ∞), with g T (y) → ∞ as y → ∞.

For any
Observe that the likelihood ratio function is now given by and such that for any M ≥ 2 and u ∈ U T,s , and for any R > 0 and u, v ∈ U T,s with |u| < R, |v| < R for some constants C 1 , C 2 > 0, and λ(·) common dominating measure introduced below (21) (in particular these conditions hold for the case ν = f s , the stationary density). Thens T is uniformly over compact sets K ⊂ S consistent, i.e. for any ε > 0 it converges in distribution to a normal random variable and it displays moment convergence for any p > 0 where ζ ∼ N (0, 1), for any compact set K ⊂ S. Furthermore, if the loss function ℓ(·) ∈ W p , thens T is also asymptotically efficient, i.e.
As mentioned above, the proof relies on Theorems I.5.1, I.5.2, I.10.1, and I.10.2 in [9], which for reference we combine together in our notation into Theorem 3.3 below. Establishing that the conditions of Theorem 3.3 hold for the Wright-Fisher diffusion is non-trivial as the standard arguments found in [13] no longer hold, and will thus be the main focus of this section. The conclusions of Theorems I.5.1 and I.5.2 guarantee the uniform over compact sets consistency for the MLE and Bayesian estimator respectively, and also give that for any ε > 0 and for sufficiently large T sup s∈K P (s) with α, β strictly positive constants, and g T ∈ G . On the other hand, Theorems I.10.1 and I.10.2 provide the necessary conditions to deduce the uniform in s ∈ K asymptotic normality and convergence of moments for compact K ⊂ S, as well as asymptotic efficiency.  (8), with prior density p(·) ∈ P c , and loss function ℓ(·) ∈ W p . Suppose further that the following conditions are satisfied by the likelihood ratio function Z T,s (u) as defined in (22): 1. ∀K ⊂ S compact, we can find constants a and B, and functions g T (·) ∈ G (all of which depend on K) such that the following two conditions hold: • ∀R > 0, ∀u, v ∈ U T,s as defined in (23) satisfying |u| < R, |v| < R, and for some • ∀u ∈ U T,s sup s∈K E (s) ν Z T,s (u) 1 2 ≤ e −g T (|u|) .
2. The random functions Z T,s (u) have marginal distributions which converge uniformly in s ∈ K as T → ∞ to those of the random function Z s (u) ∈ C 0 (R), where C 0 (R) denotes the space of continuous functions on R vanishing at infinity, equipped with the supremum norm and the Borel σ-algebra.
3. The limit function Z s (u) attains its maximum at the unique pointû(s) = u with probability 1, and the random function du attains its minimum value at a unique pointũ(s) = u with probability 1.
Then we have thats T is: uniformly in s ∈ K consistent, i.e. for any ε > 0 the distributions of the random variablesū T = √ T (s T − s) converge uniformly in s ∈ K to the distribution ofū, and for any loss function ℓ ∈ W p uniformly in s ∈ K For the Bayesian estimator, the requirements for inequality (24) can be weakened as it suffices to show that (24) holds for m = 2 and any q > 0.
Proof of Theorem 3.2. Our aim will be to prove that Conditions 1, 2, and 3 in Theorem 3.3 hold for the Wright-Fisher diffusion, for then the ML and Bayesian estimator are uniformly on compact sets consistent. Below, Condition 1 is shown to hold in Propositions 3.5 and 3.6; Condition 2 is shown in Corollary 3.4; and Condition 3 is shown in Proposition 3.7.
It remains to show how uniform in s ∈ K asymptotic normality and convergence of moments, as well as asymptotic efficiency (under the right choice of loss function) follow. Given Conditions 1, 2, and 3 of Theorem 3.2, uniform in s ∈ K asymptotic normality follows immediately from Proposition 3.7;ū = I(s) −1 ∆(s), ∆(s) ∼ N (0, I(s)), andū T converges uniformly in distribution toū. Moreover, as stated in Remark I.5.1 in [9], the Ibragimov-Has'minskii conditions also give us a bound on the tails of the likelihood ratio, which can be translated into bounds on the tails of |û T | p for any p > 0 (see the display just below (2.27) in [13]). Similar bounds on the tails of |ũ T | p hold for the Bayesian estimator by Theorem I.5.7 in [9], and thus we have that the random variables |ū T | p are uniformly integrable for any p > 0, uniformly in s ∈ K for any compact K ⊂ S. Uniform convergence of the moments of the estimators follows from this and the uniform convergence in distribution (by applying a truncation argument).
For loss functions satisfying ℓ(·) ∈ W p , observe that the uniform convergence in (25) allows us to deduce that We proceed to show that Conditions 1, 2, and 3 in Theorem 3.3 hold for the Wright-Fisher diffusion. Theorem 2.8 gives us that the Wright-Fisher diffusion is uniformly LAN, which immediately gives the required marginal convergence of the Z T,s (u) in Condition 2.

Corollary 3.4. For any initial distribution satisfying
the random functions Z T,s (u) given by have marginal distributions which converge uniformly in s ∈ K as T → ∞ to those of the random function Z s (u) ∈ C 0 (R) given by Proof. The result follows immediately from the uniform LAN of the family of measures as shown in Theorem 2.8; see for illustration the display just before Lemma 2.10 in [13]. It is clear that Z s (u) vanishes at infinity and thus is an element of C 0 (R).
The next two results allow us to control the Hellinger distance of the likelihood ratio function as required by Condition 1 in Theorem 3.3.
Proposition 3.5. Let the initial distribution be such that for any R > 0 and for u, v ∈ U T,s as defined in (23) with |u| < R, |v| < R for some constant c > 0 with dominating measure λ(·) as specified below (21). Then for any K ⊂ S compact, we can find a constant C such that for any R > 0, and for any u, v ∈ U T,s as defined in (23) satisfying |u| < R, |v| < R, the following holds In particular the result holds for ν = f s .
Proof. In what follows we denote by C i , for i ∈ N, constants which do not depend on u, v, s, or T . Observe that for any s ′ , s * ∈ S it holds that and so we can use Lemma 1.13 and Remark 1.14 from [13] (as done in Lemma 2.10 there) to split the expectation in (24) into three where we denote s u = s + u/ √ T and s v = s + v/ √ T . The first term on the RHS of (27) can be dealt with using (26), whilst for the second term observe that A similar calculation can be performed for the third term in (27) to get and thus the result holds in view of the fact that |u|, |v| < R. It remains to show that (26) holds for ν = f s . To this end, observe that Now we have that where C 6 = B(θ 1 , θ 2 )e −diam(S) , C 7 = B(θ 1 , θ 2 )e diam(S) are non-zero, positive, and independent of s and T , since we constrain u, v ∈ U T,s . This allows us to deduce that G → 1/ √ G is Lipschitz on [C 6 inf s∈K min{e s , 1}, C 7 sup s∈K max{e s , 1}] with some constant C 8 > 0, i.e.
where in the second inequality we have made use of the fact that e z is Lipschitz in z on [−diam(S), diam(S)] with some constant C 9 > 0. Thus we deduce that Putting (29) into (28) gives us the result as C s := C 11 e |s| + C 12 max{e 3s , 1} + C 13 max{e 2s , 1} min{e s/2 , 1} , is continuous in s over any compact set K ⊂ S.
Proposition 3.6. Let the initial distribution be such that for any M ≥ 2 and for u ∈ U T,s , for some constant C > 0. Then for K ⊂ S compact, there exists a function g T (·) ∈ G such that for any u ∈ U T,s as defined in (23) we have that The result holds in particular when ν = f s .
Proof. Assume for now that for any M ≥ 2 we have that for some constant C s,M > 0 depending on s and M . We show that if (32) holds, then (31) follows. Indeed where in the first inequality we have made use of Cauchy-Schwarz, and for the second inequality we have used (32). Therefore, It remains to ensure that g T (·) ∈ G , that inf s∈K E (s) [ξ(1 − ξ)] ≥ κ > 0 for some constant κ, and that for any M ≥ 2 it holds that sup s∈K C s,M < ∞. Observe that min inf s∈K e s , 1 B(θ 1 , θ 2 ) ≤ G s ≤ max sup s∈K e s , 1 B(θ 1 , θ 2 ).
and κ > 0 because K is bounded, and thus both sup s∈K e s and inf s∈K e s are finite and non-zero. We show that sup s∈K C s,M is finite ∀M ≥ 2 in what follows. We now check that g T (|u|) as defined above is in the class of functions G . To this end, observe that Indeed, for a fixed T > 0, g T (|u|) → ∞ as |u| → ∞, because inf s∈K E (s) [ξ(1 − ξ)] > 0, and furthermore given any fixed N , we can choose M large enough (note the way we phrased (32) allows us to choose our M arbitrarily large, say M > 2N ) such that lim T →∞ y→∞ where the order in which limits are taken is immaterial since our choice of g T (|u|) is independent of T . Thus we have proved that if (32) holds, then To show that (32) holds, we make use of Markov's inequality as well as Theorem 3.2 in [14]. Indeed, observe that The bound for A 1 follows immediately from (30). For the particular case when ν = f s , we use Markov's inequality: where in the second inequality we made use of the fact that u ∈ U T,s , and thus |u| ≤ d s √ T where we define d s := sup w∈∂S |s − w| (which is strictly positive and bounded as S is open and bounded). To see that sup s∈K C (1) s,M is bounded, observe that which is clearly finite because K is bounded.
For A 2 we use a similar argument, but now use the fact that we have a stochastic integral: where the first line uses Markov's inequality and the second inequality uses Lemma 1.1 (equation (1.3)) in [13]. That sup s∈K C (2) s,M is finite follows from arguments similar to those used for the respective term in A 1 .
For A 3 we make use of Theorem 3.2 in [14], which gives us that for M ≥ 2 For the RHS of (33), we have that  Proof. The first assertion follows immediately from Corollary 3.4, whilst for the second we direct the interested reader to Theorem III.2.1 in [9], which relies on two results: Anderson's Lemma (Lemma II.10.1 in [9]), and Lemma II.10.2 in [9].

Numerical Simulations
We illustrate the results proved in Section 3 by showing consistency, convergence in distribution and convergence of moments for the MLE when applied to data simulated from the Wright-Fisher diffusion. By making use of the 'exact algorithm' (see [11] for full details), we obtain exact draws from the Wright-Fisher diffusion. The generated paths are then used to calculate the MLE, and subsequently kernel smoothed density estimates for the rescaled MLE for various terminal times T are plotted against the density of the limiting distribution. Using the definition in (20), the MLE for the selection parameter is given bŷ which is impossible to calculate exactly in view of the infinite-dimensional path involved in the integral. Instead we approximate the MLE by using Riemann sums instead of Lebesgue integrals, which gives rise to the approximation ofŝ T given by

Discussion
In this article we have provided criteria which determine whether a general diffusion defined over a bounded interval [l, r] with either boundary point being either entrance or regular is ϑ-uniformly ergodic (Theorem 2.2), together with a set of additional conditions which allow for an extension of the result to a specific class of unbounded functions for diffusions possessing solely entrance boundaries (Theorem 2.3). Using the criteria in Theorem 2.2, we have shown in Corollary 2.5 that the Wright-Fisher diffusion is ϑ-uniformly ergodic for ϑ = (s, θ 1 , θ 2 ) ∈ Θ ⊂ R × (0, ∞) 2 , extending the well-known pointwise in ϑ = (s, θ 1 , θ 2 ) ergodicity of the Wright-Fisher diffusion over any compact set K ⊂ R × (0, ∞) 2 for bounded functions. We have also proved that the family of measures {P In Section 3 we then considered inference for the selection parameter s when the diffusion is observed continuously through time and the mutation rates are known. Under these assumptions, we proved that the ML and Bayesian estimators for s ∈ S (S an open bounded subset of R) in the non-neutral Wright-Fisher diffusion started from a broad class of initial distributions which includes its stationary distribution, are uniformly over compact sets consistent and display uniform in s ∈ K asymptotic normality and convergence of moments, for any compact K ⊂ S. Furthermore, for the right choice of loss function we also have asymptotic efficiency of the two estimators. The uniformity in these results is particularly useful as it guarantees a lower bound on the rate at which the inferential parameters are being learned. Such properties have been shown to hold for a wide class of SDEs in [13] by making use of the general theorems of Ibragimov and Has'minskii (Theorems I.5.1, I.5.2, I.10.1 and I.10.2 in [9]), however they do not hold for the Wright-Fisher diffusion as they require the diffusion coefficient to be non-zero everywhere and to have an inverse that has a polynomial majorant. Both conditions fail for (8), forcing us to find an alternative way of proving that the Ibragimov-Has'minskii conditions still hold. We emphasise here that the aim of this study is to investigate the properties of the estimators in the "ideal" continuous observation scenario when the whole path is known to the observer.
Assuming that the mutation rates are known is a limitation to this study, however we emphasise that in the regime considered here these can be inferred directly from the path once the diffusion gets arbitrarily close to either boundary (see Remark 3.1 for the corresponding details). Nonetheless, extending this work to include mutation parameters greater than 1 would be of great interest. This proves to be rather challenging as now the likelihood ratio function involves expressions of the form (1 − x)x −1 and x(1 − x) −1 (as witnessed in Theorem 2.8) which require much more delicate arguments in order to establish the same conclusions as in Theorem 3.2. The main issue here is in showing that Condition 1 in the Ibragimov-Has'minskii conditions holds, for the other two conditions follow from Theorem 2.8 and Proposition 3.7. In particular, the fact that the functions (1 − x)x −1 and x(1 − x) −1 are unbounded in x and have only finitely many moments with respect to the stationary distribution means that the strategies used in the proofs of Propositions 3.5 and 3.6 cannot be used.
Recent advances in genome sequencing technology have led to an increase in the availability and analysis of genetic time series data. Inference for selection has traditionally been conducted using techniques for and data coming from a single point in time. However, having a time series of data points allows one to track the changes in allele frequencies over time, to better understand and infer the presence and effect of selection. Several inferential techniques have already been developed for such a setting (see for instance [1,15,20,8,7], as well as [4] for a review on the subject), and although the techniques provide ostensibly reasonable estimation, there are not always theoretical guarantees on the statistical properties of the estimators being used. The results presented in this paper offer a baseline in this regard, and prove that in the absence of observational error one is guaranteed that the ML and Bayesian estimators are uniform over compact sets consistent, asymptotically normal, and display moment convergence, besides being asymptotically efficient for the right choice of loss function.

Acknowledgements
This work was supported by the EPSRC and the MASDOC DTC (under grant EP/HO23364/1), by The Alan Turing Institute under the EPSRC grant EP/N510129/1, and by the EPSRC under grant EP/R044732/1.

A Proof of Theorem 2.2
Proof. We show ϑ-uniform ergodicity for scalar diffusions on the bounded interval [l, r] having entrance or regular boundary points by making use of Theorem 3.2 in [14], which allows us to bound the LHS of (3) in terms of the moments of the hitting times of the process. That result requires the diffusion coefficient to be positive everywhere, and the drift and diffusion coefficients to be locally Lipschitz and to satisfy a linear growth condition. These conditions however, are only used to guarantee the existence of a unique strong non-exploding solution to the SDE in Theorem 3.2, which we are guaranteeing explicitly in the statement of the theorem. None of these requirements on the drift and diffusion coefficients are used in the proof of Theorem 3.2 in [14] when p ∈ {2, 3, . . . }, which allows us to employ this theorem for such p. All that remains to prove then is that these moments can be bounded in ϑ over compact sets in the parameter space, for then (3) holds. To this end, we introduce some notation from [14], namely let a, b ∈ (l, r) be arbitrary fixed points such that a < b. Define S 0 = 0, R 0 = 0, and for n ∈ N. By the strong Markov property, (R k − R k−1 ) k∈N\{0} is an i.i.d. sequence with law under P whilst for x > b we have that

B Proof of Theorem 2.3
Proof. Recall the notation introduced in Appendix A, namely the regeneration times {S n , R n } ∞ n=0 and the number of upcrossings up to time t, {N t } t≥0 . We want to prove that lim T →∞ sup ϑ∈K P (ϑ) holds for any compact set K ⊂ Θ, with h as defined in the statement of the theorem. The strategy here will be to decompose the sample path of the diffusion into i.i.d. blocks of excursions as done in Theorem 3.5 in [14]. However, we will deal with the resulting expectations in a different way, namely by applying the ODE approach used in Appendix A to bound these quantities from above in ϑ over a compact set K. To this end, fix ε ∈ (0, E (ϑ) [h(ξ)]) and choose δ ∈ (0, 1) such that ε = δE (ϑ) [h(ξ)], and set Ω T : Then as in the proof of Theorem 3.5 in [14], we get the following decomposition Dealing with E and D can be achieved as in equations (3.10) and (3.14) in [14], to deduce that E = 0 and for C 1 the constant from the Burkholder-Davis-Gundy inequality. All the above expressions are either constant or have been shown to be bounded in ϑ over compact sets in the parameter space in Appendix A, so it remains to deal with terms A, B and C above.
Applying Markov's inequality to A gives and we can decompose the above integral So it remains to prove that the first term on the RHS can be bounded in ϑ. It turns out that B and C can be bounded by similar quantities, so we do this first and subsequently show that the resulting quantities can be bounded in ϑ too. 4 2 ⌊ℓ ϑ (1 + δ/4)⌋ T ε 2 2 E (ϑ) The second term of (45) can be bounded in the same way as in (44), whilst for the first term we can use a similar decomposition to get Finally, for C we use the same arguments as in [14] (just before equation (3.13)) to get that and we can apply the same reasoning as in (46). It remains to show that the terms can be bounded in ϑ. The same arguments used to derive the ODEs in Appendix A can be used here to derive an ODE for U n (x) := E (ϑ) x [( Now for n = 1, we get that for x < b, which is bounded over any compact set K ⊂ Θ by (5). In view of condition (7), we get that E 0 h(Y t )dt] is also bounded from above in ϑ over compact sets K ⊂ Θ, and finally, using the recursions in (47) and (48), we get that for x < b, which is bounded from above in ϑ over a given compact set K ⊂ Θ by (6), giving the required bounds for the quantities A, B, and C. Combining these with the bounds for D and E we conclude that (43) holds.