ecoli.library.data_predicates

Data Predicates

Defines several assertions about data that are useful for tests, e.g. checks for monotonicity, whether the data approximately follows a Poisson distribution, etc.

All functions expect a 1D numpy array as first parameter.

TODO: - implement faster numpy-based solution for tests of increasing/decreasing

ecoli.library.data_predicates.all_negative(data)[source]
ecoli.library.data_predicates.all_nonnegative(data)[source]
ecoli.library.data_predicates.all_nonpositive(data)[source]
ecoli.library.data_predicates.all_positive(data)[source]
ecoli.library.data_predicates.approx_poisson(data, rate=None, significance=0.05, verbose=False)[source]

Test whether data appears to follow Poisson distribution, using Chi-sq goodness of fit. Does not do particularly well comparing poisson data of rate r_1 vs. poisson distribution of rate r_2. :param data: 1D array where index i corresponds the number of events observed in interval i. :param rate: rate (lambda) of the Poisson distribution against which to compare. If None, rate is estimated from the data. :param significance: for p > significance, fail to reject that the data is not Poisson-distributed. :param verbose: if True, prints estimated rate, and results (chi-sq, p-value) of the goodness-of-fit test.

ecoli.library.data_predicates.monotonically_decreasing(data)[source]
ecoli.library.data_predicates.monotonically_increasing(data)[source]
ecoli.library.data_predicates.strictly_decreasing(data)[source]
ecoli.library.data_predicates.strictly_increasing(data)[source]