Exact simulation of the sample paths of a diffusion with a finite entrance boundary Paul A. Jenkins Departments of Statistics University of Warwick Dynstoch, University of Warwick 11 Sep 2014 Joint work with Dario Spanò 0 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Outline 1 Introduction 2 Overview of the exact algorithm 3 Bessel-EA 4 Wright-Fisher diffusion 5 Summary 0 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Diffusion model The time-evolution of a genetic variant, or allele, is well approximated by a diffusion process on the interval [0, 1]. 1 Allele frequency 0 Time 2 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Diffusion model The time-evolution of a genetic variant, or allele, is well approximated by a diffusion process on the interval [0, 1]. 1 Allele frequency 0 Time Wright-Fisher SDE dXt = µθ (Xt )dt + p Xt (1 − Xt )dWt , X0 = x, t ≥ 0. The infinitesimal drift, µθ (x), encapsulates directional forces such as natural selection, migration, mutation, . . . 2 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Population genetic Motivation I: Demographic inference Given a sample of DNA sequences obtained in the present-day, what can we infer about the demographic history of the population? Example (Gutenkunst et al., 2009) Expansion out-of-Africa Demography from Multid Settlement of the New World 3 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Population genetic Motivation II: Time-series analysis of selection Given a sample of genetic data obtained over several generations, what can we infer about the strength of natural selection? Example (Biston betulaeria; Mathieson & McVean, 2013) Figure 5 Biston be sites. The gray grid s national grid referen lighted squares indi ered for our anal sample sites. Red tr observations in five o sites outside the red tion coefficients for grid square represen generations runs alo from 1953 to 2002 the y-axis in each de are observations, c a deme for each ye paths from the fina tion. The backgroun resents the MLEs of which are given in th deme. We assumed and complete domi dicate points of high well 1958). If these ij the ^s in these de and 20.10. The squares each have o 4 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Inference from diffusion processes Like many interesting diffusions, the transition function of the Wright-Fisher diffusion is unknown. 5 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Inference from diffusion processes Like many interesting diffusions, the transition function of the Wright-Fisher diffusion is unknown. Inference typically proceeds by 1 Model-discretization such as an Euler approximation: Xt+dt | (Xt = z) ∼ N (µθ (z)dt, σ 2 (z)dt), 2 . . . followed by (sequential) Monte Carlo simulation (or numerical solution of Kolmogorov PDEs, or spectral expansions, . . . ) 5 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Inference from diffusion processes Like many interesting diffusions, the transition function of the Wright-Fisher diffusion is unknown. Inference typically proceeds by 1 Model-discretization such as an Euler approximation: Xt+dt | (Xt = z) ∼ N (µθ (z)dt, σ 2 (z)dt), 2 . . . followed by (sequential) Monte Carlo simulation (or numerical solution of Kolmogorov PDEs, or spectral expansions, . . . ) But—discretization introduces a bias we would like to remove. 5 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Inference from diffusion processes Like many interesting diffusions, the transition function of the Wright-Fisher diffusion is unknown. Inference typically proceeds by 1 Model-discretization such as an Euler approximation: Xt+dt | (Xt = z) ∼ N (µθ (z)dt, σ 2 (z)dt), 2 . . . followed by (sequential) Monte Carlo simulation (or numerical solution of Kolmogorov PDEs, or spectral expansions, . . . ) But—discretization introduces a bias we would like to remove. 5 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Inference from diffusion processes Like many interesting diffusions, the transition function of the Wright-Fisher diffusion is unknown. Inference typically proceeds by 1 Model-discretization such as an Euler approximation: Xt+dt | (Xt = z) ∼ N (µθ (z)dt, σ 2 (z)dt), 2 . . . followed by (sequential) Monte Carlo simulation (or numerical solution of Kolmogorov PDEs, or spectral expansions, . . . ) But—discretization introduces a bias we would like to remove. Three sentence summary There exist so-called exact algorithms for simulating diffusions without discretization error, even if the transition density is unknown. They can perform poorly when there are entrance boundaries. I will outline how to fix these problems. 5 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Outline 1 Introduction 2 Overview of the exact algorithm 3 Bessel-EA 4 Wright-Fisher diffusion 5 Summary 8 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Exact algorithm (EA)—one-dimensional bridge version Goal: return exact bridge samples from the one-dimensional diffusion X = (Xt : t ≥ 0) on R satisfying dXt = µθ (Xt )dt + σ(Xt )dWt , X0 = x, 0 ≤ t ≤ T. 9 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Exact algorithm (EA)—one-dimensional bridge version Goal: return exact bridge samples from the one-dimensional diffusion X = (Xt : t ≥ 0) on R satisfying dXt = µθ (Xt )dt + σ(Xt )dWt , 1 X0 = x, 0 ≤ t ≤ T. Reduce the problem to unit diffusion coefficient via the Lamperti transform Xt 7→ Yt : Z Xt 1 Yt := du, σ(u) so now we work with dYt = αθ (Yt )dt + dWt , Y0 = y , 0 ≤ t ≤ T. 9 / 38 Introduction Exact algorithm Bessel-EA dYt = αθ (Yt )dt + dBt , Wright-Fisher diffusion Y0 = y , Summary 0 ≤ t ≤ T. Exact algorithm (EA) 2 Now we can consider a rejection algorithm using Brownian bridge paths as candidates. If Qy is the target law (of Y ) and Wy is the law of a Brownian motion then we need dQy (Y ) dWy to provide the rejection probability 10 / 38 Introduction Exact algorithm Bessel-EA dYt = αθ (Yt )dt + dBt , Wright-Fisher diffusion Y0 = y , Summary 0 ≤ t ≤ T. Exact algorithm (EA) 2 Now we can consider a rejection algorithm using Brownian bridge paths as candidates. If Qy is the target law (of Y ) and Wy is the law of a Brownian motion then we need (Z ) Z T dQy 1 T 2 αθ (Yt )dYt − α (Yt )dt (Y ) = exp 2 0 θ dWy 0 to provide the rejection probability, by the Girsanov theorem. 10 / 38 Introduction Exact algorithm Bessel-EA dYt = αθ (Yt )dt + dBt , Wright-Fisher diffusion Y0 = y , Summary 0 ≤ t ≤ T. Exact algorithm (EA) 2 Now we can consider a rejection algorithm using Brownian bridge paths as candidates. If Qy is the target law (of Y ) and Wy is the law of a Brownian motion then we need (Z ) Z T dQy 1 T 2 αθ (Yt )dYt − α (Yt )dt (Y ) = exp 2 0 θ dWy 0 to provide the rejection probability, by the Girsanov theorem. Such a rejection algorithm is impossible: it requires simulation of complete (infinite-dimensional) Brownian sample paths! 10 / 38 Introduction Exact algorithm Bessel-EA dYt = αθ (Yt )dt + dBt , Wright-Fisher diffusion Y0 = y , Summary 0 ≤ t ≤ T. Exact algorithm (EA) 3 Key observation: The Radon-Nikodým derivative can be put in the form ( Z ) T dQy (Y ) ∝ exp − φ(Ys )ds ≤ 1, dWy 0 where φ(·) := 12 [αθ2 (·) + αθ0 (·)] + C. 11 / 38 Introduction Exact algorithm Bessel-EA dYt = αθ (Yt )dt + dBt , Wright-Fisher diffusion Y0 = y , Summary 0 ≤ t ≤ T. Exact algorithm (EA) 3 Key observation: The Radon-Nikodým derivative can be put in the form ( Z ) T dQy (Y ) ∝ exp − φ(Ys )ds ≤ 1, dWy 0 where φ(·) := 12 [αθ2 (·) + αθ0 (·)] + C. Assume we can arrange for φ ≥ 0. Then the right-hand side is the probability that a Poisson point process of unit rate on [0, T ] × [0, ∞) has no points under the graph of t 7→ φ(Ys ). 11 / 38 Introduction Exact algorithm dQy dWy (Y ) Bessel-EA Summary n R o T ∝ exp − 0 φ(Ys )ds ≤ 1. Exact algorithm (EA) 4 Wright-Fisher diffusion φ(Yt) A proposed Brownian path should be rejected if a simulated Poisson point process has any points under its graph. 0 0 t T 12 / 38 Introduction Exact algorithm dQy dWy (Y ) Bessel-EA Summary n R o T ∝ exp − 0 φ(Ys )ds ≤ 1. Exact algorithm (EA) 4 Wright-Fisher diffusion φ(Yt) A proposed Brownian path should be rejected if a simulated Poisson point process has any points under its graph. 0 0 t T 12 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Retrospective sampling Exact algorithm (EA) for simulating a bridge from Y0 to YT 1 Simulate a Brownian bridge (Yt )0≤t≤T from Y0 to YT . 13 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Retrospective sampling Exact algorithm (EA) for simulating a bridge from Y0 to YT 1 Simulate a Brownian bridge (Yt )0≤t≤T from Y0 to YT . 2 Simulate a Poisson point process of unit rate on [0, T ] × [0, ∞). 13 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Retrospective sampling Exact algorithm (EA) for simulating a bridge from Y0 to YT 1 Simulate a Brownian bridge (Yt )0≤t≤T from Y0 to YT . 2 Simulate a Poisson point process of unit rate on [0, T ] × [0, ∞). 3 Accept if all points are in the epigraph of t 7→ φ(Yt ), otherwise return to 1. 13 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Retrospective sampling Exact algorithm (EA) for simulating a bridge from Y0 to YT 1 Simulate a Brownian bridge (Yt )0≤t≤T from Y0 to YT . 2 Simulate a Poisson point process of unit rate on [0, T ] × [0, ∞). 3 Accept if all points are in the epigraph of t 7→ φ(Yt ), otherwise return to 1. Problems 1 We still need an infinite-dimensional Brownian path. 2 The Poisson point process has unbounded intensity. 13 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Retrospective sampling Exact algorithm (EA) for simulating a bridge from Y0 to YT 1 Simulate a Brownian bridge (Yt )0≤t≤T from Y0 to YT . 2 Simulate a Poisson point process of unit rate on [0, T ] × [0, ∞). 3 Accept if all points are in the epigraph of t 7→ φ(Yt ), otherwise return to 1. Problems 1 We still need an infinite-dimensional Brownian path. 2 The Poisson point process has unbounded intensity. Solutions 1 Exploit retrospective sampling; switch the order of simulation! 13 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Retrospective sampling Exact algorithm (EA) for simulating a bridge from Y0 to YT 1 Simulate a Brownian bridge (Yt )0≤t≤T from Y0 to YT . 2 Simulate a Poisson point process of unit rate on [0, T ] × [0, ∞). 3 Accept if all points are in the epigraph of t 7→ φ(Yt ), otherwise return to 1. Problems 1 We still need an infinite-dimensional Brownian path. 2 The Poisson point process has unbounded intensity. Solutions 1 Exploit retrospective sampling; switch the order of simulation! 13 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Retrospective sampling Exact algorithm (EA) for simulating a bridge from Y0 to YT 1 Simulate a Poisson point process of unit rate on [0, T ] × [0, ∞). 2 Simulate the Brownian bridge at the times of the Poisson points. 3 Accept if all points are in the epigraph of t 7→ φ(Yt ), otherwise return to 1. Problems 1 We still need an infinite-dimensional Brownian path. 2 The Poisson point process has unbounded intensity. Solutions 1 Exploit retrospective sampling; switch the order of simulation! 13 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Retrospective sampling Exact algorithm (EA) for simulating a bridge from Y0 to YT 1 Simulate a Poisson point process of unit rate on [0, T ] × [0, ∞). 2 Simulate the Brownian bridge at the times of the Poisson points. 3 Accept if all points are in the epigraph of t 7→ φ(Yt ), otherwise return to 1. Problems 1 We still need an infinite-dimensional Brownian path. 2 The Poisson point process has unbounded intensity. Solutions 1 Exploit retrospective sampling; switch the order of simulation! 2 Assume φ is bounded, φ ≤ K (for now), and use Poisson thinning (“EA1”). 13 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Exact algorithm (EA1); Beskos & Roberts (2005) K φ(Yt) 0 0 t T 14 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Exact algorithm (EA1); Beskos & Roberts (2005) 1 Simulate a Poisson point process on [0, T ] × [0, K ]. K φ(Yt) 0 0 t T 14 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Exact algorithm (EA1); Beskos & Roberts (2005) 1 Simulate a Poisson point process on [0, T ] × [0, K ]. 2 Simulate the Brownian bridge at the times of the Poisson points. K φ(Yt) 0 0 t T 14 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Exact algorithm (EA1); Beskos & Roberts (2005) 1 Simulate a Poisson point process on [0, T ] × [0, K ]. 2 Simulate the Brownian bridge at the times of the Poisson points. 3 If any of the former are beneath any of the latter, return to 1. K φ(Yt) 0 0 t T 14 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Exact algorithm (EA) Output of the algorithm is a set of skeleton points of the bridge. Any further points can be filled in by further draws from the Brownian bridge—no further reference to the target law, Qy , is necessary! 15 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Exact algorithm (EA) Output of the algorithm is a set of skeleton points of the bridge. Any further points can be filled in by further draws from the Brownian bridge—no further reference to the target law, Qy , is necessary! φ(·) = 1 2 [α (·) + αθ0 (·)] + C. 2 θ This function φ is important. The assumption φ ≤ K is restrictive, but it can in fact be relaxed (“EA2”, Beskos et al., 2006). 15 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Exact algorithm (EA) Output of the algorithm is a set of skeleton points of the bridge. Any further points can be filled in by further draws from the Brownian bridge—no further reference to the target law, Qy , is necessary! φ(·) = 1 2 [α (·) + αθ0 (·)] + C. 2 θ This function φ is important. The assumption φ ≤ K is restrictive, but it can in fact be relaxed (“EA2”, Beskos et al., 2006). 15 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Exact algorithm (EA) Output of the algorithm is a set of skeleton points of the bridge. Any further points can be filled in by further draws from the Brownian bridge—no further reference to the target law, Qy , is necessary! φ(·) = 1 2 [α (·) + αθ0 (·)] + C. 2 θ This function φ is important. The assumption φ ≤ K is restrictive, but it can in fact be relaxed (“EA2”, Beskos et al., 2006). There have been many further refinements to this algorithm (multidimensions, jumps, killing, reflection, . . . ): Beskos et al. (2006, 2008, 2012), Casella & Roberts (2008, 2011), Chen & Huang (2013), Étoré & Martinez (2013), Giesecke & Smelov (2013), Gonçalves & Roberts (2013), Mousavi & Glynn (2013), Blanchet & Murthy (2014), Pollock et al. (2014). 15 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Efficiency The exact algorithm will be less efficient wherever φ(Xt ) is very large—unavoidable when the diffusion travels through a region where the drift (or its derivative) is very large. 18 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Efficiency The exact algorithm will be less efficient wherever φ(Xt ) is very large—unavoidable when the diffusion travels through a region where the drift (or its derivative) is very large. Example: Entrance boundary at 0 “A diffusion at x will almost surely not hit 0 before hitting any b > x. A diffusion started at 0 will enter (0, ∞) in finite time.” If σ 2 (x) = 1, then φ explodes at the boundary. 18 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Efficiency The exact algorithm will be less efficient wherever φ(Xt ) is very large—unavoidable when the diffusion travels through a region where the drift (or its derivative) is very large. Example: Entrance boundary at 0 “A diffusion at x will almost surely not hit 0 before hitting any b > x. A diffusion started at 0 will enter (0, ∞) in finite time.” If σ 2 (x) = 1, then φ explodes at the boundary. φ(u) 0 0 1 2 u 3 4 5 18 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Efficiency The exact algorithm will be less efficient wherever φ(Xt ) is very large—unavoidable when the diffusion travels through a region where the drift (or its derivative) is very large. Example: Entrance boundary at 0 “A diffusion at x will almost surely not hit 0 before hitting any b > x. A diffusion started at 0 will enter (0, ∞) in finite time.” If σ 2 (x) = 1, then φ explodes at the boundary. φ(u) 0 0 1 2 u 3 4 5 18 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Large φ is a symptom of a poor likelihood ratio, i.e. Brownian motion is a poor mimic of the target diffusion. 19 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Large φ is a symptom of a poor likelihood ratio, i.e. Brownian motion is a poor mimic of the target diffusion. Idea: Replace Brownian motion with a different candidate process—one with an entrance boundary. 19 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Large φ is a symptom of a poor likelihood ratio, i.e. Brownian motion is a poor mimic of the target diffusion. Idea: Replace Brownian motion with a different candidate process—one with an entrance boundary. But: the exact algorithms rely heavily on our knowledge about Brownian bridges: The distribution of bridge coordinates. The distribution of the minimum, mT , and its time, tm . The distribution of bridge coordinates conditioned on (mT , tm ). The ability to sample from these distributions exactly. 19 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Large φ is a symptom of a poor likelihood ratio, i.e. Brownian motion is a poor mimic of the target diffusion. Idea: Replace Brownian motion with a different candidate process—one with an entrance boundary. But: the exact algorithms rely heavily on our knowledge about Brownian bridges: The distribution of bridge coordinates. The distribution of the minimum, mT , and its time, tm . The distribution of bridge coordinates conditioned on (mT , tm ). The ability to sample from these distributions exactly. 19 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Large φ is a symptom of a poor likelihood ratio, i.e. Brownian motion is a poor mimic of the target diffusion. Idea: Replace Brownian motion with a different candidate process—one with an entrance boundary. But: the exact algorithms rely heavily on our knowledge about Brownian bridges: The distribution of bridge coordinates. The distribution of the minimum, mT , and its time, tm . The distribution of bridge coordinates conditioned on (mT , tm ). The ability to sample from these distributions exactly. Question. Does there exist a diffusion: with infinitesimal variance equal to 1, with an entrance boundary, and such that the finite-dimensional distributions of its bridges are known, and which can be simulated exactly, and (bonus) whose extrema are well characterized? 19 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Outline 1 Introduction 2 Overview of the exact algorithm 3 Bessel-EA 4 Wright-Fisher diffusion 5 Summary 19 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Bessel process Infinitesimal variance 1? X Drift β(y ) = (δ − 1)/(2y), variance σ 2 (y) = 1. Entrance boundary? Finitedimensional distributions? Exact simulation? Distributions of extrema? 20 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Bessel process Infinitesimal variance 1? X Drift β(y ) = (δ − 1)/(2y), variance σ 2 (y) = 1. Entrance boundary? X Zero is an entrance boundary when δ ≥ 2. Finitedimensional distributions? Exact simulation? Distributions of extrema? 20 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Bessel process Infinitesimal variance 1? X Drift β(y ) = (δ − 1)/(2y), variance σ 2 (y) = 1. Entrance boundary? X Zero is an entrance boundary when δ ≥ 2. Finitedimensional distributions? X p(y,0)→(z,T ) (x; t) = − T 2t(T −t) e z(T −t) + 2t(TxT−t) + 2T (Tyt−t) 2tT √ Iν ( √ xy xz ) )Iν ( t (T −t)2 √ yz Iν ( 2 ) T , where ν = 2(δ + 1), is the transition density of the (squared) Bessel bridge. Exact simulation? Distributions of extrema? 20 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Bessel process Infinitesimal variance 1? X Drift β(y ) = (δ − 1)/(2y), variance σ 2 (y) = 1. Entrance boundary? X Zero is an entrance boundary when δ ≥ 2. Finitedimensional distributions? X p(y,0)→(z,T ) (x; t) = − T 2t(T −t) e z(T −t) + 2t(TxT−t) + 2T (Tyt−t) 2tT √ Iν ( √ xy xz ) )Iν ( t (T −t)2 √ yz Iν ( 2 ) T , where ν = 2(δ + 1), is the transition density of the (squared) Bessel bridge. Exact simulation? X δ ∈ Z≥0 : radial part of a δ-dimensional Brownian motion. δ ∈ R≥0 : See Makarov & Glew (2010). Distributions of extrema? 20 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Bessel process Infinitesimal variance 1? X Drift β(y ) = (δ − 1)/(2y), variance σ 2 (y) = 1. Entrance boundary? X Zero is an entrance boundary when δ ≥ 2. Finitedimensional distributions? X p(y,0)→(z,T ) (x; t) = − T 2t(T −t) e z(T −t) + 2t(TxT−t) + 2T (Tyt−t) 2tT √ Iν ( √ xy xz ) )Iν ( t (T −t)2 √ yz Iν ( 2 ) T , where ν = 2(δ + 1), is the transition density of the (squared) Bessel bridge. Exact simulation? Distributions of extrema? X δ ∈ Z≥0 : radial part of a δ-dimensional Brownian motion. δ ∈ R≥0 : See Makarov & Glew (2010). (X) Partly. 20 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Bessel-EA Exact simulation from a diffusion with law Qy using the Bessel process (law Bδy Qy ) is possible by the following: Theorem. Under regularity conditions (similar to EA), Qy is the marginal distribution of Y when n h io e ) , (Y , Φ) ∼ (Bδy ⊗ L) Φ ⊆ epigraph φ(Y where L is the law of a Poisson point process Φ of unit rate on [0, T ] × [0, ∞),and 1 e φ(u) := [αθ2 (u) − β 2 (u) + αθ0 (u) − β 0 (u)] + C. 2 22 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Outline of proof. Similar to the Brownian case: regularity conditions permit a Girsanov transformation and rearrangement so)that ( Z T dQy e t )dt ≤ 1, φ(Y (Y ) ∝ exp − dBδy 0 provides the rejection probability for sampling from the conditional law n io h e ) . (Bδy ⊗ L) Φ ⊆ epigraph φ(Y 23 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Outline of proof. Similar to the Brownian case: regularity conditions permit a Girsanov transformation and rearrangement so)that ( Z T dQy e t )dt ≤ 1, φ(Y (Y ) ∝ exp − dBδy 0 provides the rejection probability for sampling from the conditional law n io h e ) . (Bδy ⊗ L) Φ ⊆ epigraph φ(Y So what? We have just replaced one candidate process for another, the only substantial difference the appearance of 1 e φ(u) := [αθ2 (u) − β 2 (u) + αθ0 (u) − β 0 (u)] + C. 2 instead of 1 φ(u) := [αθ2 (u) + αθ0 (u)] + C. 2 23 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: A population growth model. A diffusion (Xt )0≤t≤T with drift and diffusion coefficients µ(x) = κx, σ 2 (x) = x + ωx 2 , commenced from X0 = x0 and grown to XT = xT . 24 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: A population growth model. A diffusion (Xt )0≤t≤T with drift and diffusion coefficients µ(x) = κx, σ 2 (x) = x + ωx 2 , commenced from X0 = x0 and grown to XT = xT . The population has not died out, so we can condition the process on non-absorption at 0. 24 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: A population growth model. A diffusion (Xt )0≤t≤T with drift and diffusion coefficients σ 2 (x) = x + ωx 2 , µ(x) = κx, commenced from X0 = x0 and grown to XT = xT . The population has not died out, so we can condition the process on non-absorption at 0. Conditioning and Lamperti transforming leads to new drift κ α(y ) = √ tanh ω √ √ √ ωy ω − coth ωy 2 2 tanh + h√ ωy 2 i ω − 2κ h√ i, √ ωy −2 w 1 − cosh 4κ ω 2 with an entrance boundary at 0. 24 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: A population growth model. What does the drift look like at the boundary? 3 α(y ) = + O(y ) as y → 0. 2y 25 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: A population growth model. What does the drift look like at the boundary? 3 α(y ) = + O(y ) as y → 0. 2y δ−1 . 2y So we should choose δ = 4 for our candidate process. Compare with the Bessel process: β(y) = 25 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: A population growth model. What does the drift look like at the boundary? 3 α(y ) = + O(y ) as y → 0. 2y δ−1 . 2y So we should choose δ = 4 for our candidate process. Compare with the Bessel process: β(y) = φ(u) 0 0 5 u 10 25 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: A population growth model. What does the drift look like at the boundary? 3 α(y ) = + O(y ) as y → 0. 2y δ−1 . 2y So we should choose δ = 4 for our candidate process. Compare with the Bessel process: β(y) = φ(u) 0 0 5 u 10 25 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: A population growth model. φe is (tightly) bounded (by K say), while φ is unbounded as y → 0. 26 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: A population growth model. φe is (tightly) bounded (by K say), while φ is unbounded as y → 0. Hence we can use the following Bessel-EA to return skeleton bridges: 1 2 3 Simulate a Poisson point process on [0, T ] × [0, K ]. Simulate a Bessel bridge of dimension δ = 4 at the times of the Poisson points. If any of the former are beneath any of the latter, return to 1. 26 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Results Bessel-EA1 κ 1.0 1.0 1.0 1.0 1.0 1.0 y 10.0 1.0 0.25 0.15 0.1 0.025 Attempts 1.1 1.0 1.0 1.0 1.1 1.0 Poisson points 0.2 0.2 0.2 0.2 0.2 0.2 Y0 = y to Y0.15 = 1, ω = 3. Skeleton Random Total points variables Time (s) 0.2 1.9 0 0.2 1.9 0 0.2 2.0 0 0.2 2.0 1 0.2 2.0 1 0.2 2.0 0 Poisson points 0.1 0.1 1288.6 7531.1 DNF DNF Skeleton points 0.1 0.1 420.6 617.4 DNF DNF Brownian-EA (“EA2”) κ 1.0 1.0 1.0 1.0 1.0 1.0 y 10.0 1.0 0.25 0.15 0.1 0.025 Attempts 1.0 1.1 1.2 1.4 DNF DNF Random variables 7.3 7.4 3846.1 16921.4 DNF DNF Total Time (s) 0 0 6 16 DNF DNF 27 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Results Bessel-EA1 κ 10.0 10.0 10.0 10.0 10.0 10.0 y 10.0 1.0 0.25 0.15 0.1 0.025 Attempts 5.2 3.0 2.3 2.2 2.2 2.1 Poisson points 14.1 7.9 6.1 6.0 5.9 5.8 Y0 = y to Y0.15 = 1, ω = 3. Skeleton Random Total points variables Time (s) 6.8 56.4 1 4.9 36.4 1 4.4 30.8 1 4.3 30.3 0 4.4 30.4 0 4.3 29.6 1 Poisson points 9.8 5.9 81.4 23052.1 DNF DNF Skeleton points 4.8 3.6 10.7 1981.9 DNF DNF Brownian-EA (“EA2”) κ 10.0 10.0 10.0 10.0 10.0 10.0 y 10.0 1.0 0.25 0.15 0.1 0.025 Attempts 5.0 2.9 2.6 2.9 DNF DNF Random variables 40.9 29.8 201.9 52056.9 DNF DNF Total Time (s) 0 0 0 52 DNF DNF 28 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary When is the singularity in the drift at an entrance boundary matched by a Bessel process? 29 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary When is the singularity in the drift at an entrance boundary matched by a Bessel process? Here’s a partial answer. Theorem. Suppose we have a diffusion Y satisfying the requirements of EA1. Then the diffusion Y ∗ obtained by conditioning this process on {Tb < T0 }, can be simulated via Bessel-EA1 with δ = 3. 29 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary When is the singularity in the drift at an entrance boundary matched by a Bessel process? Here’s a partial answer. Theorem. Suppose we have a diffusion Y satisfying the requirements of EA1. Then the diffusion Y ∗ obtained by conditioning this process on {Tb < T0 }, can be simulated via Bessel-EA1 with δ = 3. Outline of proof. Deduce regularity requirements for Bessel-EA1 from the assumptions of EA1. Compute the conditioned drift α∗ (y ) by bare hands, using a Doob h-transform. We find φe∗ (u) is bounded iff δ = 3 (among all possible δ ≥ 2). 29 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Outline 1 Introduction 2 Overview of the exact algorithm 3 Bessel-EA 4 Wright-Fisher diffusion 5 Summary 30 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: The Wright-Fisher diffusion with natural selection The frequency Xt ∈ [0, 1] of a gene in a large population evolves according to p dXt = γXt (1 − Xt )dt + Xt (1 − Xt )dWt , X0 = x, t ≥ 0. 31 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: The Wright-Fisher diffusion with natural selection The frequency Xt ∈ [0, 1] of a gene in a large population evolves according to p dXt = γXt (1 − Xt )dt + Xt (1 − Xt )dWt , X0 = x, t ≥ 0. γ parametrizes the selective advantage of this gene. 31 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: The Wright-Fisher diffusion with natural selection The frequency Xt ∈ [0, 1] of a gene in a large population evolves according to p dXt = γXt (1 − Xt )dt + Xt (1 − Xt )dWt , X0 = x, t ≥ 0. γ parametrizes the selective advantage of this gene. A gene is observed to be at frequency X0 = x0 and XT = xT . What do its sample paths look like? 31 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: The Wright-Fisher diffusion with natural selection The frequency Xt ∈ [0, 1] of a gene in a large population evolves according to p dXt = γXt (1 − Xt )dt + Xt (1 − Xt )dWt , X0 = x, t ≥ 0. γ parametrizes the selective advantage of this gene. A gene is observed to be at frequency X0 = x0 and XT = xT . What do its sample paths look like? 0 is absorbing so we should condition the diffusion not to have hit 0 (T0 > T ). 31 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: The Wright-Fisher diffusion with natural selection The frequency Xt ∈ [0, 1] of a gene in a large population evolves according to p dXt = γXt (1 − Xt )dt + Xt (1 − Xt )dWt , X0 = x, t ≥ 0. γ parametrizes the selective advantage of this gene. A gene is observed to be at frequency X0 = x0 and XT = xT . What do its sample paths look like? 0 is absorbing so we should condition the diffusion not to have hit 0 (T0 > T ). Conditioning and Lamperti transforming leads to new drift α(y ) = h y i 1 γ sin(y ) coth γ sin2 − cot(y). 2 2 (Schraiber et al., 2013). 31 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: The Wright-Fisher diffusion. What does the drift look like at the boundary? 3 + O(y ) as y → 0. α(y ) = 2y 32 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: The Wright-Fisher diffusion. What does the drift look like at the boundary? 3 + O(y ) as y → 0. α(y ) = 2y So we should again choose δ = 4 for our candidate process. 32 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: The Wright-Fisher diffusion. What does the drift look like at the boundary? 3 + O(y ) as y → 0. α(y ) = 2y So we should again choose δ = 4 for our candidate process. φ(u) 0 0 u pi 32 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: The Wright-Fisher diffusion. What does the drift look like at the boundary? 3 + O(y ) as y → 0. α(y ) = 2y So we should again choose δ = 4 for our candidate process. φ(u) 0 0 u pi 32 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Example: The Wright-Fisher diffusion. What does the drift look like at the boundary? 3 + O(y ) as y → 0. α(y ) = 2y So we should again choose δ = 4 for our candidate process. φ(u) 0 0 u pi e Problem: φ(u) is still unbounded as u → π. This leaves us with only an approximately exact algorithm. 32 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Ongoing work to fix this issue In the spirit of (Brownian)-EA2, conditioning on the maximum of a Bessel bridge would solve the problem: 33 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Ongoing work to fix this issue In the spirit of (Brownian)-EA2, conditioning on the maximum of a Bessel bridge would solve the problem: 1 Simulate the maximum MT (and the time, tM , it is attained) of a Bessel bridge from Y0 to YT . 33 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Ongoing work to fix this issue In the spirit of (Brownian)-EA2, conditioning on the maximum of a Bessel bridge would solve the problem: 1 Simulate the maximum MT (and the time, tM , it is attained) of a Bessel bridge from Y0 to YT . 2 Use another version of the Wright-Fisher diffusion as our candidate process. 33 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion The Wright-Fisher diffusion with mutation but no selection p dXt = [θ1 (1 − Xt ) − θ2 Xt ]dt + Xt (1 − Xt )dWt , X0 = x, Summary t ≥ 0. The transition density has eigenfunction expansion ∞ m X X f (x, y; t) = qm (t) Bm,x (l) · Dθ1 +l,θ2 +m−l (y ), | {z } | {z } m=0 l=0 Binomial PMF Beta density where qm (t) is the transition function of a certain pure death process on N (related to Kingman’s coalescent). 34 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion The Wright-Fisher diffusion with mutation but no selection p dXt = [θ1 (1 − Xt ) − θ2 Xt ]dt + Xt (1 − Xt )dWt , X0 = x, Summary t ≥ 0. The transition density has eigenfunction expansion ∞ m X X f (x, y; t) = qm (t) Bm,x (l) · Dθ1 +l,θ2 +m−l (y ), | {z } | {z } m=0 l=0 Binomial PMF Beta density where qm (t) is the transition function of a certain pure death process on N (related to Kingman’s coalescent). This is a known infinite mixture of beta random variables. 34 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion The Wright-Fisher diffusion with mutation but no selection p dXt = [θ1 (1 − Xt ) − θ2 Xt ]dt + Xt (1 − Xt )dWt , X0 = x, Summary t ≥ 0. The transition density has eigenfunction expansion ∞ m X X f (x, y; t) = qm (t) Bm,x (l) · Dθ1 +l,θ2 +m−l (y ), | {z } | {z } m=0 l=0 Binomial PMF Beta density where qm (t) is the transition function of a certain pure death process on N (related to Kingman’s coalescent). This is a known infinite mixture of beta random variables. Convenient for simulation! 1 Simulate M ∼ {qm (t) : m = 0, 1, . . .}. (a realization of Kingman’s coalescent with mutation, time t). 34 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion The Wright-Fisher diffusion with mutation but no selection p dXt = [θ1 (1 − Xt ) − θ2 Xt ]dt + Xt (1 − Xt )dWt , X0 = x, Summary t ≥ 0. The transition density has eigenfunction expansion ∞ m X X f (x, y; t) = qm (t) Bm,x (l) · Dθ1 +l,θ2 +m−l (y ), | {z } | {z } m=0 l=0 Binomial PMF Beta density where qm (t) is the transition function of a certain pure death process on N (related to Kingman’s coalescent). This is a known infinite mixture of beta random variables. Convenient for simulation! 1 Simulate M ∼ {qm (t) : m = 0, 1, . . .}. (a realization of Kingman’s coalescent with mutation, time t). 2 Simulate L ∼ Binomial(M, x). 34 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion The Wright-Fisher diffusion with mutation but no selection p dXt = [θ1 (1 − Xt ) − θ2 Xt ]dt + Xt (1 − Xt )dWt , X0 = x, Summary t ≥ 0. The transition density has eigenfunction expansion ∞ m X X f (x, y; t) = qm (t) Bm,x (l) · Dθ1 +l,θ2 +m−l (y ), | {z } | {z } m=0 l=0 Binomial PMF Beta density where qm (t) is the transition function of a certain pure death process on N (related to Kingman’s coalescent). This is a known infinite mixture of beta random variables. Convenient for simulation! 1 Simulate M ∼ {qm (t) : m = 0, 1, . . .}. (a realization of Kingman’s coalescent with mutation, time t). 2 Simulate L ∼ Binomial(M, x). 3 Return Y ∼ Beta(θ1 + L, θ2 + M − L). 34 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Issues Example Mixture weights are known only as an infinite series: ∞ X (θ + 2k − 1)Γ(θ + m + k − 1) −k(k+θ−1)t/2 qm (t) = (−1)k−m e . m!(k − m)!Γ(θ + m) k=m 35 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Proposition (Jenkins & Spanò, in preparation). The coefficients of the ancestral process of Kingman’s coalescent, {qm (t) : m = 0, 1, . . .}, can be rearranged in such a way that this distribution can be simulated exactly. 36 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Outline 1 Introduction 2 Overview of the exact algorithm 3 Bessel-EA 4 Wright-Fisher diffusion 5 Summary 36 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Summary It is possible to simulate efficiently from several diffusions with a finite entrance boundary, without discretization error. 37 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Summary It is possible to simulate efficiently from several diffusions with a finite entrance boundary, without discretization error. Candidate diffusions other than Brownian motion: Bessel process Wright-Fisher diffusion suggest the potential for further generalizing the exact algorithms. 37 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Plug Jenkins, P. A. “Exact simulation of the sample paths of a diffusion with a finite entrance boundary.” arXiv:1311.5777. Acknowledgements Many helpful conversations: Steve Evans Murray Pollock Gareth Roberts Joshua Schraiber 38 / 38 Introduction Exact algorithm Bessel-EA Wright-Fisher diffusion Summary Plug Jenkins, P. A. “Exact simulation of the sample paths of a diffusion with a finite entrance boundary.” arXiv:1311.5777. Acknowledgements Many helpful conversations: Steve Evans Murray Pollock Gareth Roberts Joshua Schraiber Thank you for listening! 38 / 38