pub fn make_randomized_response<T, QO>(
    categories: HashSet<T>,
    prob: QO,
    constant_time: bool
) -> Fallible<Measurement<AtomDomain<T>, T, DiscreteDistance, MaxDivergence<QO>>>where
    T: Hashable,
    bool: SampleBernoulli<QO>,
    QO: Float,
Expand description

Make a Measurement that implements randomized response on a categorical value.

Arguments

  • categories - Set of valid outcomes
  • prob - Probability of returning the correct answer. Must be in [1/num_categories, 1)
  • constant_time - Set to true to enable constant time. Slower.

Generics

  • T - Data type of a category.
  • QO - Data type of probability and output distance.