dpNoise: Differentially Private Noise Generator

Description Usage Arguments Value See Also Examples

View source: R/utilities-noise-generation.R

Description

Compile noise from a cryptographically secure random variates to achieve differentially private statistics.

Usage

1
dpNoise(n, scale, dist, shape = NULL, seed = NULL)

Arguments

n

An integer giving number of variates needed.

scale

Numeric, the scale for the distribution.

dist

A character specifying the distribution from which to draw the noise.

shape

An integer giving the shape parameter for the gamma distribution. Default to NULL.

seed

An integer indicating a seed for R's PNRG, defaults to NULL.

Value

Cryptographically secure noise vector or matrix.

See Also

dpUnif

Examples

1
2
3
laplace_noise <- dpNoise(n=1000, scale=1, dist='laplace')
gaussian_noise <- dpNoise(n=1000, scale=1, dist='gaussian')
laplace_noise_repeatable <- dpNoise(n=1, scale=1, dist='laplace', seed=96845)

privacytoolsproject/PSI-Library documentation built on Feb. 17, 2020, 2:03 p.m.