# Laplace Distribution

## Laplace Distribution

A continuous random variable $X$ is said to have a Laplace distribution (Double exponential distribution or bilateral exponential distribution), if its p.d.f. is given by

 \begin{align*} f(x;\mu, \lambda)&= \begin{cases} \frac{\lambda}{2}e^{-\lambda|x-\mu|}, & -\infty < x< \infty; \\ & -\infty < \mu < \infty, \lambda >0; \\ 0, & Otherwise. \end{cases} \end{align*}

In Laplace distribution $\mu$ is called location parameter, since it locates the curve of the distribution, and $\lambda$ is called scale parameter, since the shape of the curve depends on the value of $\lambda$.

 $$\begin{eqnarray*} \int_{-\infty}^\infty f(x; \mu, \lambda) \; dx &=& \int_{-\infty}^\mu f(x; \mu, \lambda) \; dx + \int_\mu^\infty f(x; \mu, \lambda)\; dx \\ &=& \int_{-\infty}^\mu \frac{\lambda}{2}e^{-\lambda(\mu-x)} \; dx + \int_\mu^\infty \frac{\lambda}{2}e^{-\lambda(x-\mu)}\; dx \\ \\ &=& \frac{\lambda}{2}\bigg[\frac{e^{-\lambda(x-\mu)}}{\lambda}\bigg]_{-\infty}^\mu+ \frac{\lambda}{2}\bigg[\frac{e^{-\lambda(x-\mu)}}{-\lambda}\bigg]_\mu^{-\infty}\\ &=& \frac{1}{2} + \frac{1}{2}=1. \end{eqnarray*}$$

The function $f(x)$ defined above is a legitimate p.d.f.

In notation, $X\sim L(\mu, \lambda)$. The standard form of Laplace distribution is obtained by taking $\mu=0$ and $\lambda =1$. The p.d.f of standard Laplace distribution is

 \begin{align*} f(x)&= \begin{cases} \frac{1}{2}e^{-|x|}, & -\infty < x< \infty; \\ & \\ 0, & Otherwise. \end{cases} \end{align*}

## Distribution Function of Laplace Distribution

Distribution function is given by

 \begin{align*} F(x) &= \begin{cases} \frac{1}{2}e^{\lambda(x-\mu)}, & x< \mu; \\ &\\ 1-\frac{1}{2}e^{-\lambda(x-\mu)}, & x\geq \mu; \end{cases} \end{align*}

#### Proof

The distribution function of Laplace distribution is given by

 $$\begin{eqnarray*} F(x) &=& P(X\leq x) \\ &=& \int_{-\infty}^x f(t) \; dt\\ &=& \int_{-\infty}^x \frac{\lambda}{2}e^{-\lambda|t-\mu|} \; dt \end{eqnarray*}$$

There are two cases (I) when $x< \mu$ and (II) when $x\geq \mu$.

Case I:

When $x< \mu$, $\Rightarrow x-\mu < 0 \Rightarrow |x-\mu| = -(x-\mu)$,

 $$\begin{eqnarray*} \therefore F(x) &=& \int_{-\infty}^x \frac{\lambda}{2} e^{\lambda(t-\mu)}\; dt \\ &=& \frac{\lambda}{2} \bigg[\frac{1}{\lambda}e^{\lambda(t-\mu)}\bigg]_{-\infty}^x\\ &=& \frac{1}{2} e^{\lambda(x-\mu)},\qquad x<\mu. \end{eqnarray*}$$

Case II:

When $x\geq \mu$, $\Rightarrow x-\mu > 0 \Rightarrow |x-\mu| = (x-\mu)$,

 $$\begin{eqnarray*} \therefore F(x) &=& \int_{-\infty}^x \frac{\lambda}{2} e^{-\lambda(t-\mu)}\; dt \\ &=& \frac{\lambda}{2}\int_{-\infty}^\mu \frac{\lambda}{2} e^{\lambda(t-\mu)}\; dt+ \frac{\lambda}{2}\int_{\mu}^x \frac{\lambda}{2} e^{-\lambda(t-\mu)}\; dt \\ &=& \frac{\lambda}{2} \bigg[\frac{1}{\lambda}e^{\lambda(t-\mu)}\bigg]_{-\infty}^\mu+ \frac{\lambda}{2} \bigg[\frac{(-1)}{\lambda}e^{-\lambda(t-\mu)}\bigg]_{\mu}^x\\ &=& \frac{1}{2}[1-0]+\frac{1}{2} \big(-e^{-\lambda(x-\mu)}+1\big)\\ & =& 1- \frac{1}{2}e^{-\lambda(x-\mu)},\qquad x \geq \mu. \end{eqnarray*}$$

Therefore, the distribution function of Laplace distribution is

 \begin{align*} F(x) &= \begin{cases} \frac{1}{2}e^{\lambda(x-\mu)}, & x< \mu; \\ &\\ 1-\frac{1}{2}e^{-\lambda(x-\mu)}, & x\geq \mu; \end{cases} \end{align*}

## Mean and Variance of Laplace Distribution

The mean and variance of Laplace distribution are $\mu$ and $\frac{2}{\lambda^2}$ respectively.

#### Proof

The mean of Laplace distribution is

 $$\begin{eqnarray*} \text{Mean = } E(X) &=& \int_{-\infty}^\infty xf(x)\; dx \\ &=& \int_{-\infty}^\infty (x-\mu+\mu)f(x)\; dx \\ &=& \int_{-\infty}^\infty (x-\mu)f(x)\; dx+\int_{-\infty}^\infty \mu f(x)\; dx \\ &=& I_1+\mu I_2, \end{eqnarray*}$$

In $I_1$, put $(x-\mu)=y$, therefore $dx=dy$,

 $$\begin{eqnarray*} \therefore I_1 & = & \frac{\lambda}{2}\int_{-\infty}^\infty y e^{-\lambda|y|}\; dy = 0,\qquad \text{ (\because integrand is an odd function)}\\ \text{ and } I_2 & = & \int_{-\infty}^\infty f(x) dx =1. \end{eqnarray*}$$

Therefore, $E(X) = 0 + \mu \cdot 1 = \mu$. Hence, mean of Laplace
distribution is $\mu$.

Variance :

To find variance of $X$ we need to find $E(X^2)$.

 $$\begin{eqnarray*} E(X^2) &=& \int_{-\infty}^\infty x^2f(x)\; dx \\ &=& \int_{-\infty}^\infty x^2\frac{\lambda}{2} e^{-\lambda|x-\mu|}\; dx. \end{eqnarray*}$$

Let $z=\lambda(x-\mu)$, $\Rightarrow x = \mu+\dfrac{z}{\lambda}$. So, $dz = \lambda dx$. Hence,

 $$\begin{eqnarray*} E(X^2) & = & \frac{1}{2}\int_{-\infty}^\infty \bigg(\mu +\frac{z}{\lambda}\bigg)^2 e^{-|z|}\; dz.\\ & = &\frac{1}{2} \int_{-\infty}^\infty \bigg(\mu^2 +\frac{2\mu z}{\lambda} + \frac{z^2}{\lambda^2}\bigg) e^{-|z|}\; dz.\\ & = &\mu^2 \int_{-\infty}^\infty \frac{1}{2}e^{-|z|}\; dz +\frac{\mu}{\lambda} \int_{-\infty}^\infty z e^{-|z|}\; dz+\frac{1}{2\lambda^2}\int_{-\infty}^\infty z^2 e^{-|z|}\; dz.\\ & = & \mu^2 (1) + 0 + \frac{1}{2\lambda^2}\int_{-\infty}^\infty z^2 e^{-|z|}\; dz.\\ &=& \mu^2 +\frac{2}{2\lambda^2}\int_0^\infty z^2 e^{-z}\;dz\\ &=& \mu^2 +\frac{1}{\lambda^2}\frac{\Gamma 3}{1^3}\\ &=& \mu^2 +\frac{2}{\lambda^2}. \end{eqnarray*}$$

Thus,

 \begin{align*} V(X) &=E[X^2]-[E(X)]^2\\ &= \mu^2 -\mu^2+\frac{2}{\lambda^2}\\ &=\frac{2}{\lambda^2}. \end{align*}

## Quartiles of Laplace Distribution

The quartiles of Laplace distribution are $Q_1 = \mu + \dfrac{1}{\lambda}\log_e(0.5)$, $Q_2 = \mu$ and $Q_3 = \mu - \dfrac{1}{\lambda}\log_e(0.5)$.

#### Proof

The distribution function of Laplace distribution is

 \begin{align*} F(x) &= \begin{cases} \frac{1}{2}e^{\lambda(x-\mu)}, & x< \mu; \\ &\\ 1-\frac{1}{2}e^{-\lambda(x-\mu)}, & x\geq \mu; \end{cases} \end{align*}

We have,

 $$\begin{equation*} F(Q_i) = P(X\leq Q_i) = \frac{i}{4},\quad i=1,2,3. \end{equation*}$$

For first quartile, $Q_1<\mu$,

 $$\begin{eqnarray*} F(Q_1) & = & \frac{1}{2}e^{\lambda(Q_1-\mu)}=\frac{1}{4}\\ \Rightarrow& & e^{\lambda(Q_1-\mu)}=\frac{1}{2} \\ \Rightarrow & &\lambda(Q_1-\mu)=\log_e(0.5)\\ \Rightarrow & & Q_1 = \mu + \frac{1}{\lambda}\log_e(0.5). \end{eqnarray*}$$

For second quartile, $Q_2\geq\mu$,

 $$\begin{eqnarray*} F(Q_2) & = & 1-\frac{1}{2}e^{-\lambda(Q_2-\mu)}=\frac{1}{2}\\ \Rightarrow& & e^{-\lambda(Q_2-\mu)}=1\\ \Rightarrow & & -\lambda(Q_2-\mu)=0\\ \Rightarrow & & Q_2 = \mu. \end{eqnarray*}$$

For third quartile, $Q_3\geq\mu$,

 $$\begin{eqnarray*} F(Q_3) & = & 1-\frac{1}{2}e^{-\lambda(Q_3-\mu)}=\frac{3}{4}\\ \Rightarrow& & \frac{1}{2}e^{-\lambda(Q_3-\mu)}=\frac{1}{4}\\ \Rightarrow & &-\lambda(Q_3-\mu)=\log_e(0.5)\\ \Rightarrow & & Q_3 = \mu-\frac{1}{\lambda}\log_e(0.5). \end{eqnarray*}$$

## M.G.F. of Laplace Distribution

The moment generating function of Laplace distribution is

$$M_X(t)=e^{t\mu}\sum_{r=0}^\infty\bigg(\frac{t^2}{\lambda^2}\bigg)^r.$$

#### Proof

The moment generating function of Laplace distribution is

 $$\begin{eqnarray*} M_X(t) &=& E(e^{tX}) \\ &=& \int_{-\infty}^\infty e^{tx}f(x) \; dx\\ &=& \int_{-\infty}^\infty e^{t(x-\mu+\mu)}f(x) \; dx\\ &=& \frac{\lambda}{2}e^{t\mu}\int_{-\infty}^\infty e^{t(x-\mu)}e^{-\lambda|x-\mu|} \; dx \end{eqnarray*}$$

Let $(x-\mu) =y$, therefore $dx=dy$.

 $$\begin{eqnarray*} M_X(t) &=& \frac{\lambda}{2}e^{t\mu}\int_{-\infty}^\infty e^{ty}e^{-\lambda|y|} \; dy\\ &=& \frac{\lambda}{2}e^{t\mu}\bigg[\int_{-\infty}^0 e^{ty}e^{\lambda y} \;dy +\int_0^{\infty} e^{ty}e^{-\lambda y}\; dy\bigg]\\ &=& \frac{\lambda}{2}e^{t\mu}\bigg[\int_{-\infty}^0 e^{(t+\lambda)y}\;dy +\int_0^{\infty} e^{-(\lambda -t)y}\; dy \bigg]\\ &=& \frac{\lambda}{2}e^{t\mu}\bigg\{\bigg[\frac{e^{(t+\lambda)y}}{t+\lambda}\bigg]_{-\infty}^0+\bigg[\frac{e^{-(\lambda-t)y}}{-(\lambda-t)}\bigg]_0^{\infty}\bigg\}\\ &=& \frac{\lambda}{2}e^{t\mu}\bigg\{\bigg[\frac{1}{t+\lambda}-0\bigg]+\bigg[0-\frac{1}{t-\lambda}\bigg]\bigg\}\\ &=& \frac{\lambda}{2}e^{t\mu}\bigg[\frac{-2\lambda}{t^2-\lambda^2}\bigg]\\ &=& e^{t\mu}\bigg[\frac{\lambda^2}{\lambda^2-t^2}\bigg]\\ &=& e^{t\mu}\bigg[1-\frac{t^2}{\lambda^2}\bigg]^{-1}\\ &=& e^{t\mu}\sum_{r=0}^\infty \bigg(\frac{t^2}{\lambda^2}\bigg)^r. \end{eqnarray*}$$

## C.G.F. of Laplace Distribution

The cumulant generating function of Laplace distribution $L(\mu,\lambda)$ is $K_X(t)=\mu t - \log_e \bigg(1-\frac{t^2}{r^2}\bigg)$.

#### Proof

The cumulant generating function of Laplace distribution is

 $$\begin{eqnarray*} K_X(t) &=& \log_e M_X(t) \\ &=& \log_e \bigg[e^{t\mu} \bigg(1-\frac{t^2}{r^2}\bigg)^{-1} \bigg]\\ &=& \mu t-\log_e \bigg(1-\frac{t^2}{r^2}\bigg)\\ &=& \mu t +\bigg(\frac{t^2}{\lambda^2} + \frac{t^4}{2\lambda^4}+\cdots\bigg)\\ & & \qquad (\because \log (1-x) = -(x+\frac{x^2}{2}+\frac{x^3}{3}+\cdots). \end{eqnarray*}$$

Cumulants

The first cumulant of Laplace distribution is
 $$\begin{eqnarray*} \kappa_1 =\mu_1^\prime &=& \text{coefficient of t in the expansion of K_X(t)}= \mu. \end{eqnarray*}$$

The second cumulant of Laplace distribution is

 $$\begin{eqnarray*} \kappa_2 =\mu_2 &=& \text{coefficient of \frac{t^2}{2!} in the expansion of K_X(t)} \\ &=& \frac{2}{\lambda^2}=\text{ variance }. \end{eqnarray*}$$

The third cumulant of Laplace distribution is

 $$\begin{eqnarray*} \kappa_3 =\mu_3 &=& \text{coefficient of \frac{t^3}{3!} in the expansion of K_X(t)} \\ &=& 0. \end{eqnarray*}$$

The fourth cumulant of Laplace distribution is

 $$\begin{eqnarray*} \kappa_4 =\mu_4-3\mu_2^2&=& \text{coefficient of \frac{t^4}{4!} in the expansion of K_X(t)} \\ &=& \frac{12}{\lambda^4}. \end{eqnarray*}$$

Hence

 $$\begin{eqnarray*} \mu_4 & = & \kappa_4 + 3\kappa_2^2 =\frac{12}{\lambda^4}+\frac{12}{\lambda^4}=\frac{24}{\lambda^4}. \end{eqnarray*}$$

In general, the $r^{th}$ cumulant is given by

 \begin{align*} \kappa_r&= \begin{cases} 0, & \text{if } r \text{ is odd except 1;} \\ &\\ \dfrac{2(r-1)!}{\lambda^r}, & \text{ if } r \text{ is even} \end{cases} \end{align*}

## Characteristics Function

The characteristics function of Laplace distribution $L(\mu,\lambda)$ is

 $$\begin{equation*} \phi_X(t) = e^{it\mu}\bigg(1+\frac{t^2}{\lambda^2}\bigg)^{-1}. \end{equation*}$$

#### Proof

Let $X\sim L(\mu,\lambda)$ distribution. Then the M.G.F. of Laplace distribution is

 $$\begin{equation*} M_X(t) = e^{t\mu} \bigg(1- \frac{t^2}{\lambda^2}\bigg)^{-1}. \end{equation*}$$

The characteristics function of $X$ is

 $$\begin{eqnarray*} \phi_{X}(t) &=& E(e^{itX}) \\ &=& M_X(it)\\ &=& e^{it\mu} \bigg(1- \frac{(it)^2}{\lambda^2}\bigg)^{-1}\\ &=& e^{it\mu} \bigg(1- \frac{i^2t^2}{\lambda^2}\bigg)^{-1}\\ &=& e^{it\mu} \bigg(1+ \frac{t^2}{\lambda^2}\bigg)^{-1}. \end{eqnarray*}$$

If $X\sim L(0,1)$, then the characteristics function of Standard Laplace distribution is

 $$\begin{equation*} \phi_X(t)=(1+t^2)^{-1} =\frac{1}{1+t^2}. \end{equation*}$$

## $r^{th}$ moment of Laplace Distribution

The $r^{th}$ moment of Laplace Distribution is

 $$\begin{equation*} \mu_r^\prime =\frac{1}{2} \sum_{k=0}^r\binom{r}{k} \mu^{r-k} \frac{k!}{\lambda^k} ((-1)^k +1). \end{equation*}$$

#### Proof

Let $X\sim L(\mu,\lambda)$. Then the pdf of $X$ is

 $$\begin{equation*} f(x) =\frac{\lambda}{2}e^{-\lambda |x-\mu|}, -\infty < x < \infty, -\infty < \mu < \infty, \lambda>0. \end{equation*}$$

The $r^{th}$ moment of Laplace distribution is

 $$\begin{eqnarray*} \mu_r^\prime &=& E(X^r) \\ &=& \frac{\lambda}{2}\int_{-\infty}^\infty x^r e^{-\lambda|x-\mu|}\; dx. \end{eqnarray*}$$

Let $Z =\lambda (X-\mu)$, $x = \mu +\frac{z}{\lambda}$. Thus $dx = \frac{1}{\lambda} dz$.

 $$\begin{eqnarray*} \mu_r^\prime &=& \frac{\lambda}{2} \int_{-\infty}^\infty (\mu+\frac{z}{\lambda})^r e^{-|z|} \frac{1}{\lambda}\; dz\\ &=& \frac{1}{2}\int_{-\infty}^\infty \sum_{k=0}^r\binom{r}{k} \bigg(\frac{z}{\lambda}\bigg)^k \mu^{r-k} e^{-|z|}\; dz\\ &=& \frac{1}{2} \sum_{k=0}^r\binom{r}{k} \mu^{r-k} \frac{1}{\lambda^k} \int_{-\infty}^\infty z^k e^{-|z|}\;dz\\ &=& \frac{1}{2} \sum_{k=0}^r\binom{r}{k} \mu^{r-k} \frac{1}{\lambda^k} \bigg[(-1)^k \int_{0}^\infty z^k e^{-z}\;dz+\int_{0}^\infty z^k e^{-z}\;dz\bigg]\\ &=&\frac{1}{2} \sum_{k=0}^r\binom{r}{k} \mu^{r-k} \frac{1}{\lambda^k} \bigg[(-1)^k \Gamma(k+1) +\Gamma (k+1)\bigg]\\ &=&\frac{1}{2} \sum_{k=0}^r\binom{r}{k} \mu^{r-k} \frac{k!}{\lambda^k} ((-1)^k +1). \end{eqnarray*}$$

## Result

Let $X$ and $Y$ be two i.i.d. exponential variate with parameter $\theta$. Obtain the distribution of $(X-Y)$.

#### Solution

$X$ and $Y$ be two i.i.d. exponential variate with parameter $\theta$. Then p.d.f. of $x$ is

 $$\begin{equation*} f_X(x) = \theta e^{-\theta x}; \quad x> 0, \theta>0 \end{equation*}$$

and p.d.f. of $Y$ is

 $$\begin{equation*} f_Y(y) = \theta e^{-\theta y}; \quad y> 0, \theta>0 \end{equation*}$$

The m.g. f. of $X$ is $M_X(t) = \bigg(1-\dfrac{t}{\theta}\bigg)^{-1}$. Let $U=X-Y$. Then the m.g.f. of $U$ is

 $$\begin{eqnarray*} M_U(t) = E(e^{tU}) &=& E(e^{t(X_Y)}\\ &=& E(e^{tX})\cdot E(e^{-tY})\\ &=& M_X(t)\cdot M_Y(-t)\\ &=& \bigg(1-\frac{t}{\theta}\bigg)^{-1}\cdot \bigg(1+\frac{t}{\theta}\bigg)^{-1}\\ &=&\bigg(1-\frac{t^2}{\theta^2}\bigg)^{-1}. \end{eqnarray*}$$

which is the m.g.f. of Laplace distribution with $\mu= 0$ and $\lambda = \theta$. Hence, by uniqueness property of M.G.F., $U=X-Y \sim L(0,\theta)$ distribution.

## Conclusion

In this tutorial, you learned about theory of Laplace distribution like the probability density function, mean, median, median, quartiles, moment generating function, characteristics function and other properties of Laplace distribution.

To read more about the step by step examples and calculator for Laplace distribution refer the link Laplace Distribution Calculator with Examples. This tutorial will help you to understand how to calculate mean, variance of Laplace distribution and you will learn how to calculate probabilities and cumulative probabilities for Laplace distribution with the help of step by step examples.