sdl | R Documentation |
Probability mass function, distribution function, quantile function, and a random
generation for the modified skew discrete Laplace (SDL) distribution with mean mu
,
dispersion parameter phi
, and mode xi
.
dsdl(x, mu, phi, xi = 0, log = FALSE)
psdl(q, mu, phi, xi = 0, lower.tail = TRUE)
qsdl(p, mu, phi, xi = 0, lower.tail = TRUE)
rsdl(n, mu, phi, xi = 0)
x , q |
vector of integer quantiles. |
mu |
vector of means. |
phi |
vector of dispersion parameters (greater than |
xi |
the mode of the distribution, an integer value. |
log |
logical; if |
lower.tail |
logical; if |
p |
vector of probabilities. |
n |
number of random values to return. |
The SDL distribution was introduced by Kozubowski and Inusah (2006) as the discrete part of the continuous skew Laplace distribution centered at zero (Kotz et al., 2001, Ch. 3). Although the SDL distribution has attractive properties, the discrete version of the zero-centered skew Laplace distribution induces that the mode of the resulting model is always equal to zero.
To overcome this limitation, Medeiros and Bourguignon (2025) proposed to obtain the discrete version of the Laplace skew distribution without setting its location parameter to zero, defining a new probability model that generalizes the SDL distribution.
This set of functions represents the probability mass function, the cumulative distribution
function, the quantile function, and a random number generator for the modified SDL
distribution parameterized in terms of mu
(mean), phi
(a dispersion parameter),
and xi
(the mode of the distribution).
Let X
be a discrete random variable following a SDL distribution with mean \mu
,
dispersion parameter \phi
, and mode \xi
. The probability mass function of X is
\textrm{P}(X = x) = \left\{\begin{array}{ll}
\dfrac{1}{1 + \phi}\left(\dfrac{\phi - \mu + \xi}{2+ \phi - \mu + \xi}\right)^{-(x - \xi)}, & x \in \{\xi - 1, \xi - 2, \ldots\}, \\ \\
\dfrac{1}{1 + \phi}\left(\dfrac{\phi + \mu - \xi}{2+ \phi + \mu - \xi}\right)^{x - \xi}, & x \in \{\xi, \xi + 1, \xi + 2, \ldots\}.
\end{array}\right.
The parametric space of this parameterization satisfies the constraint \mu \in \mathbb{R}
,
\phi > |\mu - \xi|
, and \xi \in \mathbb{Z}
. Additionally, the expected value and
the variance of X
are given, respectively, by
\textrm{E}(Y) = \mu \quad \mbox{ and } \quad \textrm{Var}(Y) = \dfrac{\phi(\phi + 2) + (\mu - \xi)^2}{2}.
dsdl
returns the probability mass function, psdl
gives the distribution function, qsdl
gives the quantile function,
and rsdl
generates random observations.
Rodrigo M. R. de Medeiros <rodrigo.matheus@ufrn.br>
Kotz, S., Kozubowski, T. J., and Podgórski, K. (2001). The Laplace Distribution and Generalizations: A Revisit with Applications to Communications, Economics, Engineering, and Finance. Birkhauser, Boston.
Kozubowski, T. J., and Inusah, S. (2006). A skew Laplace distribution on integers. Annals of the Institute of Statistical Mathematics, 58, 555—571.
Medeiros, R. M. R., and Bourguignon, M. (2025). Modified skew discrete Laplace regression models for integer valued data with applications to paired samples. Manuscript submitted for publication.
### Probability function ###
# Parameters
mu <- c(-4, 2, 4)
phi <- 6.5
xi <- 2
xvals <- -30:30
# Skewed-left distribution (mu < xi)
plot(xvals, dsdl(xvals, mu[1], phi, xi),
type = "h", xlab = "x", ylab = "Pmf")
# Symmetric distribution (mu = xi)
plot(xvals, dsdl(xvals, mu[2], phi, xi),
type = "h", xlab = "x", ylab = "Pmf")
# Skewed-right distribution (mu > 0)
plot(xvals, dsdl(xvals, mu[3], phi, xi),
type = "h", xlab = "x", ylab = "Pmf")
### Difference between paired samples of non-negative observations ###
# Parameters
mu <- 3
phi <- 4
xi <- 0
# Paired samples of a pre-post treatment experimental study
before <- rgeom(1000, 2 / (2 + phi - mu))
after <- rgeom(1000, 2 / (2 + phi + mu))
# Response variable
y <- after - before
# Barplot
obj <- barplot(prop.table(table(y)),
xlab = "Response",
ylab = "Proportion",
col = "white",
ylim = c(0, mean(y == 0) + 0.01))
# Sdl model for the differences
points(obj, dsdl(sort(unique(y)), mu, phi, xi), col = "red", pch = 16)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.