Greatly appreciate anyone that is willing to Help. I am thinking about the question of comparing the absolute value of normal distributions. Given $a > b$, $X$ ~ $N(0,a)$ and $Y$ ~ $N(0,b)$, what is the distribution of $|X| - |Y|$?

  • $\begingroup$ At first glance, I would think that it follows a skew normal distribution $\endgroup$
    – user277126
    Jan 16, 2022 at 0:01
  • $\begingroup$ The only difficulty is considering the bounds of integration. We know that $|X|$ and $|Y|$ are in the first quadrant of the $|X|,|Y|$ plot. Drawing the line $|Y|=|X|-z$ when $z \ge 0$, we should integrate first with respect to $|X|$ from $0$ to $|Y|+z$ and then with respect to $|Y|$ from $0$ to $\infty$. Drawing the line $|Y|=|X|-z$ when $z \lt 0$, we should integrate first with respect to $|Y|$ from $|X|-z$ to $\infty$ and then with respect to $|X|$ from $0$ to $\infty$. $\endgroup$
    – user277126
    Jan 16, 2022 at 3:12
  • $\begingroup$ Please add the self-study tag & read its wiki. Then tell us what you understand thus far, what you've tried & where you're stuck. We'll provide hints to help you get unstuck. Please make these changes as just posting your homework & hoping someone will do it for you is grounds for closing. $\endgroup$ Jan 16, 2022 at 13:50
  • $\begingroup$ This is not a homework problem. Simply a problem that came up in work that I have been thinking about. $\endgroup$ Jan 16, 2022 at 20:31

1 Answer 1


It may be shown that $|X| \sim HN(a)$ and $|Y| \sim HN(b)$, where $HN(\cdot)$ represents a half-normal distribution. For completeness, the probability density functions of $|X|$ and $|Y|$ are \begin{eqnarray*} f_{|X|} (x) &=& \frac{\sqrt{2}}{a\sqrt{\pi}} \exp \left(-\frac{x^2}{2a^2}\right), \quad x>0 \\ f_{|Y|} (y) &=& \frac{\sqrt{2}}{b\sqrt{\pi}} \exp \left(-\frac{y^2}{2b^2}\right), \quad y>0. \end{eqnarray*} It is also useful to note that if $W \sim HN(\sigma)$, then the moment generating function of $W$ is \begin{eqnarray*} \mbox{E} \left[\exp \left(tW\right) \right] = 2 \exp \left(\frac{\sigma^2 t^2}{2}\right) \Phi \left(\sigma t\right), \end{eqnarray*} where $\Phi (\cdot)$ denotes the CDF of the standard normal distribution.

We wish to find the distribution of $Z = |X| - |Y|$. By definition, the CDF of $Z$ of is defined as \begin{eqnarray*} F_{Z} (z) = \int_{0}^{\infty}\int_{0}^{\infty} f_{|X|} (x) f_{|Y|} (y) \mbox{I} \left[x-y \le z\right] \mbox{d}x \mbox{d}y, \end{eqnarray*} where $\mbox{I} \left[\cdot\right]$ denotes the indicator function. Note that the double integral takes place in the first quadrant and the indicator function specifies all points above the line $y = x-z$. Now if $z \ge 0$, this line will intersect the $x$-axis, otherwise it will intersect the $y$-axis. Now ordering the integration appropriately will greatly simplify the double integral. See the following plots where the dark black line denotes $y=x-z$ and the red lines denote the direction and bounds of integration (albeit not extended indefinitely). enter image description here

Therefore, we can write the CDF of $Z$ as \begin{eqnarray*} F_{Z} (z) = \mbox{I} \left[z \ge 0 \right]\int_{0}^{\infty}\int_{0}^{y+z} f_{|X|} (x) f_{|Y|} (y) \mbox{d}x \mbox{d}y + \mbox{I} \left[z \lt 0 \right]\int_{0}^{\infty}\int_{x-z}^{\infty} f_{|X|} (x) f_{|Y|} (y) \mbox{d}y \mbox{d}x. \end{eqnarray*}

In the first double integral, consider the change of variables from $(x,y)$ to $(v,y)$, where $v=x-y$. The Jacobian of this transformation is $1$. The transformation is useful since it removes the occurrence of $y$ in the bound of integration when differentiating with respect to $v$. A similar transformation was defined for the second double integral. Plugging these values in, we obtain \begin{eqnarray*} F_{Z} (z) = \mbox{I} \left[z \ge 0 \right]\int_{0}^{\infty} f_{|Y|} (y) \int_{-\infty}^{z} f_{|X|} (v+y) \mbox{d}v \mbox{d}y + \mbox{I} \left[z \lt 0 \right]\int_{0}^{\infty} f_{|X|} (x) \int_{-\infty}^{z} f_{|Y|} (x-v) \mbox{d}v \mbox{d}x. \end{eqnarray*}

By Leibniz's integral rule (or the fundamental theorem of calculus), the PDF of $Z$ is \begin{eqnarray*} f_{Z} (z) &=& \mbox{I} \left[z \ge 0 \right]\int_{0}^{\infty} f_{|Y|} (y) f_{|X|} (z+y) \mbox{d}y + \mbox{I} \left[z \lt 0 \right]\int_{0}^{\infty} f_{|X|} (x) f_{|Y|} (x-z) \mbox{d}x \\ &=& \mbox{I} \left[z \ge 0 \right]\int_{0}^{\infty} f_{|Y|} (y) f_{|X|} (y+|z|) \mbox{d}y + \mbox{I} \left[z \lt 0 \right]\int_{0}^{\infty} f_{|X|} (x) f_{|Y|} (x+|z|) \mbox{d}x. \end{eqnarray*}

These integrals may be solved quite simply by making use of the moment generating function result. I shall only solve the first one. \begin{eqnarray*} \int_{0}^{\infty} f_{|Y|} (y) f_{|X|} (y+|z|) \mbox{d}y &=& \frac{2}{ab \pi}\exp \left(-\frac{z^2}{2a^2} \right) \int_{0}^{\infty} \exp \left(-\frac{|z|}{a^2} y \right) \exp \left(-\frac{y^2}{2} \left[\frac{1}{a^2}+\frac{1}{b^2}\right] \right) \mbox{d}y. \end{eqnarray*} Now the second term within the integral is proportional to a $HN(\sigma)$ PDF with $\sigma^2 = \frac{a^2b^2}{a^2+b^2}$ and the first term is of the form of the MGF with $t = - \frac{|z|}{a^2}$. Hence, multiplying and dividing by the proportionality constant, $\frac{\sqrt{2}\sqrt{a^2+b^2}}{ab\sqrt{\pi}}$, it may be shown that the above reduces to \begin{eqnarray*} 2 \sqrt{\frac{2}{\pi}} (a^2+b^2)^{(-.5)} \exp \left(-\frac{z^2}{2(a^2+b^2)} \right) \Phi \left(-\frac{b}{a} \frac{|z|}{\sqrt{a^2+b^2}}\right). \end{eqnarray*} Making use of the standard normal PDF $ \phi(\cdot)$, the above can be written as \begin{eqnarray*} \frac{4}{\sqrt{a^2+b^2}} \phi\left(\frac{z}{\sqrt{a^2+b^2}}\right)\Phi \left(-\frac{b}{a} \frac{|z|}{\sqrt{a^2+b^2}}\right). \end{eqnarray*} Solving for the other portion of the PDF of $Z$, one will result in the equation \begin{eqnarray*} f_Z (z) = \begin{cases} \frac{4}{\sqrt{a^2+b^2}} \phi\left(\frac{z}{\sqrt{a^2+b^2}}\right)\Phi \left(-\frac{b}{a} \frac{|z|}{\sqrt{a^2+b^2}}\right), & \mbox{for } z \ge 0 \\ \frac{4}{\sqrt{a^2+b^2}} \phi\left(\frac{z}{\sqrt{a^2+b^2}}\right)\Phi \left(-\frac{a}{b} \frac{|z|}{\sqrt{a^2+b^2}}\right), & \mbox{for } z \lt 0 \end{cases}. \end{eqnarray*}

  • $\begingroup$ After the 2nd display, did you mean to say $\Phi(\cdot)$ is the CDF of a standard normal distribution? (This, from possibly the site's most prolific maker of typos.) $\endgroup$
    – BruceET
    Jan 16, 2022 at 7:37
  • $\begingroup$ @BruceET Yes, thank you! Where was my brain? $\endgroup$
    – user277126
    Jan 16, 2022 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.