Gaussian copula · statistical imitation, not differential privacy

Synthetic Data Generator

Learn each column's distribution and the correlations between columns from a CSV, then generate any number of new rows. Compare marginals and correlations with the original, and check for exact copies and for synthetic rows that sit unusually close to a real one.

Data

Drop a CSV or XLSX file

Up to 25.0 MB and 300,000 rows; at most 60 modelled columns

The model is fitted to your real rows in this tab. It gives no formal privacy guarantee, so review the output before sharing it.

Synthetic Data Generator

Operator: Abdulla Al Fahad. How tools are built and checked

Real customer or patient rows cannot go into a demo, a bug report or a test fixture, and hand-made fake rows look nothing like the real thing: ages are uniform, every postcode is equally likely, income has no link to anything. A synthetic table keeps the shape of each column and the relationships between columns while containing no row you started with.

This page fits a statistical model to a CSV and draws new rows from it. It then measures how close the result is to the original, and how close individual synthetic rows come to real ones. It states one limit up front: this is statistical imitation, not differential privacy.

Key features

  • Per-column modelling: numbers and dates by smoothed quantiles, categories by their frequencies with rare values pooled as Other, a blank rate for every column
  • Dependence between columns through a Gaussian copula: normal scores, a correlation matrix, its Cholesky factor, and a shrinkage step when columns are nearly duplicates
  • Identifier columns get a fresh numbered sequence instead of being learned, and any column can be left out
  • Seeded generation of up to 200,000 rows, so the same seed and settings give the same output
  • Quality report: KS or total-variation distance per column, correlation matrices side by side with the largest and mean gap, and Cramér's V gaps for category pairs
  • Privacy screening: exact copies of real rows, with optional redraws, and nearest-neighbour distances compared with real-to-real distances

How the copula model learns a table and what the report measures

A numeric column is summarised by up to 200 quantiles. To draw a value the model takes a uniform number from the copula, interpolates between quantiles, adds Gaussian noise with Silverman's bandwidth (0.9 times the smaller of the standard deviation and IQR over 1.34, times n to the minus one fifth), and clips to the observed range. Integers stay integers, and decimals keep the most places seen in the data. Dates are handled as day numbers.

A category column is turned into an interval of the unit line per category, sized by frequency. The categories are ordered by their link to the numeric columns (by the mean of their rows' average normal score) so that an association with the numbers survives, and each row is given the expected normal score of its interval. Dependence between two category columns is only partly kept, because the copula measures monotone association and categories have no natural order.

Correlations are Pearson correlations of the normal scores, using pairwise complete rows on a random sample of up to 50,000 rows. If the matrix cannot be factorised it is blended toward the identity in steps until it can, and the page says how much it was shrunk.

How it works

Each synthetic row starts as a vector of independent standard normals, multiplied by the Cholesky factor to give correlated normal scores. Each score is converted to a probability with the normal CDF and passed through its column's quantile function or category intervals, then blanks are applied independently at each column's blank rate.

Exact copies are counted over every modelled column. With the redraw option on, rows that equal a real row are drawn again, up to five rounds, and the final count is reported with the count on the first draw.

Nearest-neighbour distance uses the mean over columns of a range-scaled absolute difference for numbers and dates and 0 or 1 for categories. Up to 1,500 synthetic rows are compared with up to 10,000 real rows, and the baseline is how close 1,500 real rows are to their nearest other real row.

Typical uses

  • A developer needs a 50,000-row stand-in for a few hundred real invoices to load-test a report, and generates it with the same distributions; the row count box allows up to 200,000.
  • A team sharing a bug report from a patient system sends a synthetic extract of the failing table instead of production rows.
  • An analyst building a dashboard demo for a conference replaces the customer table, keeping the age profile and the link between region and spend.
  • A data scientist checks that a pipeline survives blanks by generating a table with the original's blank rates and seeing which stage fails.
  • A student practising on a restricted dataset generates a synthetic copy to share with a study group.

Building one

  1. Drop the table you want to imitate and read the type the page guessed for each column. Mark identifier and free-text columns as such, since they are numbered afresh instead of learned.
  2. Set how many rows to generate, how many times a category must occur to be kept, and optionally a seed.
  3. Choose Generate synthetic rows. The quality report appears at once and the distance check follows; read Quality and Privacy checks, then download the CSV.

Example

600 invented invoices (InvoiceID, IssueDate, Segment, Region, Seats, Amount, DaysToPay), seed 12345, 600 rows generated, categories seen fewer than 3 times pooled

InvoiceID is an identifier; Segment and Region are categories; IssueDate is a date; Seats, Amount and DaysToPay are numbers
DaysToPay is blank on 6.7% of the invoices (unpaid)
Generate 600 rows with seed 12345, redraw exact copies on

Quality and privacy reports

6 modelled columns; InvoiceID becomes InvoiceID-0001 onwards
marginals: IssueDate KS 0.060, Segment total variation 0.007, Region 0.038, Seats KS 0.067, Amount 0.077, DaysToPay 0.039; DaysToPay blank 6.7% in the original and 5.3% in the synthetic table
correlations among the four numeric columns: largest gap 0.140 (IssueDate and Seats, 0.034 in the original and -0.105 in the synthetic rows), mean gap 0.101; Seats and Amount 0.969 against 0.923
exact copies: 0; nearest real row, 5th percentile 0.008 for synthetic rows against 0.006 for real-to-other-real (ratio 1.42); 0 synthetic rows closer to a real row than any two real rows are to each other

Tips for best results

  • Write the seed down. Re-running with the same file, settings and seed returns the same rows, which makes a bug report reproducible.
  • Raise the rare-category threshold for tables with few rows, since a category seen twice is close to a single person.
  • Drop columns the test does not need. Fewer columns mean a more reliable correlation matrix and fewer chances of an unusual combination.

Things to check before you rely on it

Nothing here is differential privacy. The model is fitted to the real rows, so extreme or rare real values can leave a trace, and no bound is placed on what an attacker with outside data could infer.

A copula captures pairwise, monotone dependence. Rules such as a discharge date never before an admit date, or a postcode that belongs to one state, are not enforced and can be violated.

The distance check is a screen. A ratio near or above 1 says synthetic rows are no closer to real ones than real rows are to each other; it does not certify that no real person can be recognised.

Common errors and how to fix them

Column X was set to number but only 12 of 400 values read as numbers.
Change the column's type to Category or Identifier, or clean the column first. The page will not model a number column that is mostly text.
At least 10 rows are needed to learn anything from the table.
Load a table with more rows. With only a handful of rows a fitted model would simply echo them.

Best practices

  • Treat the synthetic file as derived from sensitive data until a person has reviewed it; look at the smallest and largest values and at rare categories.
  • Compare the pairs your downstream work uses in the correlation table, not only the mean gap: a mean of 0.10 can hide one pair that is fine and another that is off by 0.14.

Frequently asked questions

Why do some synthetic rows sit closer to a real row than real rows are to each other?

With 480 real rows and 480 synthetic ones the chance of a close pair is not small, and the synthetic rows are drawn from a smoothed version of the same distribution. The page counts these rows and shows the 5th-percentile ratio, so you can see whether the pattern is mild (near 1) or strong (far below 1).

When is the mock CSV generator the better choice?

When no real table exists yet. The mock and fake-data generators build rows from rules and word lists you choose. This page needs a real table to learn from, and its output resembles that table in distributions and correlations without carrying any name or id from it.

Why do the correlations come out weaker than the original's?

Each numeric value is drawn with its own smoothing noise (Silverman's bandwidth), and noise added to one column independently of the others pulls Pearson correlations toward zero, most visibly for strongly linked pairs: Seats and Amount fall from 0.969 to 0.923 in the example. A larger synthetic table removes the sampling wobble but not that pull, so with the example the largest gap was 0.140 at 600 rows and 0.095 at 6,000. Treat the gap as a property of the model and check the pairs your analysis depends on.