# Estimate GDP from manually specified empirical trade-off points
# These could come from empirical measurements or privacy audits
empirical_points <- data.frame(
alpha = c(0.00, 0.05, 0.10, 0.25, 0.50, 1.00),
beta = c(1.00, 0.93, 0.87, 0.72, 0.43, 0.00)
)
result <- est_gdp(empirical_points)
result
# Visualise how well the GDP bound fits the empirical points
fdp(empirical_points, result)
# Find the GDP lower bound for a Laplace mechanism.
lap_mechanism <- lap(1.5)
gdp_bound <- est_gdp(lap_mechanism)
gdp_bound
# Compare the Laplace mechanism with its GDP lower bound
fdp(lap_mechanism, gdp_bound)
# Control precision with the dp parameter
result_1dp <- est_gdp(empirical_points, dp = 1L)
result_3dp <- est_gdp(empirical_points, dp = 3L)
# Higher precision gives tighter bounds
fdp(empirical_points, result_1dp, result_3dp)
Run the code above in your browser using DataLab