# Math Help - Laplace distribution

1. ## Laplace distribution

I have equation that:
$f(x)=(\lambda/2)exp(-\lambda|x-a|)$
I need to find $F(x)$.
I think the answer is $F(x)=(\lambda/2)exp(-\lambda|x-a|)$
but math book shows me that answer:
$F(x)=\left\{\begin{array}{cc}0.5exp(\lambda(x-a)),&\mbox{ if }
x

There are two different answers taking into account cases where $x and $x\geq a$. Where do these considerations come from?
What I did wrong?

2. Usually $F(x)$ stand for the primitive of the function.
Using the definition of derivative, you can find $\frac{d(e^u)}{dx} = e^u \frac{du}{dx}$
You know that for $x than $|x-a| \implies -(x-a)$ and $x>a$ than $|x-a| \implies (x-a)$ Draw the graph of $y = |x-a|$ for example it will appear clear to you.
You thus have
$
f(x)=(\lambda/2)e^{(\lambda(x-a))}
$
if $x and $
f(x)=(\lambda/2)e^{-(\lambda(x-a))}=(\lambda/2)e^{(\lambda(a-x))}
$
if $x>a$
Now you fin the primitive of these. For example the seconde is $
F(x)=\frac{-1}{2}e^{(\lambda(a-x))}+C
$
With initial condition you find that C = 1

3. Originally Posted by totalnewbie
I have equation that:
$f(x)=(\lambda/2)exp(-\lambda|x-a|)$
I need to find $F(x)$.
I think the answer is $F(x)=(\lambda/2)exp(-\lambda|x-a|)$
but math book shows me that answer:
$F(x)=\left\{\begin{array}{cc}0.5exp(\lambda(x-a)),&\mbox{ if }
x

There are two different answers taking into account cases where $x and $x\geq a$. Where do these considerations come from?
What I did wrong?
$f(x) = \frac{\lambda}{2} \, e^{-\lambda (x - a)}$ if $x - a \geq 0 \Rightarrow x \geq a$.

$f(x) = \frac{\lambda}{2} \, e^{-\lambda (a - x)}$ if $x - a < 0 \Rightarrow x < a$.

Both cases have to be considered seperately when calculating F(x).

4. what initial conditions give you C=1?

5. Wait never mind, I see it.

6. $
F'(x)=0.5exp^{(\lambda x-\lambda a)}\frac {d}{dx}=0.5e^{(\lambda x- \lambda a)}*\lambda=0.5\lambda e^{(\lambda(x-a))}
$

$
F'(x)=-0.5exp^{(\lambda a-\lambda x)}\frac {d}{dx}=-0.5e^{( \lambda a- \lambda x)}*{(- \lambda)=0.5\lambda}e^{(\lambda(a-x))}
$

Funny, taking the derivative of the primitive function doesn't give to me the right answer.

And inital condition is that $\int f(x) dx = 1$
And:
$\int 0.5\lambda e^{(\lambda(x-a))}dx= 0.5exp^{(\lambda x-\lambda a)} -1$
$\int 0.5\lambda e^{(\lambda(a-x))}dx= -0.5exp^{(\lambda a-\lambda x)} -1$

7. Originally Posted by mr fantastic
$f(x) = \frac{\lambda}{2} \, e^{-\lambda (x - a)}$ if $x - a \geq 0 \Rightarrow x \geq a$.

$f(x) = \frac{\lambda}{2} \, e^{-\lambda (a - x)}$ if $x - a < 0 \Rightarrow x < a$.

Both cases have to be considered seperately when calculating F(x).

Read this: Laplace distribution - Wikipedia, the free encyclopedia
$x \geq a$:

$F(x) = \int_{-\infty}^{x} \frac{\lambda}{2} \, e^{-\lambda (t - a)} \, dt = 1 - \int_{x}^{+\infty} \frac{\lambda}{2} \, e^{-\lambda (t - a)} \, dt$

Substitute $u = t - a$:

$= 1 - \frac{\lambda}{2} \, \int_{x-a}^{+\infty} \, e^{-\lambda u} \, du = 1 - \frac{1}{2} \, \left[ e^{-\lambda u} \right]_{x-a}^{+\infty}$

$= 1 - \frac{1}{2} \, e^{-\lambda (x - a)}$.

$x < a$:

$F(x) = \int_{-\infty}^{x} \frac{\lambda}{2} \, e^{-\lambda (a - t)} \, dt$

Substitute $u = t - a$:

$= \frac{\lambda}{2} \, \int^{x-a}_{-\infty} \, e^{\lambda u} \, du = \frac{1}{2} \, \left[ e^{\lambda u} \right]^{x-a}_{-\infty}$

$= \frac{1}{2} \, e^{\lambda (x - a)}$.