Probability density function of absolute sum of normal and uniform random variables

Description of context

Given are independent random variables $n,u$ that are normally and uniformly distributed, $$n\sim\mathcal{N}_{\mu,\sigma}=\frac{1}{\sigma\sqrt{2\pi}}\text{exp}\left(-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2\right)=f(x)\ \ \ \ \ \text{ for } x\in\mathbb{R}\\ u\sim \mathcal{U}_{a,b}=\frac{1}{b-a}=g(y) \ \ \ \ \ \text{ for } y\in[a,b].$$

The probability density function of the sum of both random variables is given by the convolution

$$n+u\sim \int_{-\infty}^{\infty}f(z-s) \ g(s) \ \mathrm{d}s$$

$$=\frac{1}{2\left(a-b\right)}\left[\text{erf}\left(\frac{a+\mu-z}{\sqrt{2}\sigma}\right)-\text{erf}\left(\frac{b+\mu-z}{\sqrt{2}\sigma}\right)\right]=h(z) \ \ \ \ \ \text{ for } z\in\mathbb{R}$$

where erf is the error function.

Question

What is the probability density function of the absolute sum $\left|n+u\right|\ $?

If no general solution can be given then the special case $\mu=0,\sigma=1,b=-a,$ is of interest.

Simulation of $\boldsymbol{|n+u|}$ with $\boldsymbol{a=-1,b=1,\mu=0,\sigma=1}$

Following plot shows an histogram (red) of simulated random instances of $|n+u|$ and a fitting function (overlaid black).


Solution 1:

The pdf of $|N+U|$ can be expressed as $$ \eqalign{ & P\left( {s \le \left| {x + y} \right| < s + ds} \right) = \cr & = P\left( {s \le \left( {x + y} \right) < s + ds} \right) + P\left( { - s \le \left( {x + y} \right) < - s + ds} \right) = \cr & = \int_{t = a}^b {P\left( {s - t \le y < s - t + ds} \right)P\left( {t \le x < t + dt} \right)} + \cr & + \int_{t = a}^b {P\left( { - s - t \le y < - s - t + ds} \right)P\left( {t \le x < t + dt} \right)} = \cr & = \int_{t = a}^b {{1 \over {\sigma \sqrt {2\pi } }}e^{ - {1 \over 2} {{\left( {s - t - \mu } \right)^2 } \over {\sigma ^2 }}} ds {{dt} \over {b - a}}} + \int_{t = a}^b {{1 \over {\sigma \sqrt {2\pi } }}e^{ - {1 \over 2} {{\left( { - s - t - \mu } \right)^2 } \over {\sigma ^2 }}} ds{{dt} \over {b - a}}} = \cr & = {{ds} \over {\sigma \left( {b - a} \right)\sqrt {2\pi } }}\int_{t = a}^b {\left( {e^{ - {1 \over 2} {{\left( {s - t - \mu } \right)^2 } \over {\sigma ^2 }}} + e^{ - {1 \over 2} {{\left( { - s - t - \mu } \right)^2 } \over {\sigma ^2 }}} } \right)dt} = \cr & = {{ds} \over {\left( {b - a} \right)}}{1 \over {\sigma \sqrt {2\pi } }} \int_{t = a}^b {\left( {e^{ - {1 \over 2}{{\left( {t - \left( {s - \mu } \right)} \right)^2 } \over {\sigma ^2 }}} + e^{ - {1 \over 2}{{\left( {t - \left( { - s - \mu } \right)} \right)^2 } \over {\sigma ^2 }}} } \right)dt} = \cr & = {{ds} \over {\left( {b - a} \right)}}\left( {{1 \over {\sqrt {2\pi } }} \int_{t = {{a - \left( {s - \mu } \right)} \over \sigma }}^{{{b - \left( {s - \mu } \right)} \over \sigma }} {\left( {e^{ - {1 \over 2}x^2 } } \right)dx} + {1 \over {\sqrt {2\pi } }} \int_{t = {{a - \left( { - s - \mu } \right)} \over \sigma }}^{{{b - \left( { - s - \mu } \right)} \over \sigma }} {\left( {e^{ - {1 \over 2}x^2 } } \right)dx} } \right) = \cr & = {{ds} \over {\left( {b - a} \right)}}\left( {\Phi \left( {{{b - s + \mu } \over \sigma }} \right) - \Phi \left( {{{a - s + \mu } \over \sigma }} \right) + \Phi \left( {{{b + s + \mu } \over \sigma }} \right) - \Phi \left( {{{a + s + \mu } \over \sigma }} \right)} \right) = \cr & = {{ds} \over {2\left( {b - a} \right)}}\left( {{\rm erf}\left( {{{b + \mu + s} \over {\sigma \sqrt 2 }}} \right) + {\rm erf}\left( {{{b + \mu - s} \over {\sigma \sqrt 2 }}} \right) - \left( {{\rm erf}\left( {{{a + \mu + s} \over {\sigma \sqrt 2 }}} \right) + {\rm erf}\left( {{{a + \mu - s} \over {\sigma \sqrt 2 }}} \right)} \right)} \right) \cr} $$

and this is the graph made with Geogebra

Dist_N+U_2