scientific computing - Numerical integration of a discontinuous function in multiple dimensions -
i have function f(x) = 1/(x + a+ b*i*sign(x)) , want calculate integral of
dx dy dz f(x) f(y) f(z) f(x+y+z) f(x-y - z)
over entire r^3 (b>0 , a,- b of order unity). representative example -- in practice have n<7 variables , 2n-1 instances of f(), n of them involving n integration variables , n-1 of them involving linear combintation of integration variables. @ stage i'm interested in rough estimate relative error of 1e-3 or so.
i have tried following libraries :
- steven johnson's cubature code: hcubature algorithm works abysmally slow, taking hundreds of millions of integrand evaluations n=2.
- hintlib: tried adaptive integration genz-malik rule, cubature routines, vegas , miser mersenne twister rng. n=3 first seems viable option again takes hundreds of millions of integrand evaluations n=3 , relerr = 1e-2, not encouraging.
for region of integration have tried both approaches: integrating on [-200, 200]^n (i.e. region large captures of integral) , substitution x = sinh(t) seems standard trick.
i not have experience numerical analysis presumably difficulty lies in discontinuities sign() term. n=2 , f(x)f(y)f(x-y) there discontinuities along x=0, y=0, x=y. these create sharp peak around origin (with different sign in various quadrants) , sort of 'ridges' @ x=0,y=0,x=y along integrand large in absolute value , changes sign cross them. @ least know regions important. thinking maybe monte carlo somehow "tell" algorithm in advance focus. i'm not quite sure how that.
i grateful if had advice on how evaluate integral reasonable amount of computing power or how make monte carlo "idea" work. i've been stuck on while input welcome. in advance.
one thing can use guiding function monte carlo integration: given integral (am writing in 1d simplicity) of ∫ f(x) dx, write ∫ f(x)/g(x) g(x) dx, , use g(x) distribution sample x.
since g(x) arbitrary, construct such (1) has peaks expect them in f(x), , (2) such can sample x g(x) (e.g., gaussian, or 1/(1+x^2)).
alternatively, can use metropolis-type markov chain mc. find relevant regions of integrand (almost) itself. here couple of trivial examples.
Comments
Post a Comment