ralaplace | R Documentation |
Returns a sample from an Asymetric Laplace distribution.
ralaplace(n, m = 0, al = 1, ar = 1)
n |
(int) - the size of the sample. |
m |
(numeric) - the location parameter. |
al , ar |
(numeric) - left and right scale parameters, respectively. |
The Asymmetric Laplace distribution is given by the two-sided exponential distribution given by the function:
f(x;a_l,a_r,m) =
\frac{1}{A} e^{-|\frac{x-m}{a_l}| }, x < m
f(x;a_l,a_r,m) =
\frac{1}{A} e^{-|\frac{x-m}{a_r}| }, x > m
with:
A = a_l + a_r
The random sampling is done by inverse transform sampling.
a numeric vector containing a random sample.
sample_gamma <- ralaplace(1000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.