marginal_metrics: Compare marginal distributions of real and synthetic data

View source: R/metrics.R

marginal_metricsR Documentation

Compare marginal distributions of real and synthetic data

Description

For each variable, marginal_metrics() reports

  • for numeric variables (incl. dates): the Kolmogorov–Smirnov distance between the empirical CDFs and the Wasserstein-1 distance scaled by the standard deviation of the real data;

  • for categorical variables: the total variation distance between the category proportions;

  • means, standard deviations and missing-value rates of both data sets.

Usage

marginal_metrics(real, synthetic, vars = NULL)

Arguments

real, synthetic

Data frames with common columns.

vars

Optional subset of variables.

Details

All distances are 0 for identical distributions; KS and TVD are bounded by 1.

Value

A data frame with one row per variable.

Examples

syn <- synthesize(iris, seed = 1)
marginal_metrics(iris, syn)

SynthesizerPlus documentation built on Oct. 16, 2026, 5:10 p.m.