Let $N(x)$ denote the cdf of standard normal and $n(x)$ denote the pdf of standard normal.
How to evaluate the integral $\int\limits_{-\infty}^\infty N(a+x) n(x) \mathrm{d} x$ ?
Thanks a lot!
Let $N(x)$ denote the cdf of standard normal and $n(x)$ denote the pdf of standard normal.
How to evaluate the integral $\int\limits_{-\infty}^\infty N(a+x) n(x) \mathrm{d} x$ ?
Thanks a lot!
Use $\partial_a N(a+x) = n(a+x)$ and $n(-x) = n(x)$: $ \partial_a \int_{-\infty}^\infty N(a+x) n(x) \mathrm{d} x = \int_{-\infty}^\infty n(a+x) n(x) \mathrm{d} x = \int_{-\infty}^\infty n(-a-x) n(x) \mathrm{d} x = n\left(-\frac{a}{\sqrt{2}} \right)\frac{1}{\sqrt{2}} $ The last equality reflects that the the sum $Z = X+Y$ of two standard normal random variates $X$ and $Y$ is another random variable with zero mean and variance $2$. The pdf of $Z$ is a convolution of pdfs of $X$ and $Y$: $ f_Z(z) = \int_{-\infty}^\infty f_X(z-y) f_Y(y) \mathrm{d} y $ Thus: $ \int_{-\infty}^\infty N(a+x) n(x) \mathrm{d} x = \int_{-\infty}^a n\left(-\frac{b}{\sqrt{2}} \right) \frac{1}{\sqrt{2}} \mathrm{d} b = 1 - N\left(-\frac{a}{\sqrt{2}} \right) = N\left(\frac{a}{\sqrt{2}} \right) $
Check:
In[15]:= With[{a = 2/3.}, {NIntegrate[ CDF[NormalDistribution[], a + x] PDF[NormalDistribution[], x], {x, -Infinity, Infinity}], CDF[NormalDistribution[], a/Sqrt[2]]}] Out[15]= {0.681324, 0.681324}