Multiple merger polyploid scaling #2310
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Duplicate of #2309 from @JereKoskela , copying comment here for the record.
Adding tests for polyploid scaling for multiple merger coalescents turned out to be easy, but also sent me down a bit of a rabbit hole. Summary of changes:
msprime.c
which are unrelated to anything I've done (1396, 1899...) were put in by clang. Let me know if you want me to do something about them.g
should yield a coalescent growth rate of2g
,essentially because the coalescence probability in the Moran model is1/N^2
rather than1/N
. We had overlooked that, but it is now fixed.if (ploidy == 1) {...} else {...}
statements which became redundant.Q
later into the rejection sampler. It is now only done once a multiple merger event is definitely taking place.test_ancestry.py
started failing after the ploidy fix because the rate of multiple mergers wasn't high enough to guarantee one anymore. I increased it.psi = 1
in the Dirac coalescent for no reason. The documented (and sensible) range is0 < psi <= 1
. I tweaked the boundary values and associated tests to make the code consistent with the documentation.