Returns a sample from a Laplace-distributed random variable.
Usage
rlaplace(n, m = 0, a = 1)
Value
a numeric vector containing a random sample with above parameters.
Arguments
n
(int) - the size of the sample.
m
(numeric) - the location parameter.
a
(numeric) - the scale parameter.
Details
The Laplace distribution is given by the two-sided exponential distribution
given by the function:
$$ f(x;a,m) = \frac{1}{2a} e^{- \left| \frac{x-m}{a} \right|} $$
The random sampling is done by inverse transform sampling.