MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: N-dimensional NIntegrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79219] Re: N-dimensional NIntegrate
  • From: antononcube <antononcube at gmail.com>
  • Date: Sat, 21 Jul 2007 04:29:20 -0400 (EDT)
  • References: <f7hrme$s03$1@smc.vnet.net><f7kecj$551$1@smc.vnet.net>

I would like to point out that in Jens-Peer Kuska's example code using
version 6.0 if one uses "AdaptiveMonteCarlo" or
"AdaptiveQuasiMonteCarlo", convergence is reached (i.e. no messages):

In[233]:= myFun[x_] := Exp[-x.x/2]
With[{n = 3},
 vec = Table[Subscript[x, i], {i, 1, n}] ;
 NIntegrate[myFun[vec],
  Evaluate[Sequence @@ ({#, -Infinity, Infinity} & /@ vec)],
  Method -> "AdaptiveQuasiMonteCarlo"]
 ]

Out[234]= 15.6809


On Jul 18, 2:10 am, Jens-Peer Kuska <ku... at informatik.uni-leipzig.de>
wrote:
> Hi,
>
> myFun[x_] := Exp[-x.x/2]
>
> With[{n=3},
>    vec = Table[Subscript[x, i], {i, 1, n}]
>    NIntegrate[myFun[vec],
>     Evaluate[Sequence @@ ({#, -Infinity, Infinity} & /@ vec)],
>     Method -> "QuasiMonteCarlo"]
> ]
>
> this gives an error message about the convergence but
> this has nothing to do with the method
> to setup the integration variables.
>
> Regards
>    Jens
>
> mfed... at gmail.com wrote:
> > Hi everyone,
>
> > I want to define an N-dimensional definite integral---numerical
> > integration rather than symbolic.
>
> > Eg,
>
> > compute integral of f(x) dx
>
> > where x can be an N-vector.  I want to define the integral for general
> > N.  (Obviously before evaluating the integral, I'll specify N.)  I
> > can't think how to define the range of integration in a neat way in
> > the general case.  Eg if the variables are x_{1}, x_{2}, ... x_{N},
> > how can I specify that the integration range is
> > (say) R^{N}?
>
> > Something like
>
> >NIntegrate[ f(x), {x_{1}, -inf, inf}, {x_{2}, -inf, inf}, ..., {x_{N},
> > -inf, inf} ]
>
> > is what I want... would be neat to have x defined as a list or
> > something.
>
> > There must be a neat way to do this.   Sorry for being such an
> > amateur.
>
> > Cheers,
> > MF




  • Prev by Date: Re: Mathematica to .NET compiler
  • Next by Date: Re: graphing frequency & amplitude?
  • Previous by thread: Re: N-dimensional NIntegrate
  • Next by thread: Re: UnTableForming a TableFormed Table?