Tuesday, December 24, 2019

calculus - Evaluating a complicated triple integral



I was working on a problem of trying to determine synchronization of neurons and wanted to compare an analytical result to some numerical results I achieved. The analytical result depends upon evaluating this triple integral:



2π02π02π03+2cos(θ1θ2)+2cos(θ2θ3)+2cos(θ3θ1)dθ1dθ2dθ3



The triple integral comes from trying to evaluate E[|eiθ1+eiθ2+eiθ3|2] where the θ's are i.i.d uniform random variables on the unit circle.



Wolfram alpha wasn't able to produce a value so I question if it's even possible to evaluate, whether exactly or a decimal approximation.



Answer



It shouldn't be too hard to approximate this numerically. I did a quick Monte Carlo integration in R, taking n=108 samples:



set.seed(42)
n = 10^8
theta1 = runif(n, 0, 2*pi)
theta2 = runif(n, 0, 2*pi)
theta3 = runif(n, 0, 2*pi)
integrand = sqrt(3+2*cos(theta1-theta2)+2*cos(theta2-theta3)+2*cos(theta3-theta1))
mu = mean(integrand)

sigma = sd(integrand)


gives that the estimated mean of the integrand is μ=1.574591 and the standard deviation of the integrand is σ=0.7215917. This gives a standard error for that estimate of σ/n=0.0000722.



Thus we get an estimated value for the integrand of
(8π3)(μ±σn)


since the region of integration has volume 8π3. This is 390.578±0.018.



As an analytical note, your integrand is unchanged when θ1,θ2,θ3 are rotated by the same angle around the unit circle. So you may as well set θ3=0. Let θ3=0 and you get




2π02π02π03+2cos(θ1θ2)+2cosθ2+2cosθ1dθ3dθ2dθ1



and since θ3 isn't in the integrand and you're working over a rectangular region, this is



2π2π02π03+2cos(θ1θ2)+2cosθ2+2cosθ1dθ2dθ1



This probably isn't easier to do analytically but I'd think a double integral would be easier than a triple integral numerically.


No comments:

Post a Comment

analysis - Injection, making bijection

I have injection f:AB and I want to get bijection. Can I just resting codomain to f(A)? I know that every function i...