Skip to contents

Samples a mechanism on two neighbouring datasets and takes the largest log density ratio over histogram bins with enough mass in both.

Usage

morie_epsilon_dp(mech, D, D_prime, n_samples = 20000, bins = 50, seed = NULL)

Arguments

mech

function of (data) returning one release; called repeatedly.

D, D_prime

neighbouring datasets.

n_samples

draws per dataset.

bins

histogram bins.

seed

optional integer seed.

Value

list with epsilon_empirical, n_usable_bins, n_excluded_bins.

Details

This is a LOWER bound from one dataset pair. It can DISPROVE a claimed guarantee – if the empirical ratio exceeds the claimed epsilon, the claim is false – but it can never establish one, since some other pair of neighbours may do worse. Use it as a test, never as a certificate.

References

Ding, Z. et al. (2018). Detecting violations of differential privacy. CCS, 475-489.

Examples

set.seed(1)
m <- function(d) sum(d) + morie_dp_laplace_mechanism(0, 1, 1)$release
morie_epsilon_dp(m, rep(1, 10), rep(1, 9), n_samples = 2000)$epsilon_empirical
#> [1] 1.290984