ExponentialMechanism | R Documentation |
This function implements the exponential mechanism for differential privacy by selecting the index of a vector of candidates to return according to a user-specified vector of utility function values, epsilon, and global sensitivity. Sensitivity calculated based either on bounded or unbounded differential privacy can be used \insertCiteKifer2011DPpack. If measure is provided, the probabilities of selecting each value are scaled according to the values in measure. If candidates is provided, the function returns the value of candidates at the selected index, rather than the index itself.
ExponentialMechanism(
utility,
eps,
sensitivity,
measure = NULL,
candidates = NULL
)
utility |
Numeric vector giving the utilities of the possible values. |
eps |
Positive real number defining the epsilon privacy budget. |
sensitivity |
Real number corresponding to the l1-global sensitivity of the function generating utility. |
measure |
Optional numeric vector of scaling measures for the probabilities of selecting each value. Should be same size as utility. Defaults to uniform scaling. |
candidates |
Optional vector of candidates of same size as utility. If given, the function returns the candidate at the selected index rather than the index itself. |
Indices (or values if candidates given) selected by the mechanism based on the bounded and/or unbounded definitions of differential privacy.
Dwork2006aDPpack
\insertRefKifer2011DPpack
\insertRefMcSherry2007DPpack
candidates <- c('a','b','c','d','e','f','g')
# Release index
idx <- ExponentialMechanism(c(0,1,2,3,2,1,0), 1, 1)
candidates[idx] # Randomly chosen candidate
# Release candidate
ExponentialMechanism(c(0,1,2,3,2,1,0), 1, .5, measure=c(1,1,2,1,2,1,1),
candidates=candidates)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.