Re: Precision issues
- To: mathgroup at smc.vnet.net
- Subject: [mg73537] Re: Precision issues
- From: Bill Rowe <readnewsciv at sbcglobal.net>
- Date: Wed, 21 Feb 2007 01:50:27 -0500 (EST)
On 2/20/07 at 6:21 AM, micky at hotmail.com (mickey) wrote:
>I am calculating certain integrals numerically and get back a
>number. Now, is it possible to determine how many digits is that
>answer accurate to?
>E.g.,
>NIntegrate[ Exp[-p^2 - q^2], {p, 0, 10}, {q, 0, 10}, Method ->
>MonteCarlo[24], MaxPoints -> 1000000]
>Gives,
>0.791249
>How many digits is this answer accurate to?
2 digits.
The documentation for NIntegrate indicates the precision goal
and accuracy defaults to 2 when the integration method is
specified to MonteCarlo.
Note, on my machine
In[6]:=
NIntegrate[Exp[-p^2-q^2],{p,0,10},{q,0,10}]
Out[6]=
0.785398
returns a more accurate answer quicker than using the MonteCarlo
method with a large number of sample points.
And given
In[9]:=
Integrate[Exp[-p^2-q^2],{p,0,Infinity},{q,0,Infinity}]
Out[9]=
Pi/4
I am very confident the answer returned by NIntegrate with the
default options is more accurate than what is being returned
with the MonteCarlo method.
--
To reply via email subtract one hundred and four