2
$\begingroup$

Consider the example

NIntegrate[UnitStep[9-x^2-y^2],{x,0,xmax},{y,0,ymax},Method->"QuasiMonteCarlo"]

If xmax = ymax = 3, the answer is meaningful. If xmax = ymax = 100, the answer is slightly smaller, while for xmax = ymax = 1000, the answer is zero. This means that QuasiMonteCarlo method evaluates the integral to zero if in most part of the integration domain the integrand is zero.

Could you please tell me whether there is some way to fix this problem?

$\endgroup$
1
  • 2
    $\begingroup$ The chance that a random point thrown into a square of size $1000 \times 1000$ to land in the quarter of the disk of radius 3 is about 7.06858*10^-6. So if it comes to Monte Carlo methods, that just does never happen. $\endgroup$ Oct 5, 2018 at 22:37

1 Answer 1

4
$\begingroup$
xmax = ymax = 1000;
NIntegrate[UnitStep[9 - x^2 - y^2], {x, 0, xmax}, {y, 0, ymax}, 
 Method -> {"QuasiMonteCarlo", "SymbolicProcessing" -> True}]

7.06875

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.