Numerical Simulation of Stochastic Differential Equations: Lecture 2, Part 2 Des Higham Department of Mathematics University of Strathclyde Montreal, Feb. 2006 p.1/17
Lecture 2, Part 2: Mean Exit Times Statement of Problem Differential Equation Formulation SDE/Monte Carlo Algorithm Convergence Property Montreal, Feb. 2006 p.2/17
dx(t) = f(x(t))dt + g(x(t))dw(t), X(0) = X 0 Suppose X 0 is a constant in (a, b) Define the random variable T exit to be T exit := inf{t : X(t) = a or X(t) = b} In words: T exit is first time solution leaves (a, b) b a Problem: find the mean exit time T mean exit := E [T exit ] Montreal, Feb. 2006 p.3/17
Monte Carlo for Mean Exit Time Choose a stepsize, t Choose a number of paths, M for s = 1 to M Set t n = 0 and X n = X 0 While X n > a and X n < b Compute a N(0,1) sample ξ n Replace X n by X n + tf(x n ) + t ξ n g(x n ) Replace t n by t n + t end set Texit s = t n 1 t 2 end set a M = M 1 M s=1 T exit s set b 2 M = M 1 1 M s=1 (T exit s a M) 2 Montreal, Feb. 2006 p.4/17
Errors Two sources of error Sampling error: sample mean expected value Numerical SDE error: EM SDE paths Third source of error Discrete time: {t i } is monitored, not continuous time b a Montreal, Feb. 2006 p.5/17
Analysis Let X 0 = x. Then T mean exit = u(x), where 1 g(x)2 d2 u 2 dx 2 + f(x)du dx = 1, for a < x < b with b.c. s u(a) = u(b) = 0 We can solve (analytically or numerically) to get exact solution. Then investigate accuracy of SDE/Monte Carlo. SDE/Monte Carlo approach is attractive for high-dimensional problems, e.g. X R 32 complicated geometries, computing u(x) at a single point Montreal, Feb. 2006 p.6/17
u(x) = 1 1 2 σ2 µ f(x) = µx and g(x) = σx (log(x/a) 1 (x/a)1 2µ/σ2 1 (b/a) 1 2µ/σ2 log(b/a) ) E.g. µ = 0.1, σ = 0.2, a = 0.5 and b = 2: 9 8 7 6 5 u(x) 4 3 2 1 0 0.5 1 1.5 2 Initial data, x Montreal, Feb. 2006 p.7/17
f(x) = µx and g(x) = σx Replace X n by X n + tµx n + t ξ n σx n can be improved: Replace X n by X n exp ( (µ 1σ2 ) t + ) t ξ 2 n σ E.g. µ = 0.1, σ = 0.2, a = 0.5, b = 2 and X 0 = 1 with M = 5 10 4 and t = 10 2 : 8000 7000 6000 5000 4000 3000 2000 1000 0 0 10 20 30 40 50 60 First exit time Montreal, Feb. 2006 p.8/17
Accuracy? T mean exit = 7.6450 With M = 5 10 4 and t = 10 2 we get a M = 7.8056 with a 95% conf. int. of [7.7561, 7.8552] exact answer well outside conf. int. Monte Carlo method overestimates mean exit time Explanation: error from checking paths only at discrete time points {t i } is dominating the statistical sampling error decrease t rather than increase M t = 10 3 : a M = 7.7137 conf. int. [7.6641, 7.7634] t = 10 4 : a M = 7.6688 conf. int. [7.6200, 7.7177] Convergence rate... Montreal, Feb. 2006 p.9/17
M = 5 10 5 and try t = 10 1, 10 2, 10 3, 10 4 µ = 0.5, σ = 0.2, a = 0.5, b = 2, X 0 = 1.5: 0.66 10 0 0.65 Sample mean + conf. interval 0.64 0.63 0.62 0.61 Error in sample mean 10 1 10 2 0.6 0.59 10 6 10 4 10 2 10 0 t 10 3 10 6 10 4 10 2 10 0 Least-squares fit: power = 0.45, (resid = 0.12) t Montreal, Feb. 2006 p.10/17
Convergence Rate The rate O( t 1 2 ) has been widely reported Overall error is then O( t 1 2 + 1/ M) take M t 1 Montreal, Feb. 2006 p.11/17
M = 10 4, t = 10 4, 40 X 0 values µ = 0.1, σ = 0.2, a = 0.5, b = 2: 10 8 6 u(x) 4 2 0 2 0.5 1 1.5 2 x Montreal, Feb. 2006 p.12/17
f(x) = λ(µ x) and g(x) = σ x Safe EM step is Replace X n by X n + tλ(µ X n ) + t ξ n σ X n Take λ = 1, µ = 0.5, σ = 0.3, a = 1 and b = 2, M = 10 3 and t = 10 3 : 0.9 0.8 0.7 0.6 0.5 u(x) 0.4 0.3 0.2 0.1 0 Exact solution from bvp4c.m 0.1 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2 x Montreal, Feb. 2006 p.13/17
Double-Well Potential: V (x) = x 2 (x 2) 2 1.6 1.4 1.2 1 V(x) 0.8 0.6 0.4 0.2 0 0.5 0 0.5 1 1.5 2 2.5 x dx(t) = V (X(t))dt + σdw(t) Take a = 3 and b = 1 Measuring expected time to climb over the central hump Montreal, Feb. 2006 p.14/17
1 σ2 d2 u 2 dx 2 V (x) du dx = 1 0.8 0.7 Mean exit time 0.6 0.5 0.4 0.3 σ = 4 σ = 2 0.2 σ = 6 0.1 0 3 2.5 2 1.5 1 0.5 0 0.5 1 Initial data, x Montreal, Feb. 2006 p.15/17
Convergence Fix X 0 = 0 and σ = 4 M = 5 10 5 and t = 10 2, 10 3, 10 4, 10 5 : 0.23 10 1 0.22 Sample mean + conf. interval 0.21 0.2 0.19 Error in sample mean 10 2 0.18 0.17 10 5 10 0 t 10 3 10 5 10 0 Least-squares fit: power = 0.46, (resid = 0.017) t Montreal, Feb. 2006 p.16/17
Monte Carlo/SDE for Mean Exit Time Research problems: Develop a provably O( t) algorithm. Ideas: Adaptively reduce t near boundary. After each step, calculate probability that exit was missed. Then draw from a uniform (0, 1) random number generator in order to decide whether to record an exit. Use random t n from a suitable exponential distribution. Develop an efficient method for high-dimension/complicated region Montreal, Feb. 2006 p.17/17