DPMechNumeric-class: A virtual S4 class for differentially-private numeric...

Description Usage Arguments Value Methods (by generic) Slots Examples

Description

A virtual class that implements common features of Laplace, Gaussian mechanisms from differential privacy, for privatizing numeric vector releases.

Usage

1
2
3
4
5
6
7
8
9
## S4 method for signature 'DPMechNumeric'
show(object)

## S4 method for signature 'DPMechNumeric'
sensitivityNorm(mechanism, X1, X2)

## S4 method for signature 'DPMechNumeric,DPParamsEps'
releaseResponse(mechanism, privacyParams,
  X)

Arguments

object

an instance of class DPMech.

mechanism

an object of class DPMechNumeric-class.

X1

a privacy-sensitive dataset.

X2

a privacy-sensitive dataset.

privacyParams

an object of class DPParamsEps.

X

a privacy-sensitive dataset, if using sensitivity sampler a: list, matrix, data frame, numeric/character vector.

Value

scalar numeric norm of non-private target on datasets.

list with slots per argument, actual privacy parameter; mechanism response with length of target release: privacyParams, sensitivity, dims, target, response.

Methods (by generic)

Slots

sensitivity

non-negative scalar numeric target sensitivity. Defaults to Inf for use with sensitivitySampler().

target

the target non-private function to be privatized, takes lists. Defaults to a constant function. Laplace mechanism assumes functions that release numeric vectors of fixed dimension dims.

gammaSensitivity

NA_real_ if deactive, or scalar in [0,1) indicating that responses must be RDP with specific confidence.

dims

positive scalar numeric dimension of responses. Defaults to NA_integer_ for use with sensitivitySampler() which can probe target to determine dimension.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
f <- function(xs) mean(xs)
n <- 100
m <- DPMechLaplace(sensitivity = 1/n, target = f, dims = 1)
X1 <- runif(n)
X2 <- runif(n)
sensitivityNorm(m, X1, X2)
f <- function(xs) mean(xs)
n <- 100
m <- DPMechLaplace(sensitivity = 1/n, target = f, dims = 1)
X <- runif(n)
p <- DPParamsEps(epsilon = 1)
releaseResponse(m, p, X)

Example output

[1] 0.007968008
$privacyParams
Differential privacy level <U+03B5>=1
$sensitivity
[1] 0.01

$dims
[1] 1

$target
function (xs) 
mean(xs)

$response
[1] 0.4991703

diffpriv documentation built on May 2, 2019, 2:38 a.m.