knitr::opts_chunk$set( collapse = TRUE, comment = "#" )
The ExtendedLaplace package provides tools for working with the Extended Laplace (EL) distribution, a generalization of the classical Laplace distribution. This distribution is characterized by four parameters: location $\mu$, scale (\sigma > 0), and a uniform noise range (\delta > 0).
The EL distribution arises as the sum (Y = X + U) where (X \sim \text{Laplace}(\mu, \sigma)) and (U \sim \text{Uniform}(-\delta, \delta)).
To install the development version of this package from GitHub:
# install.packages("devtools") devtools::install_github("saahdavid/ExtendedLaplace")
The package provides the following main functions:
dEL(y, mu, sigma, delta): Probability density functionpEL(y, mu, sigma, delta): Cumulative distribution functionqEL(u, mu, sigma, delta): Quantile function (inverse CDF)rEL(n, mu, sigma, delta): Random number generationqqplotEL(samples, mu, sigma, delta): Quantile-Quantile Plotlibrary(ExtendedLaplace) curve(dEL(x, mu = 0, sigma = 1, delta = 1), from = -5, to = 5, ylab = "Density", xlab = 'y')
curve(pEL(x, mu = 0, sigma = 1, delta = 1), from = -5, to = 5, ylab = "CDF", xlab = 'y')
qEL(c(0.025, 0.5, 0.975), mu = 0, sigma = 1, delta = 1)
samples <- rEL(10000, mu = 0, sigma = 1, delta = 1) hist(samples, probability = TRUE, breaks = 40, main = "Simulated EL Data", xlab = 'y') curve(dEL(x, mu = 0, sigma = 1, delta = 1), add = TRUE, col = "navy", lwd = 2)
qqplotEL(samples, mu = 0, sigma = 1, delta = 1)
The Extended Laplace distribution has the following form:
$$ \begin{aligned} g(y) = \frac{1}{4\delta} \begin{cases} e^{\frac{y- \mu + \delta}{\sigma}} - e^{\frac{y- \mu - \delta}{\sigma}}, & y < \mu - \delta \ 2 - e^{-\frac{y - \mu + \delta}{\sigma}} - e^{\frac{y - \mu - \delta}{\sigma}}, & \mu - \delta \leq y < \mu + \delta \ e^{-\frac{y - \mu - \delta}{\sigma}} - e^{-\frac{y - \mu + \delta}{\sigma}}, & y \geq \mu + \delta \end{cases} \end{aligned} $$
$$ \begin{aligned} G(y) = \frac{1}{4\delta} \begin{cases} \sigma e^{\frac{y- \mu + \delta}{\sigma}} - \sigma e^{\frac{y- \mu - \delta}{\sigma}} , & y < \mu - \delta \ 2(y - \mu + \delta) + \sigma e^{-\frac{y - \mu + \delta}{\sigma}} - \sigma e^{\frac{y - \mu - \delta}{\sigma}} , & \mu-\delta \leq y < \mu+\delta\ 4\delta + \sigma e^{-\frac{y- \mu + \delta}{\sigma}} - \sigma e^{-\frac{y- \mu - \delta}{\sigma}} , & y \geq \mu + \delta \, . \end{cases} \end{aligned} $$
For $\sigma>0$ and $0<u<1$, we have $Q(u)=\mu+\sigma z$, where
$$ \begin{aligned} z = \begin{cases} \log [4\tau u] - \log [e^\tau - e^{-\tau}] & \mbox{for } 0<u\leq (1-e^{-2\tau})/(4\tau) \ z^\ast & \mbox{for } (1-e^{-2\tau})/(4\tau) \leq u \leq 1 - (1-e^{-2\tau})/(4\tau)\ - \log [4\tau (1-u)] + \log [e^{\tau} - e^{-\tau}] & \mbox{for } 1 - (1-e^{-2\tau})/(4\tau) \leq u <1, \end{cases} \end{aligned} $$
where $\tau=\delta/\sigma$ and $z^\ast$ is a unique solution of the equation: $$ \begin{aligned} u = \frac{1}{4\tau} [ 2(z+\tau) - e^{-\tau}(e^z - e^{-z})], \quad -\tau\leq z \leq \tau. \end{aligned} $$
sessionInfo()
Saah, D. K., & Kozubowski, T. J. (2025).
A new class of extended Laplace distributions with applications to modeling contaminated Laplace data.
Journal of Computational and Applied Mathematics.
https://doi.org/10.1016/j.cam.2025.116588
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.