Repository navigation
Conversation
GuidedGroupSampler moves two members of a family of closely related infections to new infection times; a deterministic pilot makes the family's genotypes consistent with its best internal transmission tree, and a walk redraws them in proportion to the target. PairLocusGibbsSampler redraws a related pair's genotypes at one locus together, by a Gibbs step over candidates fixed by the observed data. Each changes what a single-infection move cannot: an observed allele called a false positive while its relative drops the hidden allele it held for it. PairLocusGibbsSampler keeps only units that can change something: pairs at most maxNovelty loci apart, loci where their observed genotypes conflict, and an unobserved member's single-allele candidates from its partner's observed alleles; a unit with one candidate pair is dropped. Exact-draws tests check that each leaves its target invariant.
Each iteration makes FAMILY_RELOCATE_STEPS (5) GuidedGroupSampler relocations and FAMILY_PAIR_LOCUS_STEPS (20) PairLocusGibbsSampler steps, registered after the other samplers. Families are the mutual pairs whose observed genotypes are at most FAMILY_MAX_NOVELTY loci apart, and their connected triples. An input without families gets the two samplers too; they make no steps.
The example input has no families, so the two samplers make no steps and the draws a seed gives are unchanged; the Store gains their rows in structure/samplers and in each acceptance Window. plasmotrackr's acceptance tests count the two new sampler types.
…Sampler set builds the pairs once
…roposal; the relocation pilot builds its Proposal in one place
…ations and Proposals for steps, config.h the one source of their settings
m-murphy
force-pushed
the
stack/2-samplers
branch
from
November 8, 2026 02:04
697f6d2 to
d95298a
Compare
m-murphy
force-pushed
the
stack/3-family-moves
branch
from
November 8, 2026 02:04
b43f53c to
bb7218f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Family moves join every Sampler set except the null model's, which has no transmission. A family is a close mutual pair, or a connected triple of close pairs. A pair is close when at most 3 loci have an allele observed in one infection and not the other, counted in the direction where that count is smaller. Loci missing in either infection don't count.
No option: like every other sampler, they're always on outside the null model. The counts are
FAMILY_RELOCATIONSandFAMILY_PAIR_LOCUS_PROPOSALSinconfig.h, the one source of the family moves' settings. Both samplers use one closeness test (Family.h), and the three guided samplers share one log-weighted draw.CONTEXT.mdgains Family and Family move.Evidence
Before / after, six simulated studies × 4 chains, 3000 iterations, sampled log-uniform leak, mean over studies:
Chain disagreement roughly halves, for about 16% more time. In an earlier run, 50 relocations and 200 pair-locus Proposals cost about twice as much as 5 and 20, with no gain.
FamilyMovesTestchecks both moves leave their target invariant against exact draws, for a pair and for a relocation of a triple. A third test checks that missing loci don't count toward closeness. Engine tests: 316 pass, 1 skipped. plasmotrackr tests: 3724 pass.The example input has no families, so the golden Stores keep every draw. They gain only the two samplers' rows in
structure/samplersand inacceptance.Merge Danger
Door: two-way
Blast Radius: Runs