logo

Mean and Variance of Laplace Distribution 📂Probability Distribution

Mean and Variance of Laplace Distribution

Formula

XX \sim When Laplace(μ,b)\operatorname{Laplace}(\mu, b), the mean and variance of XX are as follows.

E(X)=μ E(X) = \mu Var(X)=2b2 \Var(X) = 2b^{2}

Proof

Direct Calculation

By the definition of expectation and integration by parts,

E(X)=x12bexμ/bdx=μx2be(xμ)/bdx+μx2be(xμ)/bdx=([x2b(be(xμ)/b)]μμ12e(xμ)/bdx)+([x2b(be(xμ)/b)]μ+μ12e(xμ)/bdx)=(μ2[b2e(xμ)/b]μ)+(μ2+[b2e(xμ)/b]μ)=(μ2b2)+(μ2+b2)=μ \begin{align*} E(X) &= \int\limits_{-\infty}^{\infty} x \dfrac{1}{2b} e^{-|x - \mu|/b} dx \\ &= \int\limits_{-\infty}^{\mu} \dfrac{x}{2b} e^{(x - \mu)/b} dx + \int\limits_{\mu}^{\infty} \dfrac{x}{2b} e^{-(x - \mu)/b} dx \\ &= \left( \left[\dfrac{x}{2b}\left(b e^{(x - \mu)/b}\right)\right]_{-\infty}^{\mu} - \int\limits_{-\infty}^{\mu} \dfrac{1}{2} e^{(x - \mu)/b} dx \right) \\ &\qquad+ \left( \left[\dfrac{x}{2b}\left(-b e^{-(x - \mu)/b}\right)\right]_{\mu}^{\infty} + \int\limits_{\mu}^{\infty} \dfrac{1}{2} e^{-(x - \mu)/b} dx \right) \\ &= \left( \dfrac{\mu}{2} - \left[ \dfrac{b}{2} e^{(x - \mu)/b} \right]_{-\infty}^{\mu} \right) + \left( \dfrac{\mu}{2} + \left[ -\dfrac{b}{2} e^{-(x-\mu)/b} \right]_{\mu}^{\infty} \right) \\ &= \left( \dfrac{\mu}{2} - \dfrac{b}{2} \right) + \left( \dfrac{\mu}{2} + \dfrac{b}{2} \right) \\ &= \mu \end{align*}

To obtain the variance, let’s calculate E(X2)E(X^{2}).

E(X2)=x212bexμ/bdx=μx22be(xμ)/bdx+μx22be(xμ)/bdx=([x22(e(xμ)/b)]μμxe(xμ)/bdx)+([x22e(xμ)/b]μ+μxe(xμ)/bdx)=[μ22(μbb2)]+[μ22+(μbb2)]=μ2+2b2 \begin{align*} E(X^{2}) &= \int\limits_{-\infty}^{\infty} x^{2} \dfrac{1}{2b} e^{-|x - \mu|/b} dx \\ &= \int\limits_{-\infty}^{\mu} \dfrac{x^{2}}{2b} e^{(x - \mu)/b} dx + \int\limits_{\mu}^{\infty} \dfrac{x^{2}}{2b} e^{-(x - \mu)/b} dx \\ &= \left( \left[\dfrac{x^{2}}{2}\left( e^{(x - \mu)/b}\right)\right]_{-\infty}^{\mu} - \int\limits_{-\infty}^{\mu} x e^{(x - \mu)/b} dx \right) \\ &\qquad+ \left( \left[ - \dfrac{x^{2}}{2} e^{-(x - \mu)/b}\right]_{\mu}^{\infty} + \int\limits_{\mu}^{\infty} x e^{-(x - \mu)/b} dx \right) \\ &= \left[ \dfrac{\mu^{2}}{2} - (\mu b - b^{2}) \right] + \left[ \dfrac{\mu^{2}}{2} + (\mu b - b^{2}) \right] \\ &= \mu^{2} + 2b^{2} \end{align*}

The third equality is due to integration by parts, and the fourth equality uses the result of the integration calculated for the expectation. Since variance is Var(X)=E(X2)E(X)2\Var(X) = E(X^{2}) - E(X)^{2},

Var(X)=E(X2)E(X)2=μ2+2b2μ2=2b2 \Var(X) = E(X^{2}) - E(X)^{2} = \mu^{2} + 2b^{2} - \mu^{2} = 2b^{2}

From the Moment Generating Function

The moment generating function of the Laplace distribution is as follows.

m(t)=11b2t2eμtfor t<1b m(t) = \dfrac{1}{1 - b^{2}t^{2}} e^{\mu t} \qquad \text{for } |t| < \dfrac{1}{b}

Since the expectation is m(0)m^{\prime}(0), by differentiating, we get

m(t)=ddt(11b2t2)eμt+11b2t2ddteμt=dd(1b2t2)(11b2t2)d(1b2t2)dteμt+11b2t2μeμt=2b2t(1b2t2)2eμt+μ1b2t2eμt \begin{align*} m^{\prime}(t) &= \dfrac{d}{dt} \left( \dfrac{1}{1 - b^{2}t^{2}} \right) e^{\mu t} + \dfrac{1}{1 - b^{2}t^{2}} \dfrac{d}{dt} e^{\mu t} \\ &= \dfrac{d}{d(1-b^{2}t^{2})} \left( \dfrac{1}{1 - b^{2}t^{2}} \right) \dfrac{d(1-b^{2}t^{2})}{dt} e^{\mu t} + \dfrac{1}{1 - b^{2}t^{2}} \mu e^{\mu t} \\ &= \dfrac{2b^{2}t}{(1 - b^{2}t^{2})^{2}} e^{\mu t} + \dfrac{\mu}{1 - b^{2}t^{2}} e^{\mu t} \end{align*}

Thus, we obtain the following.

E(X)=m(0)=μ E(X) = m^{\prime}(0) = \mu

To find the variance, differentiate once more,

m(t)=ddt(2b2t(1b2t2)2eμt+μ1b2t2eμt) m^{\prime\prime}(t) = \dfrac{d}{dt} \left( \dfrac{2b^{2}t}{(1 - b^{2}t^{2})^{2}} e^{\mu t} + \dfrac{\mu}{1 - b^{2}t^{2}} e^{\mu t} \right)

The differentiation of the second term can be directly obtained from the result above.

m(t)=ddt(2b2t(1b2t2)2eμt)+2μb2t(1b2t2)2eμt+μ21b2t2eμt m^{\prime\prime}(t) = \dfrac{d}{dt} \left( \dfrac{2b^{2}t}{(1 - b^{2}t^{2})^{2}} e^{\mu t} \right) + \dfrac{2\mu b^{2}t}{(1 - b^{2}t^{2})^{2}} e^{\mu t} + \dfrac{\mu^{2}}{1 - b^{2}t^{2}} e^{\mu t}

Differentiating the first term, it can be seen that when substituting 2b2(1b2t2)2eμt\dfrac{2b^{2}}{(1-b^{2}t^{2})^{2}}e^{\mu t} and t=0t=0, terms forming 00 appear. Therefore,

m(0)=2b2(1b2t2)2eμt+2μb2t(1b2t2)2eμt+μ21b2t2eμtt=0=2b2+μ2 \begin{align*} m^{\prime\prime}(0) &= \left. \dfrac{2b^{2}}{(1-b^{2}t^{2})^{2}}e^{\mu t} + \dfrac{2\mu b^{2}t}{(1 - b^{2}t^{2})^{2}} e^{\mu t} + \dfrac{\mu^{2}}{1 - b^{2}t^{2}} e^{\mu t} \right|_{t=0} \\ &= 2b^{2} + \mu^{2} \\ \end{align*}

Thus, the variance is as follows.

Var(X)=E(X2)(E(X))2=m(0)(m(0))2=2b2 \Var(X) = E(X^{2}) - (E(X))^{2} = m^{\prime\prime}(0) - (m^{\prime}(0))^{2} = 2b^{2}