I’m currently getting to grips with the AdaptiveMonteCarlo method in the NIntegrate function. I’ve been using the sub-method MonteCarloRule, however I’m unsure from reading the Mathematica documentation exactly how the option Points (for this sub-method) actually works. Suppose for example I have the following integral $$\int_{0}^{\pi}\sin(x)dx $$ Then using NIntegrate I have
NIntegrate[Sin[x], {x,0,Pi}, Method->{“AdaptiveMonteCarlo”, Method->{“MonteCarloRule”, “Points”->5}, “MaxRecursion”->200}, AccuracyGoal->5, PrecisionGoal->5]
Now, I realise that I could simply use Integrate on this integral and get an exact result, but I wanted to choose a relatively simple analytic integral as practise.
Using Points->5 gives a pretty accurate result, but does specifying Points->5 mean that NIntegrate only uses 5 points in its Monte Carlo routine? I’m assuming there must be more to it than that otherwise I wouldn’t expect the result to be so close to the true result.
Any help would be much appreciated.
Pointsdoes?! Is it related toPointGenerator? – user35305 Oct 09 '17 at 19:14Pointsspecifies the number of sampling points in a single rule application. The point generator uses that option value. – Anton Antonov Oct 09 '17 at 19:27