The exponential mechanism over rank, with utility
\(-|rank - qn|\) and each interval weighted by its width.
Usage
morie_dp_quantile(x, q = 0.5, epsilon = 1, a = NULL, b = NULL, seed = NULL)
Arguments
- x
values.
- q
quantile in (0, 1).
- epsilon
privacy budget.
- a, b
bounds. Taken from the data when NULL, which is itself a
non-private query – the function warns.
- seed
optional integer seed.
Value
list with release, true_quantile,
interval, probabilities, bounds.
Details
Adding noise to a quantile does not work: the global sensitivity of a
median is the whole domain, because one changed record can move it
from one end to the other. Selecting an INTERVAL by rank has
sensitivity 1 however extreme the values are, which is what makes the
release usable.
References
Smith, A. (2011). Privacy-preserving statistical
estimation with optimal convergence rates. STOC, 813-822.
Examples
set.seed(1)
r <- morie_dp_quantile(rnorm(500), q = 0.5, epsilon = 2, a = -4, b = 4)
round(r$release, 2)
#> [1] -0.03