Integrl equtions, eigenvlue, function interpoltion Mrcin Chrząszcz mchrzsz@cernch Monte Crlo methods, 26 My, 2016 1 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 1/19 19
Integrl equtions, introduction Fredholm integrl eqution of the second order: ϕ(x) = f(x) + K(x, y)ϕ(y)dy The f nd K re known functions K is clled kernel The CHALLENGE: find the ϕ tht obeys the bove equtions There re NO numericl tht cn solve this type of equtions! Different methods hve to be used depending on the f nd K functions The MC lgorithm: construct probbilistic lgorithm which hs n expected vlue the solution of the bove equtions There re mny wys to build this! We ssume tht the Neumnn series converges! 2 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 2/19 19
Integrl equtions, pproximtions The following steps pproximte the Fredholm eqution: ϕ 0(x) = 0, ϕ 1(x) = f(x) + K(x, y)ϕ 0(y)dy = f(x) ϕ 2(x) = f(x) + K(x, y)ϕ 1(y)dy = f(x) + K(x, y)f(y)dy ϕ 3(x) = f(x) + K(x, y)dy = f(x) + K(x, y)f(y)dy + K(x, y)k(y, z)f(z)dydz Now we put the following nottions: One gets: K (1) (x, y) = K(x, y) K (2) (x, y) = ϕ 3 (x) = f(x) + K (1) (x, y)f(y)dy + K(x, t)k(t, y)dt K (2) (x, y)f(y)dy 3 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 3/19 19
Integrl equtions, pproximtions Continuing this process: nd the n-th pproximtion: K (n) (x, y) = K(x, t)k (n 1) (t, y)dt ϕ n(x) = f(x) + K (1) (x, y)f(y)dy + K (2) (x, y)f(y)dy+ Now going with the Neumnn series: n : ϕ(x) = lim n ϕ n(x) = f(x) + + K (n) (x, y)f(y)dy n i=1 K (n) (x, y)f(y)dy The bove series converges only inside the squre: x, y b for: K(x, y) 2 dxdy < 1 4 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 4/19 19
Integrl equtions, lgorithm The rndom wlk of prticle hppens on the intervl (, b): In the t = 0 the prticle is in the position x 0 = x If the prticle t time t = n 1 is in the x n 1 position then in time t = n the position is: x n = x n 1 + ξ n The numbers ξ 1, ξ 2, re independent rndom numbers generted from ρ pdf The prticle stops the wlk once it reches the position or b The prticle life time is n when x n nd x n b The expected life time is given by the eqution: where: τ(x) = ρ 1 (x) + ρ q(x) = x [1 + τ(y)] ρ(y x)dy ρ(y)dy + ρ(y)dy b x is the probbility of prticle nnihiltion in the time t = 1 5 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 5/19 19
Integrl equtions, lgorithm 2 The bove cn be trnsformed: τ(x) = 1 + τ(y)ρ(x y)dy (1) Now if p(x) is the probbility tht the prticle in time t = 0 ws in position x gets nnihilted becuse it crosses the border The probbility obeys the nlogous eqution: where p(x) = ρ(x) + ρ(x) = x p(y)ρ(y x)dy (2) ρ(y)dy is the probbility of nnihilting the prticle in the first wlk For the functions τ nd ρ we got the integrl Fredholm eqution So the bove rndom wlk cn be be used to solve the Equtions 1 nd 2 6 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 6/19 19
Integrl equtions, lgorithm 3 The ρ(x) is the pdf of rndom vribles ξ n We observe the rndom wlk of the prticle The trjectory: γ = (x 0, x 1, x 2,, x n) This mens for t = 0, 1, 2, n 1 nd x n or x n b Additionlly we mrk: γ r = (x 0, x 1,, x r ), r n We defined rndom vrible: n S(x) = V (γ r)f(x r 1) where r=1 V (γ 0 ) = 1, V (γ r) = K(xr 1, xr) ρ(x r x r 1) V (γr 1) One cn prove tht E [S(x)] treted s function of x vrible is the solution to the integrl eqution 7 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 7/19 19
Integrl equtions, lgorithm 4 We define new rndom vrible: where ρ r (x) is defined s: ρ 1 (x) = ρ r (x) = x ρ(y)dy + c r(x) = + b x { V (γn r )f(x n r ) ρ(x n r, ) r n, 0, r > n ρ(y)dy, ρ(x 1 x)ρ(x 2 x 1 )ρ(x r 1 x r 2 )ρ 1 (x r 1 )dx 1 dx r 1 is the probbility tht the prticle tht is t given time in the x coordinte will survive r moments One cn prove tht E [c r (x)] treted s function of x vrible is the solution to the integrl eqution 8 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 8/19 19
Integrl equtions, generl remrk There is generl trick: Any integrl eqution cn be trnsformed to liner eqution using qudrtic form If done so one cn use the lgorithms form lecture 8 to solve it Bullet prove solution! 9 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 9/19 19
Eigenvlue problem The Eigenvlue problem is to find λ tht obeys the eqution: H x = λ x For simplicity we ssume there the biggest Eigenvlue is singulr nd it s rel The numericl method is bsiclly n itertive procedure to find the biggest Eigenvlue: We choose rndomly vector x 0 The m vector we choose ccordingly to formul: x m = H x m 1 /λ m where λ m is choose such tht n ( x m) j = 1 j=1 the ( x ) j is the j coordinte of the x vector, j = 1, 2, 3,, n The set λ m is converging to the lrgest Eigenvlue of the H mtrix 10 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 10/19 19
Eigenvlue problem From the bove we get: λ 1λ 2λ m( x j) = (H m n x 0) j; λ 1λ 2λ m = (H m x 0) j j=1 For big k nd m > k one gets: n j=1 (Hm x 0) j n j=1 (Hk x 0 ) j = λ k+1 λ k+2 λ m λ m k from which: λ [ n (Hm ] x j=1 0 ) m k 1 j n j=1 (Hk x 0 ) j This is the Eigenvlue estimtion corresponding to H m x 0 for sufficient lrge m 11 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 11/19 19
Eigenvlue problem, probbilistic model Let Q = (q ij), i, j = 1, 2,, n is the probbility mtrix: q ij 0, n q ij = 1 j=1 We construct rndom wlk on the set: {1, 2, n} ccordingly to the below rules: In the t = 0 the prticle is in rndomly chosen stte i 0 ccordingly to binned pdf: p j If in the moment t = n 1 the prticle is in i n 1 stte then in the next moment it goes to the stte i n with the probbility q in 1 j For γ = (i 0, i 1, ) trjectory we define rndom vrible: Now we do: W r (γ) = ( x ) i0 p i0 h i1 i 0 h i2 i 1 h i3 i 2 h ir i r 1 q i1 i 0 q i2 i 1 q i3 i 2 q iri r 1 E [W m (γ)] E [W k (γ)] λm k So to estimte the lrgest Eigenvlue: 12 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 12/19 19 [ ] 1
Function interpoltion Lets put f(x 1) = f 1, f(x 2) = f 2, which we know the functions The problem: clculte the f(p) for x 1 < p < x 2 From the interpoltion method we get: f(p) = p x 1 x 2 x 1 f 2 + x 2 p x 2 x 1 f 1 I m jet-lgged writing this so let me put: x 1 = 0 nd x 2 = 1: f(p) = (1 p)f 1 + pf 2 For 2-dim: where: f(p 1, p 2 ) = r 1 r 2 f(δ 1, δ 2 ) δ { 1 pi, δ i = 0 r i = p i, δ i = 1 the sum is over ll pirs (in this cse 4) 13 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 13/19 19
Function interpoltion For n-dim we get monstrous: f(p 1, p 2,, p n ) = r 1 r 2 r n f(δ 1,, δ n ) δ the sum is over ll combintions (δ 1,, δ n), where δ i = 0, 1 The bove sum is over 2 n terms nd ech of it hs (n + 1) temrs It s esy to imgine tht for lrge n this is hrd Exmple n = 50 then we hve 10 14 ingredients There hs to be better wy to do this! From construction: 0 r 1r 2r n 1, r 1r 2r n = 1 We cn tret the r i s probbilities! We define rndom vrible: ξ = (ξ 1,, ξ n ) such tht: δ P(ξ i = 0) = 1 p i, P(ξ i = 1) = p i The extrpoltion vlue is then equl: f(p 1, p 2,, p n) = E [f(ξ 1,, ξ n)] 14 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 14/19 19
Trvelling Slesmn Problem Slesmn strting from his bse hs to visit n 1 other loctions nd return to bse hedqurters The problem is to find the shortest wy For lrge n the problem cn t be solver by brutl force s the complexity of the problem is (n 1)! There exist simplified numericl solutions ssuming fctoriztions Unfortuntely even those require nonymous computing power Cn MC help? YES :) The minimum distnce l hs to depend on 2 fctors: P the re of the city the Slesmn is trvelling nd the density of plces he n wnts to visit: P Form this we cn ssume: l P ( n P )b = P b n b 15 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 15/19 19
Trveling Slesmn Problem From dimension nlysis: b = 1 2 To get l we need squre root of re From this it s obvious: l P ( n P )b = P 05 n 05 Now we cn multiply the re by lph fctor tht keeps the density constnt then: l α 05 α 05 = α In this cse the distnce between the clients will not chnge, but the number of clients will increse by α so: l α In the end we get: = 1 16 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 16/19 19
Trveling Slesmn Problem In totl: l k(np ) 05 Of course the k depends on the shpe of the re nd loctions of client However for lrge n the k strts loosing the dependency It s n symptoticlly free estimtor To use the bove formul we need to somehow clculte k How to estimte this? Well mke TOY MC: tke squre put uniformly n points Then we cn clculte l Then it s trivil: k = l(np ) 05 17 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 17/19 19
Trveling Slesmn Problem This kind of MC experiment might require lrge CPU power nd time The dventge is tht once we solve the problem we cn use the obtined k for other cses (it s universl constnt!) It turns out tht: k 3 4 Ok, but in this cse we cn clculte l but not the ctul shortest wy! Why the hell we did this exercise?! Turns out tht for most of the problems we re looking for the solution tht is close to smllest l not the exct minimum 18 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 18/19 19
Wr Gmes S Andersoon 1966 simulted for Swedish government how would tnk bttle look like Ech of the sides hs 15 tnks tht they llocte on the bttle field The bttle is done in time steps Ech tnk hs 5 sttes: OK Tnk cn only shoot Tnk cn only move Tnk is destroyed Temporry sttes This models mde possible to check different fighting strtegies 19 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 19/19 19
Bckup 20 / Mrcin Chrząszcz (Universität Zürich) Integrl equtions, eigenvlue, function interpoltion 20/19 19