# Probability that the absolute value of a normal distribution is greater than another

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|$$?

• When you sketch a graph of the event in the title, you will see how it can be expressed in terms of infinite sectors at the origin. In terms of $X/a$ and $Y/b,$ which are standard Normal, these sectors are still sectors--but now, because of the rotational invariance of the binormal distribution, their probabilities equal their angles (as a fraction of the full circle). Thus, just by looking at this plot you can write down the answer.
– whuber
Jan 15 at 23:57
• At first glance, I would think that it follows a skew normal distribution Jan 16 at 0:01
• 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$. Jan 16 at 3:12
• 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. Jan 16 at 13:50
• This is not a homework problem. Simply a problem that came up in work that I have been thinking about. Jan 16 at 20:31

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). 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*}$$

• 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.) Jan 16 at 7:37
• @BruceET Yes, thank you! Where was my brain? Jan 16 at 17:04