How to Solve a Higher Dimensional Numerical Integration Using Maple Notation?

hpriye
Messages
7
Reaction score
0
Hello

I have the following question in numerical integration in higher dimension. Any help/suggestion would be welcome.

The integral is ( I am using maple notation ):

int( int( int( int( int( int( f(x,y,z), z=-infinity..w), w=-infinity..infinity),
y=-infinity..v), v=-infinity..infinity),
x=-infinity..u), u=-infinity..infinity);

The integral is convergent. Indeed f(x,y,z) = K*exp(-( x^2+(y-x)^2+(z-y)^2) )/2), where K is a given constant.

Thanks in advance

Kind regards
hpriye
 
Mathematics news on Phys.org
And you are asking about... ?

Could be I am missing something obvious, it happens, but I see only statements, no questions.
 
What is your question? Surely it is not just "how do you do a numerical integration"! That is much too broad.
 
I am sorry, I thought it obvious that I was asking for a numerical method for evaluating the 6 dimension integral.

Many thanks in advance
hpriye
 
Hmm..I would first restrict the infinity to a radial variable, i.e, switch to spherical coordinates and see what simplifications, if any, that would give me.
 
Ok. I tried the following transformation:

x = r*cos(theta)*cos(phi)
y = r*cos(theta)*(cos(phi) + sin(phi))
z = r*cos(theta)*(cos(phi) + sin(phi)) + r*sin(theta)

and the Jacobian is -r^2*cos(theta). This means I am retaining the variables u,v,w as they are.

Now the question: what are the limits for the six variables: r, theta, phi, u, v, w?

Another question: Is there a transformation for removing u, v, w from being present in the limits?

Kind regards and many thanks
hpriye


arildno said:
Hmm..I would first restrict the infinity to a radial variable, i.e, switch to spherical coordinates and see what simplifications, if any, that would give me.
 
hpriye said:
int( int( int( int( int( int( f(x,y,z), z=-infinity..w), w=-infinity..infinity),
y=-infinity..v), v=-infinity..infinity),
x=-infinity..u), u=-infinity..infinity);

Hi hpriye! :smile:

The integral is over all x and u with -∞ < x < u < ∞, so:

\int_{-\infty}^{\infty} \int_{-\infty}^u f(x,y,x) dx du\ =\ \int_{-\infty}^{\infty} f(x,y,x)\left(\int_x^{\infty} du\right) dx\ =\ \infty

or have I misunderstood the question? :confused:
 
More than misunderstanding I would say misreading :(

hpriye


tiny-tim said:
Hi hpriye! :smile:

The integral is over all x and u with -∞ < x < u < ∞, so:

\int_{-\infty}^{\infty} \int_{-\infty}^u f(x,y,x) dx du\ =\ \int_{-\infty}^{\infty} f(x,y,x)\left(\int_x^{\infty} du\right) dx\ =\ \infty

or have I misunderstood the question? :confused:
 
i would use monte carlo integration. how about you write out your integral in tex so we can all understand it
 
  • #10
hpriye said:
More than misunderstanding I would say misreading :(

Nope … can't be misreading …

'cos I don't read maple! :biggrin:

… is it Canadian? :confused:

… i know tex is texan … :rolleyes:
 
  • #11
ice109 said:
i would use monte carlo integration. how about you write out your integral in tex so we can all understand it

∫_(-∞)^∞▒∫_(-∞)^u▒∫_(-∞)^∞▒∫_(-∞)^v▒∫_(-∞)^∞▒∫_(-∞)^w▒〖f(x,y,z) dz dw dy dv dx du〗

f(x,y,z)=1/〖√2π〗^3 e^(-1/2(x^2+(y-x)^2+(z-y)^2))-1/√6 e^(-x^2/2-y^2/4-z^2/6)

I have tried to give the MsWord 2007 format. Hope it is readable! Underscore stands for subscript and ^ stands for superscript

Kind regards
hpriye
 
  • #12
in texas we say …

hpriye said:
∫_(-∞)^∞▒∫_(-∞)^u▒∫_(-∞)^∞▒∫_(-∞)^v▒∫_(-∞)^∞▒∫_(-∞)^w▒〖f(x,y,z) dz dw dy dv dx du〗

f(x,y,z)=1/〖√2π〗^3 e^(-1/2(x^2+(y-x)^2+(z-y)^2))-1/√6 e^(-x^2/2-y^2/4-z^2/6)

I have tried to give the MsWord 2007 format. Hope it is readable! Underscore stands for subscript and ^ stands for superscript

Kind regards
hpriye

Hi hpriye! :smile:

If you mean \int_{-\infty}^{\infty}\int_{-\infty}^u\int_{-\infty}^{\infty}\int_{-\infty}^v\int_{-\infty}^{\infty}\int_{-\infty}^w f(x,y,z)\,dz dw dy dv dx du

f(x,y,z)\ =\ \frac{1}{(2\pi)^3} e^{-1/2(x^2+(y-x)^2+(z-y)^2)}\ -\ \frac{1}{\sqrt{6}}e^{-(\frac{1}{2}x^2\,-\,\frac{1}{4}y^2\,-\,\frac{1}{6}z^2)}

it's:

[noparse]\int_{-\infty}^{\infty}\int_{-\infty}^u\int_{-\infty}^{\infty}\int_{-\infty}^v\int_{-\infty}^{\infty}\int_{-\infty}^w f(x,y,z)\,dz dw dy dv dx du

f(x,y,z)\ =\ \frac{1}{(2\pi)^3} e^{-1/2(x^2+(y-x)^2+(z-y)^2)}\ -\ \frac{1}{\sqrt{6}}e^{-(\frac{1}{2}x^2\,-\,\frac{1}{4}y^2\,-\,\frac{1}{6}z^2)}[/noparse]
 
  • #13


Yes, exactly. But I observed square root symbol is missing, even in the original typesetting. It should be (sqrt(2*pi))^3. Thank you very much!

Kind regards
hpriye

tiny-tim said:
Hi hpriye! :smile:

If you mean \int_{-\infty}^{\infty}\int_{-\infty}^u\int_{-\infty}^{\infty}\int_{-\infty}^v\int_{-\infty}^{\infty}\int_{-\infty}^w f(x,y,z)\,dz dw dy dv dx du

f(x,y,z)\ =\ \frac{1}{(2\pi)^3} e^{-1/2(x^2+(y-x)^2+(z-y)^2)}\ -\ \frac{1}{\sqrt{6}}e^{-(\frac{1}{2}x^2\,-\,\frac{1}{4}y^2\,-\,\frac{1}{6}z^2)}

it's:

[noparse]\int_{-\infty}^{\infty}\int_{-\infty}^u\int_{-\infty}^{\infty}\int_{-\infty}^v\int_{-\infty}^{\infty}\int_{-\infty}^w f(x,y,z)\,dz dw dy dv dx du

f(x,y,z)\ =\ \frac{1}{(2\pi)^3} e^{-1/2(x^2+(y-x)^2+(z-y)^2)}\ -\ \frac{1}{\sqrt{6}}e^{-(\frac{1}{2}x^2\,-\,\frac{1}{4}y^2\,-\,\frac{1}{6}z^2)}[/noparse]
 
  • #14


hmm … so it's:

\int_{-\infty}^{\infty}\int_{-\infty}^u\int_{-\infty}^{\infty}\int_{-\infty}^v\int_{-\infty}^{\infty}\int_{-\infty}^w f(x,y,z)\,dz dw dy dv dx du

f(x,y,z)\ =\ \frac{1}{(2\pi)^\frac{3}{2}} e^{-1/2(x^2+(y-x)^2+(z-y)^2)}\ -\ \frac{1}{\sqrt{6}}e^{-(\frac{1}{2}x^2\,-\,\frac{1}{4}y^2\,-\,\frac{1}{6}z^2)}

with an extra:

[noparse]\frac{3}{2}[/noparse] :wink:
 
  • #15
Hi hypre.

As you already know this task is not so simple to solve because of multi-integration. First it is very useful and not so painful see whether first integral exists: :smile:

\Theta(u,x,v,y,w)=\int_{-\infty}^{w} f(u,x,v,y,w,z) dz = \frac{1}{2}e^{-\frac{x^2}{2}-\frac{y^3}{4}}\;\sqrt{\pi} \left(1+Erf(\frac{w}{\sqrt{6}}) \right) + <br /> \frac{1}{4\pi}\; e^{-x^2+xy-\frac{y^2}{2}} \left(1+Erf(\frac{w-y}{\sqrt{2}}) \right)<br />

Integrals would exist if u,v,w \in (-\infty,0) otherwise integrals diverge !
You can see that if above integral split on two integrals
\int_{-\infty}^{0} \Theta(u,x,v,y,w)\; dw = 0.586571 + O(10^{-6})
\int_{0}^{\infty} \Theta(u,x,v,y,w)\; dw \rightarrow \bf{\infty}

Trick how to see whether this exist to plot it. Put x=y=1 as you already know x \in (-\infty,\infty) and y \in (-\infty,\infty). I made also graph so see what is the shape of function and is attached to this answer.

If you don't understand just send me email and I will try to explain.

Enjoy :smile:
MrSnoopy
 

Attachments

  • exist1.png
    exist1.png
    13.8 KB · Views: 402
  • #16
Sorry I forgot to mention numerical solution = 0.586571 + ... comes form x=y=1. It is only to see that first has numerical solution other diverge.
 
  • #17
MrSnoopy said:
Sorry I forgot to mention numerical solution = 0.586571 + ... comes form x=y=1. It is only to see that first has numerical solution other diverge.

Thankyou very much for your efforts!

One important aspect of this integral is this: It belongs to a class of integrals which apparently diverge, but not in the real sense.

For example define two functions
f(x)\ =\ x^2 + e^{-x^2} \ and
g(x)\ =\ x^2 + e^{-2 x^2} \
then individually the two integrals:
\int_{-\infty}^\infty f(x)\ dx and \int_{-\infty}^\infty g(x)\ dx diverge but \int_{-\infty}^\infty (f(x)-g(x))\ dx = \sqrt{\pi} - \sqrt{\frac{\pi}{2}}

Similarly, the six-dimensional integral has another 3 dimension integral in the denominator (which I have not posted or mentioned earlier) such that the ratio is a finite number, in a limiting sense. I know this is a very very complicated integral, which naturally arises while solving problems in financial mathematics, so what I am interested in is, a numerical method to handle such integrals involving limiting case:

\lim_{a \rightarrow \infty} \left(\frac{\int_{-a}^a \int_{-a}^u \int_{-a}^a \int_{-a}^v \int_{-a}^a \int_{-a}^w \nu(x,y,z) \ dw\ dz\ dv\ dy\ dx\ du}{\int_{-a}^a \int_{-a}^a \int_{-a}^a \delta(x,y,z) \ dz\ dy\ dx} \right)

Kind regards and thanks to one and all.
hpriye
 
Last edited:
  • #18
No problem.

I would solved it by Simpsons method, has good accuracy at low number of steps. Don't forget functions are very quick :smile:
 
Back
Top