Measurements#
This section gives a high-level overview of the measurements that are available in the library. Refer to the section on measurements in the discussion of core structures for a defintion of “measurement” in OpenDP.
The intermediate domains and metrics need to match when chaining. This means you will need to choose a measurement that chains with your aggregator.
Additive Noise Mechanisms#
See the Additive Noise Mechanisms notebook for code examples and more exposition.
Notice that there is a symmetric structure to the additive noise measurements:
Vector Input Metric |
Constructor |
---|---|
|
|
|
QI
can be any numeric type (the data type of the sensitivity can vary independently from the data type of the input).
In the following sections, scalar-valued and vector-valued versions of each measurement are listed separately. You can choose whether to construct scalar or vector-valued versions of mechanisms by passing the appropriate input space. See the notebook above for examples.
Laplacian Noise#
These algorithms accept sensitivities in terms of the absolute or L2 metrics and measure privacy in terms of epsilon.
Use the opendp.accuracy.laplacian_scale_to_accuracy()
and opendp.accuracy.accuracy_to_laplacian_scale()
functions to convert to/from accuracy estimates.
Measurement |
Input Domain |
Input Metric |
Output Measure |
---|---|---|---|
|
|
|
|
|
|
|
Gaussian Noise#
These algorithms accept sensitivities in terms of the absolute or L2 metrics and measure privacy in terms of rho (zero-concentrated differential privacy).
Use the opendp.accuracy.gaussian_scale_to_accuracy()
and opendp.accuracy.accuracy_to_gaussian_scale()
functions to convert to/from accuracy estimates.
Refer to Measure Casting to convert to approximate DP.
Measurement |
Input Domain |
Input Metric |
Output Measure |
---|---|---|---|
|
|
|
|
|
|
|
Geometric Noise#
The geometric mechanism (make_geometric
) is an alias for the discrete Laplace (make_laplace
).
If you need constant-time execution to protect against timing side-channels, specify bounds!
Canonical Noise#
The canonical noise mechanism (opendp.measurements.make_canonical_noise()
)
is discussed in detail in these examples
Thresholded Noise Mechanisms#
Thresholded noise mechanisms are generalizations of the additive noise mechanisms
that also release a set of keys, whose values are greater than the threshold
parameter.
See the Thresholded Noise Mechanisms documentation for code examples and more exposition.
Just like the additive noise mechanisms, the thresholded noise mechanisms have a symmetric structure:
Vector Input Metric |
Constructor |
---|---|
|
|
|
Laplacian Noise#
The algorithm accepts L0
, L1
and L∞
sensitivities and measures privacy in terms of epsilon and delta.
Use the opendp.accuracy.laplacian_scale_to_accuracy()
and opendp.accuracy.accuracy_to_laplacian_scale()
functions to convert to/from accuracy estimates.
Measurement |
Input Domain |
Input Metric |
Output Measure |
---|---|---|---|
|
|
|
Gaussian Noise#
The algorithm accepts L0
, L2
and L∞
sensitivities and measures privacy in terms of rho and delta.
Use the opendp.accuracy.gaussian_scale_to_accuracy()
and opendp.accuracy.accuracy_to_gaussian_scale()
functions to convert to/from accuracy estimates.
Refer to Measure Casting to convert to approximate DP.
Measurement |
Input Domain |
Input Metric |
Output Measure |
---|---|---|---|
|
|
|
Approximate Laplace Projection#
In a similar regime as the thresholded noise mechanism, where keys themselves need to be protected, another approach is to release a differentially private low-dimensional projection of the key-space.
See Approximate Laplace Projection for a demonstration of the approach.
Measurement |
Input Domain |
Input Metric |
Output Measure |
---|---|---|---|
|
|
|
Noisy Max and Noisy Top K#
See Noisy Max Mechanisms for code examples and more exposition.
The report noisy top-k mechanism is used to privately release the indices of the maximum k values in a vector.
This is useful for private selection, and overlaps with the exponential mechanism.
Exponential noise is added to scores when the output measure is MaxDivergence
,
and Gumbel noise is added when the output measure is ZeroConcentratedDivergence
.
Measurement |
Input Domain |
Input Metric |
Output Measure |
---|---|---|---|
|
|
|
|
|
|
|
Report noisy max is a special case of noisy top k when k equals one.
Randomized Response#
These measurements are used to randomize an individual’s response to a query in the local-DP model.
See Randomized Response for code examples and more exposition.
Measurement |
Input Domain |
Input Metric |
Output Measure |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|