ddlaplace {dapper} | R Documentation |
Discrete Laplace Distribution
Description
The probability mass function and random number generator for the discrete Laplacian distribution.
Usage
ddlaplace(x, scale = 1, log = FALSE)
rdlaplace(n, scale = 1)
Arguments
x |
a vector of quantiles. |
scale |
the scale parameter. |
log |
logical; if |
n |
number of random deviates. |
Details
Probability mass function
P[X=x] = \dfrac{e^{1/t} - 1}{e^{1/t} + 1} e^{-|x|/t}.
Value
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.
References
Canonne, C. L., Kamath, G., & Steinke, T. (2020). The Discrete Gaussian for Differential Privacy. arXiv. doi:10.48550/ARXIV.2004.00010
Examples
# mass function
ddlaplace(0)
# mass function is vectorized
ddlaplace(0:10, scale = 5)
# generate random samples
rdlaplace(10)
[Package dapper version 1.0.0 Index]