How to compute integrals using any probability law with Monte Carlo?

45 Views Asked by At

I am intrested in providing an estimation of :

$\iint C(x,y)dP_X(x)dP_Y(y)$

I am able to generate random numbers from the distribution of $P_Y$ and $P_X$. Therefore I generate a big number (n=10 000) of realizations from those distribution I obtain $x_1,...,x_n $~$P_X $ and $y_1,...,y_n$~$P_Y $ and compute

$\frac{1}{n^2}\sum_{i,j} C(x_i,y_j) $

I wonder if that method is correct as I could not find precise examples on this topic.

Thank you for any help