# Monte Carlo For Integral Involving Dirac-Delta

How does one do MC for integrand which has dirac-delta function like following:

$I=\int e^{-S(x)} \delta(f(x))dx$

where $x$ would be multi-dimensional, and hence this is a multi-dimensional integral over coordinates such as $x_1,x_2,x_3$ and so on.

I want to do importance sampling. I do have my sampling distribution $g(x)$ which is nice, and closely resembles $e^{-S(x)}$. My major problem is dealing with dirac-delta. I want to do it completely using MC. In other words, I don't want to integrate out dirac-delta analytically, and perform the rest of the integrals over $x_2,x_3$, etc. by MC. Rather, everything is supposed to be done numerically using MC. Does anyone have any idea how to deal with dirac-delta distribution in monte carlo sampling methods?

• Why do you want to do it using Monte-Carlo? Jun 26, 2017 at 15:26
• because it is multi-dimensional, and also the integrand has some poles. how does one avoid poles of integrand? I am thinking of rejecting the samples that create pole when doing MC sampling. Jun 27, 2017 at 8:11
• I don't think the integrand having poles is a good reason to do Monte Carlo, in fact it's a bad reason. The sampling will never hit the pole, nor will it be able to delineate its structure by coming very close to it in a sophisticated way, like (say) tanh-sinh quadrature does. Jun 27, 2017 at 16:18

Use the identity \begin{align*} \int_{\mathbb{R}^{n}}\exp(-S(\mathbf{x})) \delta(f(\mathbf{x})) \, \mathrm{d}\mathbf{x} = \int_{f^{-1}(0) \subset \mathbb{R}^{n-1}} \frac{\exp(-S(\mathbf{x})) }{|\nabla f(\mathbf{x})|} \, \mathrm{d}\mathbf{x} \end{align*} and then use Monte-Carlo on the surface integral. The difficulty will be accurate determination of the surface $f^{-1}(0)$.
$$\delta(x) \approx \frac{1}{n\sqrt{\pi}} e^{-(x/n)^2}$$
as an approximation to the Dirac Delta, for some suitably large $n$.