Test of random sampling - #499
Conversation
…ion signature mismatch
…ck into fix-power-divergence-test
|
@Mbompr some of the random tests have been failing since updating things for reasons unknown to me, please have a look and tell us what you think |
|
Hi @Mbompr My understanding is that we should do the following. As a benchmark, one could do the following: Or: Therefore, we should assert that the p-value calculated on our sample |
|
Sorry that is a bit old and I am not very proud of these tests that simply consist in checking that the C++ random number generator is working as expected... The tiny extra robustness they add to the project does not compensate the extra complexity they bring... |
589df77 to
6e30ca1
Compare
|
Hi @Mbompr I would say that we modify the statistical tests based on Kolmogorov- Smirnov and on Chi-square as in this PR. In addition, I wrote the script |
This PR is about the tests of sampling functions from
lib/cpp/random.Three issues are addressed:
chisquaretest andpower_divergencetest ofscipy.statsrequires that the sum of expected frequencies and the sum of observed frequencies be the same. Previously, we were using probabilities in place of expected frequencies.https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.chisquare.html
https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.power_divergence.html#scipy.stats.power_divergence
Usage of p-values in Kolmogorov-Smirnov tests and Chi square tests are made more explicit, and we give benchmarks from the performance of these test by using sampling methods from
scipy.We visualise the performance of the sampling functions from
lib/cpp/randomintick.random.tests.qqplots