-
Notifications
You must be signed in to change notification settings - Fork 76
Weird behaviour of ts.diversity with a single sample #2037
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Doesn't this fall into the category of "stats don't deal with missing data yet"? Since a ts with one sample is all missing data, by definition? |
This has two samples though @petrelharp, msprime is diploid by default now |
Ah - not in this example (I set ploidy to 1). But yes, maybe that's why. Although presumably it has a mutation above it, so is not strictly "missing"? I wonder if it works if there's topology and a unary root above the sample, though. |
Doh, @petrelharp is right of course. This is in the realm of missing data, and we don't deal with missing data at all in the stats framework. |
Yes, it's fine if there's topology above the single sample node. It's not fine, however, if the node is isolated, but with a mutation above it (i.e. is not missing):
gives
|
It should be impossible to calculate the diversity of a single sample, because we need to pick at least one pair of distinct samples to calculate it. So this is expected:
But looks what happens if there's only one sample in the ts:
The text was updated successfully, but these errors were encountered: