prdp#
Floating-point safe utility functions for per-record diffential privacy.
Functions#
Fourth root transformation mechanism. |
|
Square root transformation mechanism. |
|
Log transformation mechanism. |
|
Inverse CDF for a special case of the generalized Gaussian distribution. |
|
Samples a float from the generalized Gaussian distribution. |
|
Inverse CDF for the exponential polylogarithmic distribution. |
|
Samples a float from the exponential polylogarithmic distribution. |
- fourth_root_transformation_mechanism(x, offset, sigma)#
Fourth root transformation mechanism.
- square_root_transformation_mechanism(x, offset, sigma)#
Square root transformation mechanism.
- log_transformation_mechanism(x, offset, sigma)#
Log transformation mechanism.
- square_root_gaussian_inverse_cdf(x, sigma, prec)#
Inverse CDF for a special case of the generalized Gaussian distribution.
In particular, this function returns the inverse CDF of the generalized Gaussian distribution when the shape parameter is
1/2
:\[\begin{split}\begin{equation} \text{CDF}^{-1}(x) = \begin{cases} 0 & x = \frac{1}{2} \\ \sigma\left[-W\left(\frac{2x-2}{e}\right)-1\right]^2 & x > \frac{1}{2} \\ -\sigma\left[-W\left(\frac{-2x}{e}\right)-1\right]^2 & x < \frac{1}{2} \end{cases} \end{equation}\end{split}\]- Parameters:
x (tmlt.core.utils.arb.Arb) –
sigma (tmlt.core.utils.arb.Arb) –
prec (int) –
- Return type:
- square_root_gaussian_mechanism(sigma)#
Samples a float from the generalized Gaussian distribution.
- exponential_polylogarithmic_inverse_cdf(x, d, a, sigma, prec)#
Inverse CDF for the exponential polylogarithmic distribution.
In particular, this function computes the inverse CDF as defined below:
\[\begin{split}y = \begin{cases} - \sigma \exp \left[\left([2d]^{-1/2}\Phi^{-1}\left[\left(\left[1-\Phi\left(\frac{\ln(a)-(2d)^{-1}}{(2d)^{-1/2}}\right)\right][1- 2x] \right) + \Phi\left(\frac{\ln(a)-(2d)^{-1}}{(2d)^{-1/2}}\right) \right]\right) + (2d)^{-1} \right] + \sigma a& x <\frac{1}{2} \\ \sigma \exp \left[\left([2d]^{-1/2}\Phi^{-1}\left[\left(\left[1-\Phi\left(\frac{\ln(a)-(2d)^{-1}}{(2d)^{-1/2}}\right)\right][2x - 1]\right) + \Phi\left(\frac{\ln(a)-(2d)^{-1}}{(2d)^{-1/2}}\right) \right]\right) + (2d)^{-1}\right] - \sigma a& x >\frac{1}{2} \\ 0 & x = \frac{1}{2} \end{cases}\end{split}\]- Parameters:
x (tmlt.core.utils.arb.Arb) –
d (tmlt.core.utils.arb.Arb) –
a (tmlt.core.utils.arb.Arb) –
sigma (tmlt.core.utils.arb.Arb) –
prec (int) –
- Return type: