DPMechExponential-class {diffpriv} | R Documentation |
A class that implements the exponential mechanism of differential privacy,
for privatizing releases from sets (not necessarily numeric as
required by DPMechLaplace
). Currently limited to responses
from a finite sets - the most widely used case - as these induce easily
computed sampling distributions from a uniform base measure.
## S4 method for signature 'DPMechExponential'
show(object)
## S4 method for signature 'DPMechExponential,DPParamsEps'
releaseResponse(mechanism,
privacyParams, X)
## S4 method for signature 'DPMechExponential'
sensitivityNorm(mechanism, X1, X2)
object |
an instance of class |
mechanism |
an object of class |
privacyParams |
an object of class |
X |
a privacy-sensitive dataset, if using sensitivity sampler a: list, matrix, data frame, numeric/character vector. |
X1 |
a privacy-sensitive dataset. |
X2 |
a privacy-sensitive dataset. |
list with slots per argument, actual privacy parameter and response:
mechanism response with length of target release:
privacyParams, sensitivity, responseSet, target, response
.
scalar numeric norm of non-private target
on datasets.
show
: automatically prints the object.
releaseResponse
: releases exponential mechanism responses.
sensitivityNorm
: measures target
quality score sensitivity.
sensitivity
non-negative scalar numeric quality function sensitivity.
Defaults to Inf
for use with sensitivitySampler()
.
target
the quality score function mapping dataset to a function on
responses (elements of responseSet
).
gammaSensitivity
NA_real_
if inactive, or scalar in [0,1)
indicating that responses must be RDP with specific confidence.
responseSet
a list of possible responses of the mechanism.
Frank McSherry and Kunal Talwar. "Mechanism design via differential privacy." In the 48th Annual IEEE Symposium on Foundations of Computer Science (FOCS'07), pp. 94-103. IEEE, 2007.
## Sensitive data are strings of length at most 5.
## Task is to release most frequent character present, hence quality function
## is a closure that counts character frequencies for given candidate char.
## Global sensitivity is max string length.
qualF <- function(X) { function(r) sum(r == unlist(strsplit(X, ""))) }
rs <- as.list(letters)
m <- DPMechExponential(sensitivity = 5, target = qualF, responseSet = rs)
X <- strsplit("the quick brown fox jumps over the lazy dog"," ")[[1]]
p <- DPParamsEps(epsilon = 1)
releaseResponse(m, p, X)