Skip to content

Add BDEI and BDSS linear phylodynamic models#6

Merged
kingaa merged 4 commits into
kingaa:masterfrom
Horopter:feature/bdss
Jun 13, 2026
Merged

Add BDEI and BDSS linear phylodynamic models#6
kingaa merged 4 commits into
kingaa:masterfrom
Horopter:feature/bdss

Conversation

@Horopter

@Horopter Horopter commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds yaml/bdei.yml and yaml/bdss.yml for two-deme linear birth-death processes used in PhyloDeep (Voznica et al.).
  • Registers each model with minimal wiring only: new .cc/.R files plus small patches to init.c, simulate.R, and yaml.R.
  • Does not bulk-regenerate existing models via add_model.R.
  • Refactors initial conditions to fraction-based IVPs (pop, fn/fs or fe/fi) matching the mers.yml pattern.
  • Renames transmission rates to lambda_* (lambda_ie in BDEI; lambda_nn, lambda_ns, lambda_sn, lambda_ss in BDSS).
  • Sets YAML rate defaults to midpoints of the PhyloDeep training priors (Voznica supplementary / treesimulator conventions).
  • Adds paper citations with URLs in each model's details block.

King et al. / Voznica alignment

  • BDEI: demes exposed and infectious (King Fig. 1A genealogy restriction). Rates: mu (E→I), lambda_ie (I→E birth), psi (I removal), Stadler sampling p on infectious removal — matches treesimulator BirthDeathExposedInfectiousModel. Default rates imply $R_0 \approx 2.3$, $T_I = 3$, $T_E/T_I \approx 2.6$.
  • BDSS: two fixed infective demes with donor-dependent transmission and shared removal/sampling; constraint $\lambda_{ss}/\lambda_{ns} = \lambda_{sn}/\lambda_{nn}$ per Voznica. Default rates imply $\lambda_n = 1$, $f = 0.125$, $X = 6.5$, $\mu = 1$. Distinct from King Fig. 1D (nonlinear behavioral SI2R).

Test plan

  • Rscript tests/bdei.R
  • Rscript tests/bdss.R
  • Package installs and compiles with both models registered
  • Fraction IVP scaling verified (pop + deme fractions → integer initial counts)

Add yaml/bdss.yml and register the model with minimal wiring in init.c,
simulate.R, and yaml.R. Generated C++ and R bindings included; no bulk
regeneration of existing models.
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.29630% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.80%. Comparing base (e2aaf75) to head (e1832a5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master       #6      +/-   ##
==========================================
- Coverage   98.91%   98.80%   -0.11%     
==========================================
  Files          71       75       +4     
  Lines        3764     3926     +162     
==========================================
+ Hits         3723     3879     +156     
- Misses         41       47       +6     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Register yaml/bdei.yml with minimal wiring alongside the existing BDSS
addition: only new model files plus init.c, simulate.R, and yaml.R patches.
@Horopter Horopter changed the title Add BDSS linear birth-death superspreading model Add BDEI and BDSS linear phylodynamic models Jun 5, 2026
Horopter added 2 commits June 5, 2026 03:44
Exercise initial grafting when IE0 > 0 or IS0 > 0 so patch coverage
reaches 100% for the new model code.
Use pop with deme fractions for initial counts, rename transmission rates
to lambda_*, set rate defaults to PhyloDeep training-prior midpoints, and
cite Voznica, Stadler, and King in the YAML details blocks.
@kingaa

kingaa commented Jun 8, 2026

Copy link
Copy Markdown
Owner

@Horopter : I'd like to harmonize the parameter names in the codes you've written with those used in the rest of the package. I've adjusted the names in the BDEI case: perhaps you can make the corresponding adjustments in the BDSS case?

@kingaa

kingaa commented Jun 8, 2026

Copy link
Copy Markdown
Owner

@Horopter : see my changes to your pull request. Can you make the corresponding changes for the BDSS model?

@kingaa kingaa merged commit e1832a5 into kingaa:master Jun 13, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants