Abstract
In this paper, we construct first- and second-order weak split-step approximations for the solutions of the Wright–Fisher equation. The discretization schemes use the generation of, respectively, two- and three-valued random variables at each discretization step. The accuracy of constructed approximations is illustrated by several simulation examples.
MSC:
60H35; 65C30
1. Introduction
We are interested in weak first- and second-order approximations for the Wright–Fisher equation
with parameters and . The Wright–Fisher (WF) process (a solution of Equation (1)) is well defined in and models the gene frequencies in a population. The main problem in developing numerical methods for “square-root” diffusions is that the diffusion coefficient has unbounded derivatives near “singular” points (in our case, 0 and 1), and therefore standard methods (see, e.g., Milstein and Tretyakov [1]) are not applicable; typically, discretization schemes involving (explicitly or implicitly) the derivatives of the coefficients usually lose their accuracy near singular points, especially for large .
Alfonsi [2] (Chap. 6) constructed a weak second-order approximation of the WF process by using its connection with the Cox–Ingersoll–Ross (CIR) [3] process and the earlier constructed approximations of the latter (Alfonsi [4]). The main result of this paper is a direct construction of first- and second-order weak split-step approximations of the WF processes by discrete random variables. We believe that in comparison with the numerical scheme of Alfonsi [2] (Prop. 6.1.13, Algs. 6.1 and 6.2), our algorithm is much simpler and easier to implement. In our construction, we follow some ideas of Lileika and Mackevičius [5,6]. However, we had to overcome a serious additional challenge (in comparison with CIR or CKLS processes): two “singular” points, 0 and 1, of the diffusion coefficient make it essentially more difficult to ensure that the approximations take values in (instead of as in [5,6]).
The paper is organized as follows. In Section 2, we recall some definitions and results. In Section 3 and Section 4, we construct first- and second-order approximations for the WF equation by two- and three-valued discrete random variables, respectively. The main results of these sections are presented as Theorems 4 and 5. We illustrate the accuracy of our approximations by several simulation examples. In Section 5, we prove an auxiliary result on the smoothness of solutions of the corresponding backward Kolmogorov PDE equation. Tedious technical calculations have been performed using Maple and Python.
2. Preliminaries
In this section, we give some known definitions adapted to our context of the WF process defined by Equation (1).
Having a fixed time interval , consider an equidistant time discretization , where is the integer part of a. By a discretization scheme (or approximation) of Equation (1) we mean any family of discrete-time homogeneous Markov chains in [0, 1] with initial values and one-step transition probabilities , . For convenience, we only consider steps , . For brevity, we sometimes write or instead of . Note that because of the Markovity, a one-step approximation of the scheme completely defines the distribution of the whole discretization scheme , so that we only need to construct the former. Therefore, we will abbreviate one-step approximations as approximations. As usual, and are the sets of natural and real numbers, , and .
We will write if, for some and
Definition 1
(c.f. [4], Def. 1.3, [6], Def. 1). A discretization scheme is a weak νth-order approximation for the solution of Equation (1) if for every ,
Definition 2
(c.f. [4], Def. 1.8, [6], Defs. 2, 3). The νth-order remainder of a discretization scheme for is the operator defined by
where A is the generator of ,
A discretization scheme is a potential νth-order weak approximation of Equation (1) if
for all and .
The following two theorems ensure that a potential th-order weak approximation is in fact a th-order weak approximation (in the sense of Definition 1). Note that the requirement of uniformly bounded moments (see, e.g., [4]) is obviously satisfied by our approximations since they take values in [0, 1].
Theorem 1
(see Theorem 1.19 of [4]). Let be a discretization scheme with transition probabilities on that starts from . We assume that
- 1.
- the scheme is a potential weak νth-order discretization scheme for the operator A.
- 2.
- is a function such that defined on solves for .
Then .
Theorem 2
(see Theorem 6.1.12 of [2]). Let . Then
is a function that solves
The solution of the deterministic part is positive for all , namely:
The solution of the stochastic part is not explicitly known. However, suppose that is a discretization scheme for the stochastic part. We define the first-order composition of the latter with the solution of the deterministic part as a Markov chain that has the transition probability in one step equal to the distribution of the random variable
Similarly, the second-order composition is defined by
Theorem 3
From this theorem, it follows that to construct a first- or second-order weak approximation, we only need to construct a first- or second-order approximation of the stochastic part, respectively.
Remark 1.
For various applications, we may be interested in similar processes with values in satisfying the equation
which is well defined when . A popular choice is the Jacobi process with and . Process (8) can be obtained from the WF process by the affine transformation . Clearly, by the same transformation we can get weak approximations for (8) from weak approximations for the WF process.
3. First-Order Weak Approximation of Wright–Fisher Equation
3.1. Approximation of the Stochastic Part
Let us construct an approximation for the stochastic part of the WF equation, that is, the solution of Equation (1) with . A two-valued discrete random variable taking values with probabilities is a first-order weak approximation if (see [5] and references therein)
where the second moment can be calculated by Lemma 6 with :
Therefore, in our case, we get
Since , to simplify the expressions, we may try to replace by and, instead of (17), use
In Lemma 1, we will check that after this replacement, and still satisfy (9)–(13). Unfortunately, for the values of x near 1, the values of are slightly greater than 1 (as well as those defined by (17)), which is unacceptable. We overcome this problem by using the symmetry of the solution of the stochastic part with respect to the point ; to be precise, for all ( means equality in distribution). Therefore, in the interval we can use the values defined by (18), whereas in the interval we use the values corresponding to the process , that is,
with probabilities . Thus, we obtain the acceptable (i.e., with values in [0, 1]) approximation taking the values
Proof.
We first check that defined by (18) obtain values from the interval [0, 1] when and h is sufficiently small ( with independent from x):
If , then
Thus for and . So, if , then , and according to (19), instead of , we can take for . Thus, as we have just checked, we have , that is, for and .
Now we check conditions (9)–(13) for :
The last two equalities were obtained by using the Python SymPy package. The conditions for follow automatically from the symmetry. □
For the initial Equation (1) we obtain an approximation by the “split-step” procedure defined by (6):
Now we can state our first main result.
3.2. Algorithm
In this section, we provide an algorithm for calculating given at each simulation step i:
3.3. Simulation Examples
We illustrate our approximation for the test functions and . Since we do not explicitly know the moments , we use the approximate equality . We have chosen the parameters of the WF equation so that the fifth moment of is nonmonotonic as a function of t to see how the approximated fifth moment “follows” the bends of the true one as t varies. In Figure 1, Figure 2 and Figure 3, we compare and as functions of t (left plots) and as functions of a discretization step h (right plots) in terms of the relative error . As expected, the approximations agree with exact values pretty well. Note an impressive match between the approximated and true values of in Figure 3 even for rather large discretization step h.
Figure 1.
Comparison of and as functions of t and h for : , , the number of iterations . Left: ; Right: the relative error at
Figure 2.
Comparison of and as functions of t and h for : , . Left: ; Right: the relative error at
Figure 3.
Comparison of and as functions of t and h for : , . Left: ; Right: the relative error at
4. Second-Order Weak Approximation of Wright–Fisher Equation
4.1. Approximation of the Stochastic Part
Let be any discretization scheme. Applying Taylor’s formula to , we have
The generator and its square of the stochastic part are
Thus, the second-order remainder of the discretization scheme is
where
Let us denote for brevity. Converting the central moments of to noncentral moments, from (23)–(28) we get
where
Our aim is to construct a potential second-order approximation for the WF equation by discrete random variables at each generation step. Therefore, we look for approximations taking three values from the interval with probabilities satisfying the following conditions:
In anticipation, note that when solving system (31)–(32), a serious challenge is ensuring the first equality . A simple way out of this situation is relaxing the latter by the inequality
and, at the same time, allowing to take the additional trivial value 0 with probability . Notice that this does not change Equation (32) in any way.
Solving the system
with respect to , we obtain (cf. [6])
Note that, here, differently from [6], we used approximate “moments” instead of the true moments . This eventually allows us to get simpler expressions because are polynomials in x and z.
Now we have to find that, together with defined by Equations (34), satisfy the remaining conditions
Motivated by the first-order approximation (20) and [6], we look for of the following form:
with unknown parameters .
4.2. Calculation of the Parameters
Substituting (36)–(38) into the left-hand sides of (35), we have (for technical calculations, using Maple and Python)
To ensure equalities (35), we need to choose such that expressions at would be equal to 0. Equating the coefficients at the lowest powers of x to zero, we get the system for the parameters and B:
Although the system contains three equations with respect to two unknowns, it has the solution Substituting these values back to Equations (39)–(41), we get the relation which makes all the expressions at vanish. Summarizing, we have that of the form (36)–(38) and defined by (34) satisfy all of Equation (32), provided that the parameters satisfy the following relations:
4.3. Positivity of the Solution
Now we would like to choose the values of free parameters and C so that all are positive and . We first consider the latter restriction.
Lemma 2.
We have if
and
Proof.
We have
with numerator
and denominator
The numerator and denominator differ only by the coefficients at . Thus, it suffices to show that their difference is nonnegative, that is,
Inequality (44) is satisfied for all if
Solving inequality (45), we get
Since C must be nonnegative, we obtain condition (43) for . □
Remark 2.
We observe that possible values of C are rather small (see Figure 4). Therefore, to simplify the expressions for , we simply take and .
Figure 4.
Possible values of and
We have now arrived at the following expressions for :
However, the game is not over. At this point, we only have that defined by (46)–(48), together with defined by (34), satisfy conditions (32) and (33). From numerical calculations it appears that for “small” x, it happens that and thus Moreover, on the other hand, for “not small” x and “large” h, it happens that . We can see a typical situation in Figure 5 with , where for small x, and take values outside the interval , whereas for x near .
Figure 5.
Graphs of (Left) and (Right) as functions of x with fixed z. Gray area shows the region where first-order approximation is used to avoid negative probabilities. Parameters: .
Due to these reasons, similarly to [4], for small x below the threshold (with some fixed ), we will switch to the first-order approximation (20), which behaves as a second-order one for such x. We also have to consider , where is to be sufficiently small to ensure that . To be precise, for , , we will use scheme (20), whereas for , , we will use scheme (46)–(48) together with (34); finally, for , we will use the symmetry as in the first-order approximation. The following lemmas justify such a switch for and .
Lemma 3.
The first-order approximation (20) in the region (with arbitrary fixed satisfies conditions (29). In other words, in this region, it behaves as a second-order approximation.
Proof.
We prove equalities (29) in the region , where and , are defined by (20) and (30), respectively:
Lemma 4.
For and , defined in (46)–(48) take values in the interval .
Proof.
Obviously, . Thus, we focus on and . Since , it suffices to prove that and .
The condition is equivalent to the inequality
By denoting , this becomes
We will prove the stronger inequality
which after substitution becomes
The discriminant of the quadratic polynomial (49) in x is
which is negative for all . This means that the left-hand side (49) is positive and thus for all and except for , where .
Let us now prove that . For and , we have
Lemma 5.
For and , we have .
Proof.
From Lemma 2, we already have that . Therefore, it suffices to prove that . Because of the complex expressions of , we prefer to show this graphically by using the Maple function plot3d. See Figure 6, where the 3D graphs of as functions of are plotted in the domain . □
Figure 6.
Graphs of as functions of x and z. (a) , (b) , (c) .
4.4. The Second Main Result
Now let us summarize the results of this section. For clarity, recall the main notations:
To distinguish the functions from given by (18), here we denote the latter by
Using the symmetry for we define the approximation of the stochastic part of the WF equation as follows:
Now in view of Theorem 3 and Lemmas 2–5, we can state the main result on the second-order approximation of the WF process.
Theorem 5.
Let be the discretization scheme defined by one-step approximation
where is defined by (5), and is defined by (54). Then, is a second-order weak approximation of Equation (1).
4.5. Algorithm for Second-Order Approximation
In this section, we provide an algorithm for calculating given at each simulation step i:
- 1.
- Draw a uniform random variable U from the interval [0, 1].
- 2.
- (where D is given by (5))
- 3.
- If , then
- 3.1.
- if , thencalculate , according to (50)–(52),calculate , according to (34),if then else if thenelse if then elseelsecalculate according to (53),,if then elseelse
- 3.2.
- do step 3.1 with , ,.
- 4.
4.6. Simulation Examples
We illustrate our approximation for the test function . In Figure 7 and Figure 8, we compare the moments and as functions of t (left plots, ) and as functions of a discretization step h (right plots) in terms of the relative error. We observe that with a rather small number of iterations, the second-order approximation agrees with the exact values pretty well. These specific examples have been chosen to illustrate the behavior of approximations with small () and high () volatility. In comparison with the simulation results for the first-order approximation (Section 3.3), we see that to get a similar accuracy, we can use the second-order approximation with a significantly smaller number of iterations N and larger step size h, which in turn requires significantly less computation time.
Figure 7.
Comparison of and as functions of t and h for : , , the number of iterations . Left: ; Right: the relative error at
Figure 8.
Comparison of and as functions of t and h for : , , the number of iterations . Left: ; Right: the relative error at
5. Probabilistic Proof of Regularity of Solutions of the Kolmogorov Backward Equation
Theorem B is in fact Theorem 1.19 of [4] stated based on the results of [7], which are proved by methods of partial differential equation theory. Here, we provide a significantly simpler probabilistic proof of the theorem for a rather wide subclass of , which practically includes all functions interesting for applications, for example, polynomials or exponentials.
Definition 3.
We denote by the class of infinitely differentiable functions on with “not too fast” growing derivatives:
Every is the sum of its (uniformly convergent) Taylor series:
where , . This easily follows from the Lagrange error bound for Taylor series.
Remark 3.
Clearly, every is a real analytic function; see [8].
Denote , . Then, from (56), we formally have
If is infinitely continuously differentiable, then it satisfies Equation (2) (see, e.g., [9] (Thm. 8.1.1)). Therefore, it suffices to show that
- (1)
- the moments are infinitely continuously differentiable and
- (2)
- all formal partial derivatives of the series in (57),converge uniformly for (for any fixed ).
Lemma 6.
The moments of the WF process satisfy the following recurrence relation:
where .
In particular, by induction on k it follows that are infinitely continuously differentiable with respect to .
Proof.
Taking the expectations of both sides of Equation (1) and then differentiating with respect to t, we get
Solvingthe latter, we get (59).
When , by Itô’s formula, we have
By taking the expectations, we get
and thus
Solving the latter with respect to , we arrive at (60). □
Lemma 7.
All formal partial derivatives of the series (57),
converge uniformly for (for any fixed ).
Proof.
It is obvious that . First, consider the derivatives with respect to x. Let us prove by induction on k that
For , we have . Suppose
Then,
where we used the fact that , since .
Similarly, by induction on k, we can prove that
Indeed, for , , and for . Now suppose that for some k,
Then,
Now let us differentiate the moments with respect to t. We have
and by induction
Finally, for all mixed partial derivatives, we have
Since , we have that
and by the Weierstrass M-test it follows that, indeed, the function series (61) converges uniformly for all . □
6. Conclusions
We have constructed first- and second-order weak split-step approximations of the Wright–Fisher (WF) process. The approximations use generation of a two- or three-valued random variable at each discretization step. The main difficulty was ensuring that the values of approximations take values in [0, 1], the domain of the WF process. Illustrative simulations show perfect accuracy of the constructed approximations.
Author Contributions
All authors have participated equally in the development of this work, in both theoretical and computational aspects. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Conflicts of Interest
The authorsdeclare no conflict of interest.
Abbreviations
The following abbreviations are used in this paper:
| WF | Wright–Fisher model |
| CIR | Cox–Ingersoll–Ross model |
| PDE | Partial differential equation |
| B | Brownian motion |
| The set of positive integers | |
| The set of nonnegative integers, | |
| The set of real numbers | |
| The set of positive real numbers | |
| A subclass of , see Definition 3. | |
| if, for some and | |
| A discretization scheme of the WF process | |
| The solution of the deterministic part of the WF equation | |
| The solution of the stochastic part of the WF equation | |
| A discretization scheme of | |
| The mean of a random variable X | |
| The th-order remainder of a discretization scheme | |
| A | The generator of the WF process |
| The generator of the stochastic part of the WF process |
References
- Milstein, G.N.; Tretyakov, M.V. Stochastic Numerics for Mathematical Physics; Springer: Berlin/Heidelberg, Germany, 2004. [Google Scholar]
- Alfonsi, A. Affine Diffusions and Related Processes: Simulation, Theory and Applications; Bocconi & Springer Series; Springer: Cham, Switzerland, 2015. [Google Scholar]
- Cox, J.C.; Ingersoll, J.E.; Ross, S.A. A theory of the term structure of interest rates. Econometrica 1985, 53, 385–407. [Google Scholar] [CrossRef]
- Alfonsi, A. High order discretization schemes for the CIR process: Application to affine term structure and Heston models. Math. Comput. 2010, 79, 209–237. [Google Scholar] [CrossRef]
- Lileika, G.; Mackevičius, V. Weak approximation of CKLS and CEV processes by discrete random variables. Lith. Math. J. 2020, 60, 208–224. [Google Scholar] [CrossRef]
- Lileika, G.; Mackevičius, V. Second-order weak approximations of CKLS and CEV processes by discrete random variables. Mathematics 2021, 9, 1337. [Google Scholar] [CrossRef]
- Epstein, C.L.; Mazzeo, R. Wright–Fisher diffusion in one dimension. SIAM J. Math. Anal. 2010, 42, 568–608. [Google Scholar] [CrossRef]
- Krantz, S.G.; Parks, H.R. A Primer of Real Analytic Functions, 2nd ed.; Birkhäuser: Boston, MA, USA, 2002. [Google Scholar]
- Ksendal, B. Stochastic Differential Equations: An Introduction with Applications, 5th ed.; Springer: Berlin/Heidelberg, Germany; New York, NY, USA, 2000. [Google Scholar]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).