ddlaplace {dapper} | R Documentation |
The probability mass function and random number generator for the discrete Laplacian distribution.
ddlaplace(x, scale = 1, log = FALSE)
rdlaplace(n, scale = 1)
x |
a vector of quantiles. |
scale |
the scale parameter. |
log |
logical; if |
n |
number of random deviates. |
Probability mass function
P[X=x] = \dfrac{e^{1/t} - 1}{e^{1/t} + 1} e^{-|x|/t}.
ddlaplace() returns a numeric vector representing the probability mass function of the discrete Laplace distribution.
rdlaplace() returns a numeric vector of random samples from the discrete Laplace distribution.
Canonne, C. L., Kamath, G., & Steinke, T. (2020). The Discrete Gaussian for Differential Privacy. arXiv. doi:10.48550/ARXIV.2004.00010
# mass function
ddlaplace(0)
# mass function is vectorized
ddlaplace(0:10, scale = 5)
# generate random samples
rdlaplace(10)