-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scipy.stats.chisquare throws error in compare_constraints.py due to unequal sum of frequencies #75
Comments
Hi doorleyr, |
Hi all, The workaround proporsed by @timothywhiteley seems to be a good solution to achieve that requirement. I also tried by normalizing both vectors to still have distributions that do not match but that sum up to 1 (the same total). Below the results:
As expected, normalizing by the constraints mean is closer to the result obtained before the new scipy test. I think we can still compare results by checking the resultant amount of persons by category trowed by the synthesizer. |
Is it resolved yet? |
The workaround given by @timothywhiteley is still working for me |
I do not understand why is it required to have the expected and observed counts to be the same. The test statistic can be calculated without this restriction ( sum{(observed_i-expected_i)^2/expected_i} ), the distribution table is given, I can not see any reason for this. |
Work around not working Dec 21 2023, any solutions? |
Worked for me on macos 14.3.1 with python 3.11 |
Hi, thanks for the great library. I'm trying to use this to generate some populations and I'm consistently getting the same error, even when I run the examples in this repository.
"ValueError: For each axis slice, the sum of the observed frequencies must agree with the sum of the expected frequencies to a relative tolerance of 1e-08, but the percent differences are:" ...
This error is coming from scipy.stats.chisquare which is called by the compare_to_constraints function. It appears that the sum of constraints.values is not always equal to the sum of counts.values (within the required tolerance) and this causes the error.
The text was updated successfully, but these errors were encountered: