statistic_test#

statistic_test(expected, actual, test=<function chisquare>, verbose=True, die=False, **kwargs)[source]#

Perform statistical checks for expected and actual data based on the null hypothesis that expected and actual distributions are identical. Throw assertion if the expected and actual data differ significantly based on the test selected. See https://docs.scipy.org/doc/scipy/reference/stats.html#statistical-tests.

Parameters:
  • expected (array) – the expected value; or, a tuple of arguments

  • actual (array) – the observed value, or distribution of values

  • test (scipy.stats) – scipy statistical tests functions, for example scipy.stats.chisquare

  • verbose (bool) – print a warning if the null hypothesis is rejected

  • die (bool) – raise an exception if the null hypothesis is rejected

  • **kwargs (dict) – optional arguments for statistical tests

Returns:

None.