Skip to content

Observation model interface with binary parity #46

@m-murphy

Description

@m-murphy

Parent

#45

What to build

Introduce an observation-model abstraction in the MCMC chain with a narrow interface: log-likelihood of observations given a latent genotype support set and per-sample error parameters, and (later) latent genotype proposal. Move the existing binary TP/TN/FP/FN observation logic behind a BinaryObservationModel implementation without changing numerical behavior.

The chain delegates calculate_observation_likelihood to the selected model. Transmission likelihood, P(any missing), COI updates, and population frequency updates remain untouched. Default runtime behavior is identical to today: binary presence/absence barcodes and the same observation likelihood values.

Ship C++ unit tests that compare the wrapped binary model against fixed fixtures from the pre-refactor implementation. The existing R run_mcmc smoke test must pass with no API changes.

Acceptance criteria

  • Observation model interface exists with at least log-likelihood entry point used by the chain
  • Binary observation logic lives behind BinaryObservationModel; no scattered duplicate logic in the chain
  • C++ tests confirm binary log-likelihood matches pre-refactor values on hand-picked fixtures
  • tests/testthat/test-mcmc.R smoke test passes unchanged (binary path, default args)
  • No user-facing API changes in this slice

Blocked by

None - can start immediately

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions