| pmse | R Documentation |
The real and synthetic records are stacked and a logistic regression (main effects; categorical variables as dummies, missing values as indicators) predicts membership of the synthetic set. The propensity score mean-squared error
pMSE = \frac{1}{N}\sum_i (\hat p_i - c)^2,\quad c = n_{syn}/N
is 0 when the two sets are indistinguishable. pmse_ratio divides it by
its expectation under the null hypothesis that both sets come from the
same distribution, (k-1)(1-c)^2 c / N with k model
parameters; values near 1 indicate high utility.
pmse(
real,
synthetic,
vars = NULL,
max_rows = 10000L,
seed = NULL,
model = c("linear", "quadratic")
)
real, synthetic |
Data frames with common columns. |
vars |
Optional subset of variables. |
max_rows |
Each data set is subsampled to at most this many rows. |
seed |
Optional random seed (subsampling). |
model |
Propensity model: |
With model = "quadratic", squares and pairwise products of the numeric
variables are added to the logistic model (as recommended by Snoke et
al. for detecting differences in the dependence structure).
A list with pmse, pmse_null, pmse_ratio and n_params.
Snoke, J., Raab, G. M., Nowok, B., Dibben, C. and Slavkovic, A. (2018). General and specific utility measures for synthetic data. Journal of the Royal Statistical Society A, 181(3), 663–688. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/rssa.12358")}
syn <- synthesize(iris, seed = 1)
pmse(iris, syn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.