What is the PDF of the difference of two i.i.d Laplace distributed random variables?

I know that the difference of two i.i.d Normal variables is still the Normal distribution. Since the properties of the Laplace distribution are similar to the Normal distribution, I am guessing that the difference is also the Laplace distribution.

I have tried to solve this using Mathematica. Neither PDF nor Integrate functions give a correct answer. Thank you!

  • $\begingroup$ In Mathematica, you could try PDF[TransformedDistribution[x - y, {x \[Distributed] LaplaceDistribution[a, b], y \[Distributed] LaplaceDistribution[c, d]}],x]. $\endgroup$ Jun 1, 2014 at 9:55
  • $\begingroup$ It is not trivial. Each Laplace rv can be written as difference between two iid exponential rvs, so you are basically hunting the distribution of the difference of two iid Gamma rvs with shape 2. From here, you can follow stats.stackexchange.com/questions/48378/… for a representation by Bessel functions etc. $\endgroup$
    – Michael M
    Jun 1, 2014 at 10:08
  • 2
    $\begingroup$ In general, you can't argue by vague analogy to a successful conclusion. Occasionally one gets lucky, but usually it doesn't work that way. $\endgroup$
    – Glen_b
    Jun 1, 2014 at 12:28
  • 1
    $\begingroup$ Since I wrote the stuff about Bessel functions etc in an answer to the question pointed out by @MichaelMayer, let me add that for the special case of iid Gamma rvs with shape parameter $2$, no Bessel functions come up because we are evaluating integrals of the form $$f_{X-Y}(z)= \int_{0}^\infty (y+z)\exp(-(y+z))\cdot y\exp(-y)\,\mathrm dy$$ which can be evaluated without resorting to Bessel functions; Gamma functions, or even more simply, factorials, suffice. $\endgroup$ Jun 1, 2014 at 14:16
  • $\begingroup$ Mathematica assumes all variables are complex by default, which can make some calculations difficult. Therefore when working with known real numbers you should explicitly state that fact, as in With[{f = PDF[LaplaceDistribution[0, 1]]}, Integrate[f[x] f[x - y], {x, -Infinity, Infinity}, Assumptions -> y \[Element] Reals]]. This obtains a full and correct solution in a half second. $\endgroup$
    – whuber
    Jul 7, 2014 at 19:37

1 Answer 1


The density of the difference of independent random variables $X$ and $Y$ is given by $$f_{X-Y}(z) = \int_{-\infty}^\infty f_X(x)f_Y(x-z)\,\mathrm dx.$$ For iid Laplacian random variables, with $z>0$, this becomes $$\begin{align}4f_{X-Y}(z) &= \int_{-\infty}^\infty \exp(-|x|)\exp(-|x-z|)\,\mathrm dx\\ &=\int_{-\infty}^0 \exp(x)\exp(x-z)\,\mathrm dx + \int_0^z \exp(-x)\exp(x-z)\,\mathrm dx\\ &\qquad\qquad\qquad+\int_z^\infty \exp(-x)\exp(-(x-z))\,\mathrm dx\\ &= \frac 12\exp(-z) + z\exp(-z)+\frac 12 \exp(-2z)\exp(z)\\ &= \exp(-z)+z\exp(-z). \end{align}$$ Since the symmetry about the origin of the pdfs of $X$ and $Y$ implies that pdf of their difference is also symmetric about the origin, we get that $$\begin{align} f_{X-Y}(z) &= \left.\left.\frac 14\right[\exp(-|z|) + |z|\exp(-|z|)\right], \quad -\infty < z < \infty \tag{1}\\ &= \frac 12\left[\frac 12\exp(-|z|) + \frac 12|z|\exp(-|z|)\right], \quad -\infty < z < \infty \tag{2} \end{align}$$ where in $(2)$ we can recognize that on the positive real line, the density is one-half of a mixture density with equal weights, where the mixture is that of an exponential random variable and a Gamma random variable with shape parameter $2$, and of course, this is all reflected on the negative real line.

Alternatively, as pointed out in my comment on the question, for $z > 0$, a different answer of mine arrives at $$\begin{align} f_{X-Y}(z) &= \int_{0}^\infty (y+z)\exp(-(y+z))\cdot y\exp(-y)\,\mathrm dy\\ &= \exp(-z)\int_0^\infty (y^2+zy)\exp(-2y)\,\mathrm dy\\ &= \frac 12\exp(-z)\int_0^\infty \left(\frac{x^2}{4}+z\frac{x}2\right)\exp(-x) \,\mathrm dx\\ &= \frac 12\exp(-z) \left(\frac{\Gamma(3)}{4}+z\frac{\Gamma(2)}{2}\right)\\ &= \left.\left.\frac 14 \right[\exp(-z) + z\exp(-z)\right] \end{align}$$ by recognizing (as pointed out by Michael Mayer) that a Laplacian density is the density of the difference of two exponential random variables, and so regrouping $$(X_1-X_2)-(X_3-X_4) = (X_1+X_4)-(X_2+X_3)$$ allows us to compute the desired density as that of the difference of two Gamma random variables of shape parameter $2$.

  • 1
    $\begingroup$ Thanks for your answer! After my calculation, if $X \sim Laplace(\mu_1, b_1)$ and $Y \sim Laplace(\mu_2, b_2)$, the PDF of $Z=X-Y$ will be $$ \begin{align} f(z) &= \frac{b_1}{2(b_1^2-b_2^2)} e^{-\frac{|z-(\mu_1-\mu_2)|}{b_1} }-\frac{b_2}{2(b_1^2-b_2^2)} e^{-\frac{|z-(\mu_1-\mu_2)|}{b_2}}\\ &= \frac{b_1^2}{(b_1^2-b_2^2)} \frac{1}{2b_1}e^{-\frac{|z-(\mu_1-\mu_2)|}{b_1}}- \frac{b_2^2}{(b_1^2-b_2^2)} \frac{1}{2b_2}e^{- \frac{|z-(\mu_1-\mu_2)|}{b_2}} \end{align} $$ Looks like a difference of two differently weighted Laplace distribution. $\endgroup$
    – is.magl
    Jun 2, 2014 at 11:45

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.