covDP | R Documentation |
This function computes the differentially private covariance of a pair of vectors at user-specified privacy levels of epsilon and delta.
covDP(
x1,
x2,
eps,
lower.bound1,
upper.bound1,
lower.bound2,
upper.bound2,
which.sensitivity = "bounded",
mechanism = "Laplace",
delta = 0,
type.DP = "aDP"
)
x1 , x2 |
Numeric vectors whose covariance is desired. |
eps |
Positive real number defining the epsilon privacy budget. |
lower.bound1 , lower.bound2 |
Real numbers giving the global or public lower bounds of x1 and x2, respectively. |
upper.bound1 , upper.bound2 |
Real numbers giving the global or public upper bounds of x1 and x2, respectively. |
which.sensitivity |
String indicating which type of sensitivity to use. Can be one of {'bounded', 'unbounded', 'both'}. If 'bounded' (default), returns result based on bounded definition for differential privacy. If 'unbounded', returns result based on unbounded definition. If 'both', returns result based on both methods \insertCiteKifer2011DPpack. Note that if 'both' is chosen, each result individually satisfies (eps, delta)-differential privacy, but may not do so collectively and in composition. Care must be taken not to violate differential privacy in this case. |
mechanism |
String indicating which mechanism to use for differential
privacy. Currently the following mechanisms are supported: {'Laplace',
'Gaussian', 'analytic'}. Default is Laplace. See |
delta |
Nonnegative real number defining the delta privacy parameter. If 0 (default), reduces to eps-DP. |
type.DP |
String indicating the type of differential privacy desired for the Gaussian mechanism (if selected). Can be either 'pDP' for probabilistic DP \insertCiteMachanavajjhala2008DPpack or 'aDP' for approximate DP \insertCiteDwork2006bDPpack. Note that if 'aDP' is chosen, epsilon must be strictly less than 1. |
Sanitized covariance based on the bounded and/or unbounded definitions of differential privacy.
Dwork2006aDPpack
\insertRefKifer2011DPpack
\insertRefMachanavajjhala2008DPpack
\insertRefDwork2006bDPpack
\insertRefLiu2019bDPpack
D1 <- sort(stats::rnorm(500, mean=3, sd=2))
D2 <- sort(stats::rnorm(500, mean=-1,sd=0.5))
lb1 <- -3 # 3 std devs below mean
lb2 <- -2.5 # 3 std devs below mean
ub1 <- 9 # 3 std devs above mean
ub2 <- .5 # 3 std devs above mean
covDP(D1, D2, 1, lb1, ub1, lb2, ub2)
covDP(D1, D2, .5, lb1, ub1, lb2, ub2, which.sensitivity='unbounded',
mechanism='Gaussian', delta=0.01)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.