MathGroup Archive 2007

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

Search the Archive

Re: N-dimensional NIntegrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79092] Re: N-dimensional NIntegrate
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 18 Jul 2007 02:59:59 -0400 (EDT)
  • References: <f7hrme$s03$1@smc.vnet.net>

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

mfedert 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: FindRoot with complex equations and variables?
  • Next by Date: Re: GammaDistribution versus PoissonDistribution
  • Previous by thread: Re: N-dimensional NIntegrate
  • Next by thread: Re: N-dimensional NIntegrate