| new_privacy {dapper} | R Documentation |
privacy Object Constructor.
Description
Creates a privacy object to be used as input into dapper_sample().
Usage
new_privacy(
post_f = NULL,
latent_f = NULL,
priv_f = NULL,
st_f = NULL,
npar = NULL,
varnames = NULL
)
Arguments
post_f |
a function that draws posterior samples given the confidential data. |
latent_f |
a function that represents the latent data sampling model. |
priv_f |
a function that represents the log likelihood of the privacy mechanism. |
st_f |
a function that calculates the statistic to be released. |
npar |
dimension of the parameter being estimated. |
varnames |
an optional character vector of parameter names. Used to label summary outputs. |
Details
post_f() is a function which makes draws from the posterior sampler. It has the syntax post_f(dmat, theta). Here
dmatis a numeric matrix representing the confidential database andthetais a numeric vector which serves as the initialization point for a one sample draw. The easiest, bug-free way to construct post_f() is to use a conjugate prior. However, this function can also be constructed by wrapping a MCMC sampler generated from other R packages (e.g. rstan, fmcmc, adaptMCMC).priv_f() is a function that represents the log of the privacy mechanism density. This function has the form priv_f(sdp, sx) where
sdpandsxare both either a numeric vector or matrix. The arguments must appear in the exact stated order with the same variables names as mentioned. Finally, the return value of priv_f() must be a numeric vector of length one.st_f() is a function which calculates a summary statistic. It has the syntax st_f(i, xi, sdp) where the three arguments must appear in the stated order. The role of this function is to represent terms in the definition of record additivity. Here
iis an integer, whilexiis an numeric vector andsdpis a numeric vector or matrix.-
nparis an integer equal to the dimension oftheta.
Value
A S3 object of class privacy.