2

I am interested in evaluating the following integral for a general value of $\mu \in \mathbb{R}$: $$ I(\mu) = \int_{-\infty}^{\infty} \frac{2 e^{-0.5 (x - \mu)^2}}{e^{-0.5 (x - 1)^2} + e^{-0.5 (x + 1)^2}} \cdot \frac{1}{\sqrt{2\pi}} e^{-0.5 x^2} \, dx $$

The integrand combines a shifted normal distribution with a more complex term involving both $e^{(x - 1)^2}$ and $e^{(x + 1)^2}$ in the denominator (basically a likelihood ratio of a shifted Gaussian and the mixture of two unit-variance Gaussians with mean +1 and -1). I have already derived that $I(1) = 1$. Here is a brief outline of this derivation:

By adding and subtracting 1 from the integrand, I can rewrite the integral as: $$ I(1) = \int_{-\infty}^{\infty} \left( \frac{2 e^{-0.5 (x - 1)^2}}{e^{-0.5 (x - 1)^2} + e^{-0.5 (x + 1)^2}} - 1 + 1 \right) \cdot \frac{1}{\sqrt{2\pi}} e^{-0.5 x^2} \, dx $$

Separating terms, this becomes: $$ I(1) = \int_{-\infty}^{\infty} \left( \frac{2 e^{-0.5 (x - 1)^2}}{e^{-0.5 (x - 1)^2} + e^{-0.5 (x + 1)^2}} - 1 \right) \cdot \frac{1}{\sqrt{2\pi}} e^{-0.5 x^2} \, dx + \int_{-\infty}^{\infty} \frac{1}{\sqrt{2\pi}} e^{-0.5 x^2} \, dx $$

The first integral contains an odd function (integrating to zero over $(-\infty, \infty)$), while the second integral is the standard normal density, integrating to 1. Hence, $I(1) = 1$.

I am now interested in computing $I(\mu)$ for general $\mu$ or understanding its behavior as $\mu$ varies. Are there methods (e.g. connections to special functions) that could help in evaluating or approximating this integral for general $\mu$?

I have already computed the integral using Monte Carlo methods. I found that $I(\mu) < 1$ for $|\mu| > 1$ and $I(\mu) > 1$ for $|\mu| < 1$. I would particularly be interested in proving the former claim mathematically. I already had a look at the derivative of $f$ as this could help showing this claim but this is still a complicated integral.

Any insights would be greatly appreciated!

Stan
  • 201
  • 1
    hi stan, you wouldn't be looking for this integral $I(\mu) = \int_{-\infty}^{\infty} \frac{2 e^{-0.5 (x - \mu)^2}}{e^{-0.5 (x - \mu)^2} + e^{-0.5 (x + \mu)^2}} \cdot \frac{1}{\sqrt{2\pi}} e^{-0.5 x^2} , dx$? instead of $I(\mu) = \int_{-\infty}^{\infty} \frac{2 e^{-0.5 (x - \mu)^2}}{e^{-0.5 (x - 1)^2} + e^{-0.5 (x + 1)^2}} \cdot \frac{1}{\sqrt{2\pi}} e^{-0.5 x^2} , dx$ – Amrut Ayan Nov 11 '24 at 20:58
  • @AmrutAyan that case is similar to the $\mu = 1$ case indeed (the proof also holds for general $\mu$). However, I am particularly interested in this integral when the term in the numerator has a different exponent as in the denominator (as in the question). I think this case is more challenging. – Stan Nov 11 '24 at 21:02
  • 1
    thanks, understood, had it been the former case, its quite straight forward with the integrand greatly simplied.. – Amrut Ayan Nov 11 '24 at 21:04
  • 1
    FWIW one cannot do better than the posted answer. Your integral is related to what are known as Mordell integrals. See my this old question of mine here and the comments and linked questions for more information on this. – KStar Nov 14 '24 at 09:25
  • @KStar thanks a lot! Do you have any insights about how to prove that $I(\mu) < 1$ for $\mu > 1$? From Monte Carlo approximation, I can see this is true but I am not able to derive it analytically. – Stan Nov 14 '24 at 14:19
  • 1
    @Stan I believe one should be able to follow a similar process to this which should in fact be simpler in your case but I haven't had time to try that yet. – KStar Nov 14 '24 at 14:49

1 Answers1

1

I don't have enough reputation to post this as a comment, so I'll post it here as I believe it might be useful. Modulo possible math mistakes on my side, I believe you can rewrite to obtain:

\begin{align} I(\mu) &= \int_{-\infty}^{\infty} \frac{2e^{-\frac{1}{2}(x-\mu)^2}}{e^{-\frac{1}{2}(x-1)^2}+e^{-\frac{1}{2}(x+1)^2}} \frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}x^2}dx \\ &= e^{\frac{1}{2}} \int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}\frac{2e^{-\frac{1}{2}(x-\mu)^2}}{e^{x}+e^{-x}}dx \\ &= e^{\frac{1}{2}}\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}\mathrm{sech}(x)e^{-\frac{1}{2}(x-\mu)^2}dx \\ &= e^{\frac{1}{2}}\mathbb{E}[\mathrm{sech}(X)], \end{align} where the expectation is with respect to a Gaussian $X\sim\mathcal{N}(\mu,1)$. It shows $I(\mu) = I(-\mu)$ by symmetry.

With the alternative expression, Expected value of the sech of a normal random variable seems relevant.