#### 52.2.16 Laplace Random Variable

The Laplace distribution is a continuous probability distribution that is sometimes called the double exponential distribution because it can be thought of as two exponential distributions spliced back to back.

Function: pdf_laplace (x,a,b)

  Returns the value at x of the density function of a \({\it Laplace}(a,b)\) random variable, with b>0. To make use of this function, write first `load("distrib")`.

  Here, a is the location parameter (or mean), and b is the scale parameter, related to the variance.

  The pdf is $$ f(x; a, b) = {1\over 2b}\exp\left(-{|x-a|\over b}\right) $$

  Categories:Package distrib ·

Function: cdf_laplace (x,a,b)

  Returns the value at x of the distribution function of a \({\it Laplace}(a,b)\) random variable, with b>0. To make use of this function, write first `load("distrib")`.

  The cdf is $$ F(x; a, b) = \cases{ \displaystyle{1\over 2} \exp\left({x-a\over b}\right) & for $x < a$\cr \cr 1-\displaystyle{1\over 2} \exp\left({x-a\over b}\right) & for $x \ge a$ } $$

  Categories:Package distrib ·

Function: quantile_laplace (q,a,b)

  Returns the q-quantile of a \({\it Laplace}(a,b)\) random variable, with b>0; in other words, this is the inverse of `cdf_laplace`. Argument q must be an element of [0,1]. To make use of this function, write first `load("distrib")`.

  Categories:Package distrib ·

Function: mean_laplace (a,b)

  Returns the mean of a \({\it Laplace}(a,b)\) random variable, with b>0. To make use of this function, write first `load("distrib")`.

  The mean is $$ E[X] = a $$

  Categories:Package distrib ·

Function: var_laplace (a,b)

  Returns the variance of a \({\it Laplace}(a,b)\) random variable, with b>0. To make use of this function, write first `load("distrib")`.

  The variance is $$ V[X] = 2b^2 $$

  Categories:Package distrib ·

Function: std_laplace (a,b)

  Returns the standard deviation of a \({\it Laplace}(a,b)\) random variable, with b>0. To make use of this function, write first `load("distrib")`.

  The standard deviation is $$ D[X] = \sqrt{2} b $$

  Categories:Package distrib ·

Function: skewness_laplace (a,b)

  Returns the skewness coefficient of a \({\it Laplace}(a,b)\) random variable, with b>0. To make use of this function, write first `load("distrib")`.

  The skewness coefficient is $$ SK[X] = 0 $$

  Categories:Package distrib ·

Function: kurtosis_laplace (a,b)

  Returns the kurtosis coefficient of a \({\it Laplace}(a,b)\) random variable, with b>0. To make use of this function, write first `load("distrib")`.

  The kurtosis coefficient is $$ KU[X] = 3 $$

  Categories:Package distrib ·

Function: random_laplace (a,b)
`random_laplace` (a,b,n)

  Returns a \({\it Laplace}(a,b)\) random variate, with b>0. Calling `random_laplace` with a third argument n, a random sample of size n will be simulated.

  The implemented algorithm is based on the general inverse method.

  To make use of this function, write first `load("distrib")`.

  Categories:Package distrib ·Random numbers ·