DPMechExponential-class {diffpriv}R Documentation

An S4 class for the exponential mechanism of differential privacy.

Description

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.

Usage

## 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)

Arguments

object

an instance of class DPMech.

mechanism

an object of class DPMechExponential.

privacyParams

an object of class DPParamsEps.

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.

Value

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.

Methods (by generic)

Slots

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.

References

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.

Examples

## 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)

[Package diffpriv version 0.4.2 Index]