def starr(counts, r=1, **args): """The Starr estimator for the unseen mass Shorthand notation to be called as AlphaDiversityCalc """ sample = expand_counts(counts) shuffle(sample) # misuse r param for starr lookahead return starr_est(sample, m=r)[-1]
def lladser_pe(counts, r=10, **args): """Single point estimate of the conditional uncovered probability This function is just a wrapper around the full point estimator, intended to be called fo a single best estimate on a complete sample. """ sample = expand_counts(counts) shuffle(sample) try: pe = list(lladser_point_estimates(sample, r))[-1][0] except IndexError: pe = 'NaN' return pe
def lladser_ci(counts, r, alpha=0.95, f=10, ci_type='ULCL', **args): """Single CI of the conditional uncovered probability This function is just a wrapper around the full point estimator, intended to be called for a single best estimate on a complete sample. """ sample = expand_counts(counts) shuffle(sample) try: pe = list(lladser_ci_series(sample, r))[-1] except IndexError: pe = ('NaN','NaN') return pe
def test_expand_counts(self): """expand_counts should return correct expanded array""" c = array([2,0,1,2]) self.assertEqual(expand_counts(c), array([0,0,2,3,3]))