Skip to contents

Rows are clipped to L2 norm C, the second-moment matrix formed, and symmetric Gaussian noise added with sigma calibrated to \(C^2/n\).

Usage

morie_dp_covariance(
  X,
  C = 1,
  epsilon = 1,
  delta = 1e-05,
  seed = NULL,
  project_psd = TRUE
)

Arguments

X

data matrix, one row per record.

C

L2 clipping norm for a row.

epsilon, delta

privacy budget.

seed

optional integer seed.

project_psd

project the result onto the PSD cone.

Value

list with release, raw (pre-projection), sigma, clipped_fraction, n_negative_eigenvalues.

Details

Noise breaks positive semi-definiteness, which matters because a covariance with negative eigenvalues is not a covariance and breaks anything downstream. Projecting onto the PSD cone is pure post-processing and therefore FREE – it costs no privacy at all. Many negative eigenvalues is the diagnostic worth watching: it means the budget is too small for this dimension, not that the projection failed.

References

Dwork, C. et al. (2014). Analyze Gauss: optimal bounds for privacy-preserving PCA. STOC, 11-20.

Examples

set.seed(1)
r <- morie_dp_covariance(matrix(rnorm(200), ncol = 2), C = 3, epsilon = 2)
dim(r$release)
#> [1] 2 2