From d73a37c3c007ba712a9fada553f186714eacabff Mon Sep 17 00:00:00 2001 From: Peter Davidson Date: Mon, 5 Jun 2023 13:43:14 +1000 Subject: [PATCH] Fix issue discussed at https://github.com/UDST/synthpop/issues/75 --- synthpop/draw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthpop/draw.py b/synthpop/draw.py index f295076..33eff9e 100644 --- a/synthpop/draw.py +++ b/synthpop/draw.py @@ -165,7 +165,7 @@ def compare_to_constraints(synth, constraints): w = constraints >= 1 counts, constraints = counts[w], constraints[w] - return chisquare(counts.values, constraints.values) + return chisquare(counts.values, constraints.values*np.mean(counts.values)/np.mean(constraints.values)) def draw_households(