sampling#

Sample distributions, either from real world data or from uniform distributions.

Functions

check_dist

Check whether counts match the expected distribution.

check_normal

Alias to check_dist(dist='normal')

check_poisson

Alias to check_dist(dist='poisson')

check_truncated_poisson

test if data fits in truncated poisson distribution between upperbound and lowerbound using kstest :type testdata: :param testdata: data to be tested :type testdata: array :type mu: :param mu: expected mean for the poisson distribution :type mu: float :type lowerbound: :param lowerbound: lowerbound for truncation :type lowerbound: float :type upperbound: :param upperbound: upperbound for truncation :type upperbound: float

fast_choice

Choose an option -- quickly -- from the provided weights.

resample_age

Resample age from single year age distribution.

sample_from_range

Sample from a distribution from min_val to max_val, inclusive.

sample_single_arr

Sample from a distribution.

sample_single_dict

Sample from a distribution.

set_seed

Reset the random seed -- complicated because of Numba.

statistic_test

Perform statistical checks for expected and actual data based on the null hypothesis that expected and actual distributions are identical.