
k-ary randomised response (local differential privacy)
Source:R/spatial_models.R
morie_local_dp_randomised_response.RdP(report = v | true = u) is e^eps / (k - 1 + e^eps) when
v == u and 1 / (k - 1 + e^eps) otherwise, so the ratio of any
two conditional probabilities is at most e^eps – the
eps-local-differential-privacy guarantee. Each respondent perturbs
their own value, so the collector never sees the truth. Raw counts
are biased towards uniform, hence the debiased estimate that
inverts the transition matrix.
Examples
morie_local_dp_randomised_response(truth = list(a = 1, b = 2), k = 5L, epsilon = 5L)
#> $reports
#> [1] 1 2
#>
#> $observed
#> [1] 0.0 0.5 0.5 0.0 0.0
#>
#> $estimate
#> [1] -0.006783655 0.510175482 0.510175482 -0.006783655 -0.006783655
#>
#> $p_keep
#> [1] 0.9737555
#>
#> $p_flip
#> [1] 0.006561113
#>
#> $epsilon
#> [1] 5
#>
#> $k
#> [1] 5
#>
#> $n
#> [1] 2
#>