Function opendp::measurements::then_base_laplace
source · pub fn then_base_laplace<D>(
scale: D::Atom,
k: Option<i32>
) -> PartialMeasurement<D, D::Carrier, D::InputMetric, MaxDivergence<D::Atom>>where
D: BaseLaplaceDomain,
(D, D::InputMetric): MetricSpace,
D::Atom: Float + SampleDiscreteLaplaceZ2k,
i32: ExactIntCast<<D::Atom as FloatBits>::Bits>,
Expand description
Make a Measurement that adds noise from the Laplace(scale
) distribution to a scalar value.
Valid inputs for input_domain
and input_metric
are:
input_domain | input type | input_metric |
---|---|---|
atom_domain(T) (default) | T | absolute_distance(T) |
vector_domain(atom_domain(T)) | Vec<T> | l1_distance(T) |
This function takes a noise granularity in terms of 2^k. Larger granularities are more computationally efficient, but have a looser privacy map. If k is not set, k defaults to the smallest granularity.
Arguments
input_domain
- Domain of the data type to be privatized.input_metric
- Metric of the data type to be privatized.scale
- Noise scale parameter for the laplace distribution.scale
== standard_deviation / sqrt(2).k
- The noise granularity in terms of 2^k.