Re: Precision issues
- To: mathgroup at smc.vnet.net
- Subject: [mg73543] Re: Precision issues
- From: "Robert Dodier" <robert.dodier at gmail.com>
- Date: Wed, 21 Feb 2007 01:53:40 -0500 (EST)
- References: <erelv2$7ol$1@smc.vnet.net>
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? For MC (and quasi-MC, a somewhat different method) the approximate error is bounded by V(f) times D*(x_1, ..., x_n), where V(f) is the variation (in a specific technical sense) of the integrand f, and D* is the so-called star discrepancy of the points on which the integrand is evaluated. It is remarkable that the error can be decomposed into two terms such that one depends only on the integrand and the other depends only on the method. For the MC method, the expected value of the star discrepancy is sqrt((log log n)/(2 n)). If you could estimate V(f), you would be able to put an approximate bound on the error of approximation. Instead of attempting to bound the error, you could ask what is the variance of the result. For the MC method the variance is proportional to 1/n, so the standard deviation is proportional to 1/sqrt(n). Essentially you have to take 100 times as many samples to get 1 more decimal place in the result. These articles http://en.wikipedia.org/wiki/Monte_Carlo_integration http://en.wikipedia.org/wiki/Quasi-Monte_Carlo_method http://en.wikipedia.org/wiki/Low-discrepancy_sequence have more about these topics. HTH Robert Dodier