Tutorials › Statistical Theory I - Probability and Distribution Theory › Absolute-Value Transformations

Many-to-One Transformations · Tutorial 423 of 994

Absolute-Value Transformations

Learn how the distribution of an absolute value combines probabilities from both signs, including when the input law is asymmetric or has an atom at zero.

Intermediate 9 min read

What You'll Learn

  • Express the CDF of an absolute-value transformation using the two endpoints of an interval.
  • Derive the density on the positive half-line from the positive and negative branches.
  • Account for an atom at zero and distinguish it from the continuous density.
  • Calculate absolute-value distributions for asymmetric normal and uniform inputs.
  • Identify when two branch densities may, and may not, be treated as equal.

Why Absolute Values Combine Two Branches

Taking an absolute value discards the sign of a random variable. A positive output \(y\) can therefore arise from either \(X=y\) or \(X=-y\). Its probability distribution must account for both possibilities. This is the simplest many-to-one transformation, but it is also a useful setting for seeing why a transformed density is generally a sum over inverse branches rather than a single transformed copy of the original density.

Write \(Y=|X|\). Then \(Y\) is nonnegative, and the event \(Y\le y\), for \(y\ge 0\), is the event that \(X\) lies between \(-y\) and \(y\). This interval description gives the CDF directly, including at zero where a point mass can be present. For a continuous input density, the two inverse branches give the density of \(Y\) at positive values.

Definition: Let \(X\) be a real-valued random variable and define \(Y=|X|\). For \(y\ge 0\), the value \(y\) has inverse branches \(x=y\) and \(x=-y\); for \(y=0\), these branches coincide at \(x=0\). The distribution of \(Y\) is the probability law induced by this transformation.

The CDF, Including at Zero

For any distribution of \(X\), define the left limit of its CDF by \(F(t-)=P(X<t)\). The left limit matters because the interval \([-y,y]\) includes its left endpoint. Subtracting \(P(X<-y)\), rather than \(P(X\le -y)\), retains any probability mass at \(-y\).

Theorem: For \(Y=|X|\), its CDF \(F_Y\) satisfies $$ F_Y(y)= \begin{cases} 0, & y<0,\\ F(y)-F((-y)-), & y\ge 0. \end{cases} $$ In particular, \(P(Y=0)=P(X=0)=F(0)-F(0-)\).

Proof. Since \(Y\ge 0\), \(P(Y\le y)=0\) for \(y<0\). If \(y\ge 0\), then $$ \{Y\le y\}=\{|X|\le y\}=\{-y\le X\le y\}. $$ The probability of this interval is the probability of \(X\le y\) minus the probability of \(X<-y\). Thus $$ F_Y(y)=P(X\le y)-P(X<-y)=F(y)-F((-y)-). $$ At \(y=0\), the interval is the singleton \(\{0\}\), so \(F_Y(0)=P(X=0)=F(0)-F(0-)\). \(\square\)

This formula also describes distributions with atoms away from zero. For \(a>0\), the event \(Y=a\) occurs exactly when \(X=a\) or \(X=-a\); these events are disjoint, so $$ P(Y=a)=P(X=a)+P(X=-a). $$ At \(a=0\), there is only one preimage, not two: \(P(Y=0)=P(X=0)\). The distinction is important when the input distribution is not purely continuous.

Density From the Positive and Negative Branches

Suppose the law of \(X\) consists of an atom of mass \(p_0=P(X=0)\) at zero and a density \(f\) on the rest of the real line, with no other atoms. The density is understood up to changes on sets of Lebesgue measure zero, and its integral over the real line is \(1-p_0\). For a positive output \(y\), the input can be at either \(y\) or \(-y\). The absolute value of the derivative of either inverse branch is \(1\), so the two contributions add without any further scaling.

Theorem: Under the preceding assumptions, \(Y=|X|\) has an atom of mass \(p_0\) at zero and has density, for \(y>0\), $$ f_Y(y)=f(y)+f(-y). $$ The density is zero for \(y<0\). In particular, $$ p_0+\int_0^\infty \bigl(f(y)+f(-y)\bigr)\,dy=1. $$

Proof. Let \(A\) be any Borel subset of \((0,\infty)\). The event \(\{|X|\in A\}\) is the disjoint union of \(\{X\in A\}\) and \(\{X\in -A\}\), where \(-A=\{-a:a\in A\}\). The atom at zero contributes nothing because \(A\) contains only positive values. Therefore $$ P(Y\in A)=\int_A f(x)\,dx+\int_{-A}f(x)\,dx. $$ In the second integral, substitute \(x=-u\). Reflection maps \(-A\) to \(A\), and the absolute Jacobian is \(1\), giving $$ P(Y\in A)=\int_A f(u)\,du+\int_A f(-u)\,du =\int_A\bigl(f(u)+f(-u)\bigr)\,du. $$ This establishes the stated density on the positive half-line. The only possible atom under the assumptions is the input atom at zero, which maps to zero. Finally, the positive and negative half-lines partition the input values other than zero, so $$ \int_0^\infty f(y)\,dy+\int_0^\infty f(-y)\,dy =\int_{\mathbb R\setminus\{0\}} f(x)\,dx=1-p_0. $$ Adding the atom \(p_0\) proves the normalization claim. \(\square\)

If \(X\) has a symmetric density, then \(f(-y)=f(y)\), and the formula simplifies to \(f_Y(y)=2f(y)\) for \(y>0\). Symmetry is essential for that simplification. In general, each branch contributes its own density value.

Worked Example: An Asymmetric Uniform Input

Let \(X\sim\operatorname{Uniform}(-2,1)\). Its density is \(f(x)=1/3\) for \(-2<x<1\), and zero otherwise. This input is asymmetric about zero because its support extends two units to the left but only one unit to the right. Find the density and CDF of \(Y=|X|\).

For \(0<y<1\), both inverse points \(y\) and \(-y\) lie in \((-2,1)\), so $$ f_Y(y)=f(y)+f(-y)=\frac13+\frac13=\frac23. $$ For \(1<y<2\), \(y\) lies outside the support while \(-y\in(-2,-1)\), so $$ f_Y(y)=0+\frac13=\frac13. $$ For \(y>2\), neither inverse point is in the support, giving density zero. Thus, apart from immaterial choices at the breakpoints, $$ f_Y(y)= \begin{cases} \frac23, & 0<y<1,\\ \frac13, & 1<y<2,\\ 0, & y>2. \end{cases} $$

There is no atom at zero, and the density integrates to $$ \int_0^1\frac23\,dy+\int_1^2\frac13\,dy =\frac23+\frac13=1. $$ Integrating from zero gives the CDF $$ F_Y(y)= \begin{cases} 0, & y<0,\\ \frac{2y}{3}, & 0\le y\le 1,\\ \frac23+\frac{y-1}{3}=\frac{y+1}{3}, & 1<y\le 2,\\ 1, & y>2. \end{cases} $$ For instance, \(P(Y\le 1)=2/3\), which also follows directly from \(P(-1\le X\le1)\): the interval has length \(2\) out of the total support length \(3\).

Worked Example: A Shifted Normal Input

Let \(X\sim N(1,1)\), so its density is \(f(x)=(2\pi)^{-1/2}\exp(-(x-1)^2/2)\). The input is not symmetric about zero. For \(y>0\), the density of \(Y=|X|\) is $$ f_Y(y)=f(y)+f(-y) =\frac{1}{\sqrt{2\pi}}\left[ e^{-(y-1)^2/2}+e^{-(y+1)^2/2} \right]. $$ The second exponent follows because \((-y-1)^2=(y+1)^2\).

At \(y=1\), $$ f_Y(1)=\frac{1}{\sqrt{2\pi}}\left(1+e^{-2}\right) \approx 0.3989423(1+0.1353353) \approx 0.4529333. $$ The negative branch contributes less than the positive branch here; replacing the sum by twice \(f(1)\) would therefore be incorrect.

The CDF at \(1\) is found from the interval \([-1,1]\): $$ P(Y\le1)=P(-1\le X\le1) =\Phi(0)-\Phi(-2) =0.5000000-0.0227501 \approx 0.4772499, $$ where \(\Phi\) is the standard normal CDF. This calculation checks the interval interpretation directly; the density formula instead describes the local probability near a positive value.

Worked Example: A Continuous Part and an Atom at Zero

Suppose \(P(X=0)=0.2\), and with probability \(0.8\), \(X\) has the uniform distribution on \((-1,2)\). The continuous component has unconditional density \(0.8/3=4/15\) on \((-1,2)\). It is important to use this unconditional density in the transformation formula: it already accounts for the probability \(0.8\) of belonging to the continuous component.

The atom maps to zero unchanged, so \(P(Y=0)=0.2\). For \(0<y<1\), both \(y\) and \(-y\) are in the continuous component's support, giving $$ f_Y(y)=\frac{4}{15}+\frac{4}{15}=\frac{8}{15}. $$ For \(1<y<2\), \(y\) remains in the support but \(-y\) does not, so \(f_Y(y)=4/15\). For \(y>2\), the density is zero.

The continuous mass is $$ \int_0^1\frac{8}{15}\,dy+\int_1^2\frac{4}{15}\,dy =\frac{8}{15}+\frac{4}{15}=\frac{12}{15}=0.8. $$ Together with the atom, the total probability is \(0.8+0.2=1\). For \(0\le y\le1\), the CDF is \(F_Y(y)=0.2+8y/15\), so \(F_Y(0)=0.2\), as required. For \(1<y\le2\), it is \(0.2+8/15+4(y-1)/15\), reaching \(1\) at \(y=2\).

Common Mistake and Practical Significance

A frequent error is to write \(f_Y(y)=2f(y)\) for every continuous input. That reasoning silently assumes \(f(-y)=f(y)\), or in other words that the input density is symmetric about zero. The correct general expression is \(f_Y(y)=f(y)+f(-y)\) for \(y>0\). Another error is to assign a density value at zero and treat it as the probability \(P(Y=0)\). A density describes probabilities through integration; a point mass is a separate part of the distribution. In the mixed example, the density on positive values and the atom at zero must both be reported.

  • For a general CDF: use \(F_Y(y)=F(y)-F((-y)-)\) for \(y\ge0\), keeping endpoint masses.
  • For a density on positive values: add the contributions from \(y\) and \(-y\).
  • At zero: the two branches coincide, so \(P(Y=0)=P(X=0)\), not twice that probability.

Absolute values arise whenever sign is irrelevant but magnitude matters, such as a measurement error's size or a distance from a reference point. The distribution of that magnitude can still reflect an asymmetric input: the positive and negative sides may contribute different amounts. Keeping the branches separate until their contributions are added preserves that information and avoids unjustified symmetry assumptions.

Check Your Understanding

Use the interval CDF formula and the two-branch density rule where appropriate.

  1. For an arbitrary random variable \(X\), express \(P(|X|\le y)\) in terms of \(F\) for \(y\ge0\). Why does the expression use a left limit at \(-y\)?
  2. If \(X\) has a density \(f\) and no atoms, what is the density of \(|X|\) for \(y>0\)? State the extra condition under which it simplifies to \(2f(y)\).
  3. Suppose \(P(X=0)=0.1\), and the rest of the law has density \(0.9/4\) on \((-3,1)\). What is the atom at zero of \(|X|\), and what is its density on \(0<y<1\)?
  4. If \(P(X=2)=0.07\) and \(P(X=-2)=0.12\), what is \(P(|X|=2)\)?
  5. Explain why a density formula on \(y>0\) does not by itself describe the full distribution when \(P(X=0)>0\).