Different integration results using Monte Carlo vs scipy.integrate.nquad
问题 The MWE below shows two ways of integrating the same 2D kernel density estimate, obtained for this data using the stats.gaussian_kde() function. The integration is performed for all (x, y) below the threshold point (x1, y1) , which defines the upper integration limits (lower integration limits are -infinity ; see MWE). The int1 function uses simple a Monte Carlo approach. The int2 function uses the scipy.integrate.nquad function. The issue is that int1 (ie: the Monte Carlo method) gives