Skip to contents

Independent noisy histograms per feature, resampled.

Usage

morie_dp_synthetic_data(
  X,
  epsilon = 1,
  n_synth = NULL,
  bins = 10,
  bounds = NULL,
  seed = NULL
)

Arguments

X

data matrix.

epsilon

privacy budget (parallel across bins, split across features by composition).

n_synth

rows to generate; defaults to nrow(X).

bins

histogram bins per feature.

bounds

c(lo, hi) from outside the data.

seed

optional integer seed.

Value

list with synthetic, marginal_error, correlation_real, correlation_synthetic, preserved, destroyed.

Details

This preserves MARGINALS ONLY. Every inter-feature correlation is destroyed by construction, because each column is drawn independently – so a regression, an interaction, or any multivariate model fitted to the output will be wrong while looking entirely plausible. The returned correlation_real and correlation_synthetic are there to make that visible rather than discoverable later.

References

Zhang, J. et al. (2017). PrivBayes: private data release via Bayesian networks. ACM TODS, 42(4), 1-41.

Examples

set.seed(1)
r <- morie_dp_synthetic_data(matrix(rnorm(200), ncol = 2),
  epsilon = 4,
  bounds = c(-4, 4)
)
dim(r$synthetic)
#> [1] 100   2