| dist_laplace | R Documentation |
The Laplace distribution, also known as the double exponential distribution, is a continuous probability distribution that is symmetric around its location parameter.
dist_laplace(mu, sigma)
mu |
The location parameter (mean) of the Laplace distribution. |
sigma |
The positive scale parameter of the Laplace distribution. |
We recommend reading this documentation on pkgdown which renders math nicely. https://pkg.mitchelloharawild.com/distributional/reference/dist_laplace.html
In the following, let X be a Laplace random variable with location
parameter mu = \mu and scale parameter sigma = \sigma.
Support: R, the set of all real numbers
Mean: \mu
Variance: 2\sigma^2
Probability density function (p.d.f):
f(x) = \frac{1}{2\sigma} \exp\left(-\frac{|x - \mu|}{\sigma}\right)
Cumulative distribution function (c.d.f):
F(x) = \begin{cases}
\frac{1}{2} \exp\left(\frac{x - \mu}{\sigma}\right) & \text{if } x < \mu \\
1 - \frac{1}{2} \exp\left(-\frac{x - \mu}{\sigma}\right) & \text{if } x \geq \mu
\end{cases}
Moment generating function (m.g.f):
E(e^{tX}) = \frac{\exp(\mu t)}{1 - \sigma^2 t^2} \text{ for } |t| < \frac{1}{\sigma}
extraDistr::Laplace
dist <- dist_laplace(mu = c(0, 2, -1), sigma = c(1, 2, 0.5))
dist
mean(dist)
variance(dist)
skewness(dist)
kurtosis(dist)
generate(dist, 10)
density(dist, 0)
density(dist, 0, log = TRUE)
cdf(dist, 1)
quantile(dist, 0.7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.