Function smartnoise_runtime::utilities::mechanisms::simple_geometric_mechanism [−][src]
pub fn simple_geometric_mechanism(
value: i64,
epsilon: f64,
sensitivity: f64,
min: i64,
max: i64,
enforce_constant_time: bool
) -> Result<i64>
Returns noise drawn according to the Geometric mechanism.
Uses the Geometric mechanism as originally proposed in
Ghosh, Roughgarden, & Sundarajan (2012).
We are calling this the simple_geometric_mechanism
because there is some hope that we will later
add other versions, such as those developed in Balcer & Vadhan (2019)
Arguments
value
- Statistic to be privatized.epsilon
- Multiplicative privacy loss parametersensitivity
- L1 sensitivity of function you want to privatize. The Geometric is typically used for counting queries, where sensitivity = 1.min
- The minimum return you think possible.max
- The maximum return you think possible.enforce_constant_time
- Whether or not to run the noise generation algorithm in constant time. If true, will run max-min number of times.
Return
A draw according to the Geometric mechanism.
Examples
use smartnoise_runtime::utilities::mechanisms::simple_geometric_mechanism; let n = simple_geometric_mechanism(4, 0.1, 1., 0, 10, true);