Walk-on-spheres method

From HandWiki - Reading time: 7 min

Short description: Mathematical algorithm

In mathematics, the walk-on-spheres method (WoS) is a numerical probabilistic algorithm, or Monte-Carlo method, used mainly in order to approximate the solutions of some specific boundary value problem for partial differential equations (PDEs).[1][2] The WoS method was first introduced by Mervin E. Muller in 1956 to solve Laplace's equation,[1] and was since then generalized to other problems.

It relies on probabilistic interpretations of PDEs, and simulates paths of Brownian motion (or for some more general variants, diffusion processes), by sampling only the exit-points out of successive spheres, rather than simulating in detail the path of the process. This often makes it less costly than "grid-based" algorithms, and it is today one of the most widely used "grid-free" algorithms for generating Brownian paths.

Informal description

Let [math]\displaystyle{ \Omega }[/math] be a bounded domain in [math]\displaystyle{ \mathbb{R}^d }[/math] with a sufficiently regular boundary [math]\displaystyle{ \Gamma }[/math], let h be a function on [math]\displaystyle{ \Gamma }[/math], and let [math]\displaystyle{ x }[/math] be a point inside [math]\displaystyle{ \Omega }[/math].

Consider the Dirichlet problem:

[math]\displaystyle{ \begin{cases} \Delta u (x) =0 & \mbox{if }x \in \Omega \\ u(x) = h(x) & \mbox{if }x \in \Gamma. \end{cases} }[/math]

It can be easily shown[lower-alpha 1] that when the solution [math]\displaystyle{ u }[/math] exists, for [math]\displaystyle{ x \in \Omega }[/math]:

[math]\displaystyle{ u(x) = \mathbb{E}_x[ h(W_{\tau}) ] }[/math]

where W is a d-dimensional Wiener process, the expected value is taken conditionally on {W0 = x}, and τ is the first-exit time out of Ω.

To compute a solution using this formula, we only have to simulate the first exit point of independent Brownian paths since with the law of large numbers:

[math]\displaystyle{ \mathbb{E}_x[ h(W_\tau) ] \sim \frac{1}{n} \sum_{i=1}^n h(W^i_\tau) }[/math]

The WoS method provides an efficient way of sampling the first exit point of a Brownian motion from the domain, by remarking that for any (d − 1)-sphere centred on x, the first point of exit of W out of the sphere has a uniform distribution over its surface. Thus, it starts with x(0) equal to x, and draws the largest sphere [math]\displaystyle{ \mathcal{S}_0 }[/math] centered on x(0) and contained inside the domain. The first point of exit x(1) from [math]\displaystyle{ \mathcal{S}_0 }[/math] is uniformly distributed on its surface. By repeating this step inductively, the WoS provides a sequence (x(n)) of positions of the Brownian motion.

According to intuition, the process will converge to the first exit point of the domain. However, this algorithm takes almost surely an infinite number of steps to end. For computational implementation, the process is usually stopped when it gets sufficiently close to the border, and returns the projection of the process on the border. This procedure is sometimes called introducing an [math]\displaystyle{ \varepsilon }[/math]-shell, or [math]\displaystyle{ \varepsilon }[/math]-layer.[4]

Formulation of the method

Illustration of a run of the Walk-on-spheres algorithm on an arbitrary domain [math]\displaystyle{ \Omega }[/math] with an [math]\displaystyle{ \varepsilon }[/math]-shell

Choose [math]\displaystyle{ \varepsilon \gt 0 }[/math]. Using the same notations as above, the Walk-on-spheres algorithm is described as follows:

  1. Initialize : [math]\displaystyle{ x^{(0)} = x }[/math]
  2. While [math]\displaystyle{ d(x^{(n)}, \Gamma) \gt \varepsilon }[/math]:
    1. Set [math]\displaystyle{ r_n = d(x^{(n)}, \Gamma) }[/math].
    2. Sample [math]\displaystyle{ \gamma_n }[/math] a vector uniformly distributed over the unit sphere, independently from the preceding ones.
    3. Set [math]\displaystyle{ x^{(n+1)} := x^{(n)} + r_n \gamma_n }[/math]
  3. When [math]\displaystyle{ d(x^{(n)}, \Gamma) \le \varepsilon }[/math]:
  4. [math]\displaystyle{ x_f := p_{\Gamma}(x^{(n)}) }[/math], the orthogonal projection of [math]\displaystyle{ x^{(n)} }[/math] on [math]\displaystyle{ \Gamma }[/math]
  5. Return [math]\displaystyle{ x_f }[/math]

The result [math]\displaystyle{ x_f }[/math] is an estimator of the first exit point from [math]\displaystyle{ \Omega }[/math] of a Wiener process starting from [math]\displaystyle{ x }[/math], in the sense that they have close probability distributions (see below for comments on the error).

Comments and practical considerations

Radius of the spheres

In some cases the distance to the border might be difficult to compute, and it is then preferable to replace the radius of the sphere by a lower bound of this distance. One must then ensure that the radius of the spheres stays large enough so that the process reaches the border.[1]

Bias in the method and GFFP

The Walk-on-spheres method is used until the process gets [math]\displaystyle{ \delta }[/math]-close to the border. Then the sphere is replaced by its "intersection" with the boundary of the domain.

As it is a Monte-Carlo method, the error of the estimator can be decomposed into the sum of a bias, and a statistical error. The statistical error is reduced by increasing the number of paths sampled, or by using variance reduction methods.

The WoS theoretically provides exact (or unbiased) simulations of the paths of the Brownian motion. However, as it is formulated here, the [math]\displaystyle{ \varepsilon }[/math]-shell introduced to ensure that the algorithm terminates also adds an error, usually of order [math]\displaystyle{ \mathcal{O}(\varepsilon) }[/math].[4] This error has been studied, and can be avoided in some geometries by using Green's Functions First Passage method:[5] one can change the geometry of the "spheres" when close enough to the border, so that the probability of reaching the border in one step becomes positive. This requires the knowledge of Green's functions for the specific domains. (see also Harmonic measure)

When it is possible to use it, the Green's function first-passage (GFFP) method is usually preferred, as it is both faster and more accurate than the classical WoS.[4]

Complexity

It can be shown that the number of steps taken for the WoS process to reach the [math]\displaystyle{ \varepsilon }[/math]-shell is of order [math]\displaystyle{ \mathcal{O} ( | \log(\varepsilon) |) }[/math].[2] Therefore, one can increase the precision to a certain extent without making the number of steps grow notably.

As it is commonly the case for Monte-Carlo methods, this algorithm performs particularly well when the dimension is higher than [math]\displaystyle{ 3 }[/math], and one only needs a small set of values. Indeed, the computational cost increases linearly with the dimension, whereas the cost of grid dependant methods increase exponentially with the dimension.[2]

Variants, extensions

This method has been largely studied, generalized and improved. For example, it is now extensively used for the computation of physical properties of materials (such as capacitance, electrostatic internal energy of molecules, etc.). Some notable extensions include:

Elliptic equations

The WoS method can be modified to solve more general problems. In particular, the method has been generalized to solve Dirichlet problems for equations of the form [math]\displaystyle{ \Delta u = cu + f }[/math] [6] (which include the Poisson and linearized Poisson−Boltzmann equations) or for any elliptic partial differential equation with constant coefficients.[7]

More efficient ways of solving the linearized Poisson–Boltzmann equation have also been developed, relying on Feynman−Kac representations of the solutions.[8]

Time dependency

Again, within a regular enough border, it possible to use the WoS method to solve the following problem :

[math]\displaystyle{ \begin{cases} \partial_t u(x,t) + \frac{1}{2}\Delta_x u (x, t) =0 & \mbox{if }x \in \Omega \mbox{ and } t \lt T\\ u(x, T) = h(x, T) & \mbox{if } x \in \bar{\Omega}\\ u(x, t) = h(x, t) & \mbox{if } x \in \Gamma. \end{cases} }[/math]

of which the solution can be represented as:[9]

[math]\displaystyle{ u(x,t) = \mathbb{E}_{t,x} (h(X_{T \wedge \tau}, T \wedge \tau)) }[/math],

where the expectation is taken conditionally on [math]\displaystyle{ X_t = x }[/math]

To use the WoS through this formula, one needs to sample the exit-time from each sphere drawn, which is an independent variable [math]\displaystyle{ \tau_0 }[/math] with Laplace transform (for a sphere of radius [math]\displaystyle{ R }[/math]):[10]

[math]\displaystyle{ \mathbb{E}(\exp(- s \tau_0)) = \frac{R \sqrt{2s}}{\sinh(R \sqrt{2s})} }[/math]

The total time of exit from the domain [math]\displaystyle{ \tau }[/math] can be computed as the sum of the exit-times from the spheres. The process also has to be stopped when it has not exited the domain at time [math]\displaystyle{ T }[/math].

Other extensions

The WoS method has been generalized to estimate the solution to elliptic partial differential equations everywhere in a domain, rather than at a single point.[11]

The WoS method has also been generalized in order to compute hitting times for processes other than Brownian motions. For example, hitting times of Bessel processes can be computed via an algorithm called "Walk on moving spheres".[12] This problem has applications in mathematical finance.

The WoS can be adapted to solve the Poisson and Poisson–Boltzmann equation with flux conditions on the boundary.[13]

Finally, WoS can be used to solve problems where coefficients vary continuously in space, via connections with the volume rendering equation.[14]

See also

Notes

  1. The link was first established by Kakutani for the 2-dimensional Brownian motion,[3] it can now be seen as a trivial case of the Feynman−Kac formula.

References

  1. 1.0 1.1 1.2 Muller, Mervin E. (Sep 1956). "Some continuous Monte-Carlo Methods for the Dirichlet Problem". The Annals of Mathematical Statistics 27 (3): 569–589. doi:10.1214/aoms/1177728169. 
  2. 2.0 2.1 2.2 Sabelfeld, Karl K. (1991). Monte Carlo methods in boundary value problems. Berlin [etc.]: Springer-Verlag. ISBN 978-3540530015. 
  3. Kakutani, Shizuo (1944). "Two-dimensional Brownian motion and harmonic functions". Proceedings of the Imperial Academy 20 (10): 706–714. doi:10.3792/pia/1195572706. 
  4. 4.0 4.1 4.2 Mascagni, Michael; Hwang, Chi-Ok (June 2003). "ϵ-Shell error analysis for "Walk On Spheres" algorithms". Mathematics and Computers in Simulation 63 (2): 93–104. doi:10.1016/S0378-4754(03)00038-7. 
  5. Given, James A.; Hubbard, Joseph B.; Douglas, Jack F. (1997). "A first-passage algorithm for the hydrodynamic friction and diffusion-limited reaction rate of macromolecules". The Journal of Chemical Physics 106 (9): 3761. doi:10.1063/1.473428. Bibcode1997JChPh.106.3761G. https://zenodo.org/record/1232952. 
  6. Elepov, B.S.; Mikhailov, G.A. (January 1969). "Solution of the dirichlet problem for the equation Δu − cu = −q by a model of "walks on spheres"". USSR Computational Mathematics and Mathematical Physics 9 (3): 194–204. doi:10.1016/0041-5553(69)90070-6. 
  7. Booth, Thomas E (February 1981). "Exact Monte Carlo solution of elliptic partial differential equations". Journal of Computational Physics 39 (2): 396–404. doi:10.1016/0021-9991(81)90159-5. Bibcode1981JCoPh..39..396B. 
  8. Hwang, Chi-Ok; Mascagni, Michael; Given, James A. (March 2003). "A Feynman–Kac path-integral implementation for Poisson's equation using an h-conditioned Green's function". Mathematics and Computers in Simulation 62 (3–6): 347–355. doi:10.1016/S0378-4754(02)00224-0. 
  9. Gobet, Emmanuel (2013). Méthodes de Monte-Carlo et processus stochastiques du linéaire au non-linéaire. Palaiseau: Editions de l'Ecole polytechnique. ISBN 978-2-7302-1616-6. 
  10. Salminen, Andrei N. Borodin; Paavo (2002). Handbook of Brownian motion : facts and formulae (2. ed.). Basel [u.a.]: Birkhäuser. ISBN 978-3-7643-6705-3. 
  11. Booth, Thomas (August 1982). "Regional Monte Carlo solution of elliptic partial differential equations". Journal of Computational Physics 47 (2): 281–290. doi:10.1016/0021-9991(82)90079-1. Bibcode1982JCoPh..47..281B. https://digital.library.unt.edu/ark:/67531/metadc1105394/m2/1/high_res_d/6245003.pdf. 
  12. Deaconu, Madalina; Herrmann, Samuel (December 2013). "Hitting time for Bessel processes—walk on moving spheres algorithm (WoMS)". The Annals of Applied Probability 23 (6): 2259–2289. doi:10.1214/12-AAP900. 
  13. Simonov, Nikolai A. (2007). "Random Walks for Solving Boundary-Value Problems with Flux Conditions". Numerical Methods and Applications. Lecture Notes in Computer Science. 4310. pp. 181–188. doi:10.1007/978-3-540-70942-8_21. ISBN 978-3-540-70940-4. 
  14. Sawhney, Rohan; Seyb, Dario; Jarosz, Wojciech; Crane, Keenan (July 2022). "Grid-Free Monte Carlo for PDEs with Spatially Varying Coefficients". ACM Transactions on Graphics 41 (4): 1–17. doi:10.1145/3528223.3530134. 

Further reading

  • Sabelfeld, Karl K. (1991). Monte Carlo methods in boundary value problems. Berlin [etc.]: Springer-Verlag. ISBN 9783540530015. 

External links




Licensed under CC BY-SA 3.0 | Source: https://handwiki.org/wiki/Walk-on-spheres_method
3 views |
↧ Download this article as ZWI file
Encyclosphere.org EncycloReader is supported by the EncyclosphereKSF