rlaplace | R Documentation |
Returns a sample from a Laplace-distributed random variable.
rlaplace(n, m = 0, a = 1)
n |
(int) - the size of the sample. |
m |
(numeric) - the location parameter. |
a |
(numeric) - the scale parameter. |
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.
a numeric vector containing a random sample with above parameters.
sample_gamma <- rlaplace(1000, 0, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.