Skip to contents

Adds N(0, sigma^2) noise with \(\sigma = \Delta_2\sqrt{2\log(1.25/\delta)}/\epsilon\).

Usage

morie_dp_gaussian_mechanism(
  y,
  sensitivity = 1,
  epsilon = 1,
  delta = 1e-05,
  seed = NULL
)

Arguments

y

the true query answer; scalar or vector.

sensitivity

L2 sensitivity.

epsilon

privacy budget, positive.

delta

failure probability, in (0, 1).

seed

optional integer seed.

Value

list with release, sigma, epsilon, delta, sensitivity, and warnings when the classical bound does not apply.

Details

Calibrated to L2 sensitivity, not L1, which is why it beats Laplace for high-dimensional queries. The classical bound above is only valid for \(\epsilon \le 1\); past that it is not a proof of anything, and this function says so rather than returning a number that looks fine.

References

Dwork, C. and Roth, A. (2014). The algorithmic foundations of differential privacy. FnTTCS, 9(3-4), Appendix A.

Examples

round(morie_dp_gaussian_mechanism(10, 1, 0.5, 1e-5, seed = 1)$sigma, 4)
#> [1] 9.6896