Learn R Programming

tidydp (version 0.1.0)

add_laplace_noise: Add Laplace Noise

Description

Adds Laplace-distributed noise to a numeric value or vector for differential privacy. The Laplace mechanism is typically used for queries with sensitivity based on the maximum absolute difference a single record can make.

Usage

add_laplace_noise(x, sensitivity, epsilon)

Value

Numeric value or vector with Laplace noise added

Arguments

x

Numeric value or vector to add noise to

sensitivity

The sensitivity of the query (maximum change from one record)

epsilon

Privacy parameter (smaller = more privacy, more noise)