How is this inverse function calculated? (Laplace distribution) In Wikipedia's article about the subject, there is a closed expression for the inverse of the cumulative distribution function. I don't really know how to get to this, because I don't know how to find the inverse of something containing the $sgn(x)$ function or the absolute value.
How is it deduced?
 A: $\DeclareMathOperator{sgn}{sgn}$
The function to be inverted is
$$
\begin{align}
F(x) 
&= \int_{-\infty}^x \!\!f(u)\,\mathrm{d}u  
= 
\begin{cases}
\frac12 \exp \left( \frac{x-\mu}{b} \right) & \mbox{if }x < \mu \\
1-\frac12 \exp \left( -\frac{x-\mu}{b} \right) & \mbox{if }x \geq \mu
\end{cases} \\
&= \tfrac{1}{2} + \tfrac{1}{2} \sgn(x-\mu) \left( 1-\exp \left( -\frac{|x-\mu|}{b} \right) \right) \\
&= y
\end{align}
$$
with $b > 0$. We start using the case distinctions.
For $x \ge \mu$:
$$
y = 1-\frac12 \exp \left( -\frac{x-\mu}{b} \right) \iff \\
\exp \left( -\frac{x-\mu}{b} \right) = 2(1-y) \iff \\
-\frac{x-\mu}{b} = \ln(2(1-y)) \iff \\
x = \mu - b \ln(2-2y)
$$
For $x < \mu$:
$$
y = \frac12 \exp \left( \frac{x-\mu}{b} \right) \iff \\
\exp \left( \frac{x-\mu}{b} \right) = 2 y \iff \\
\frac{x-\mu}{b} = \ln(2y) \iff \\
x = \mu + b \ln(2y)
$$
We can combine into
$$
x = \mu - \sgn(x - \mu) b \ln(1 + \sgn(x - \mu) - \sgn(x - \mu) 2 y)
$$
Comparing with Wikipedia:
$$
F^{-1}(p) = \mu - b\,\sgn(p-0.5)\,\ln(1 - 2|p-0.5|)
$$
The terms are equal, if $\sgn(x - \mu) = \sgn(y-0.5)$.
For $x \ge \mu$ we had
$$
0 \le -b \ln(2-2y) \iff \\
0 \ge \ln(2 - 2y) \iff \\
2 - 2 y \le 1 \iff \\
1 - y \le 1/2 \iff \\
-y \le -1/2 \iff \\
y \ge 1/2
$$
For $x < \mu$ we had
$$
0 > x - \mu = b \ln(2y) \iff \\
0 > \ln(2y) \iff \\
2y < 1 \iff \\
y < 1/2
$$
So indeed $\sgn(x-\mu) = \sgn(y - 1/2)$.
