INTERACTIVE COMPANION · METHODS · SAMPLING
The Sampling Bench
Two benches. The first lets you sample a community one individual at a time and watch the species count climb towards a true richness you can see on the screen, with the estimators trying to guess it from below. The second runs hundreds of replicate surveys and reports how far off each estimator was, on average and in the worst case.
Everything runs in your browser with no libraries and no network. The random number generator is seeded, so the same seed gives the same run every time. It is a different generator from the one numpy uses in the article's analysis, which means the two agree statistically and never digit for digit. The difference is shown rather than hidden.
Model 1. One individual at a time
The community below holds a number of species you chose. Nothing about the sampling is clever: an individual is drawn in proportion to its species' abundance, added to the running count, and dealt into one of ten quadrats in rotation. Watch the accumulation curve bend over long before it reaches the dashed line.
The last readout is the closed form, the thing the curve is a noisy realisation of:
It uses the abundances the model knows and you do not. If the observed count and that number drift apart by more than a species or two, the run has been unlucky rather than wrong.
Model 2. What each estimator is worth
One survey tells you nothing about an estimator. This bench runs the whole thing again and again on fresh communities drawn from the same family, and reports the average miss and the root mean square miss. Bias is what the textbooks quote. Root mean square error is what you care about when you get one afternoon and one survey.
| estimator | mean ± SE | bias | RMSE | article | difference |
|---|
Three numbers you can check with a calculator
The formulas are short enough to do by hand, which is the point of printing them.
Suppose a survey of 500 individuals turns up 86 species, of which 12 were seen exactly once
and 5 exactly twice. Then the bias-corrected Chao1 is
86 + 12×11 / (2×6) = 86 + 11 = 97.00. The second-order jackknife is
86 + 12×997/500 − 5×498²/(500×499) = 86 + 23.928 − 4.970 = 104.958.
And if those 86 species had been perfectly even at one percent each, the expected count from
500 draws would have been 100 × (1 − 0.99⁵⁰⁰) = 99.343
species, which is the number this page prints as the expected S. All three are checked against
the running code before the page is published.
What the model leaves out
Everything spatial. A quadrat here is an independent draw from the whole community, which no real quadrat has ever been. Every individual is identified correctly, which no real survey manages. Detection is uniform across species, so nothing is cryptic, nocturnal or too small to key. The community does not change while you sample it. Those four assumptions are what make the truth knowable, and they are also why an estimator that looks acceptable here can be much worse in a wood.
The article's effort table is the summary of all of this. The analysis code is the version that produced it, at 6,000 replicates per cell rather than the few hundred this page can manage while you wait.