Skip to content

Support time-varying ascertainment on the shared model axis #890

Description

@cdc-mitzimorris

PyRenew supports scalar ascertainment, but its APIs do not yet define end-to-end behavior for time-varying ascertainment.

Update the model contract as follows:

  • MultiSignalModel passes n_timepoints and first_day_dow to every registered AscertainmentModel.sample().
  • Fixed ascertainment models may ignore this context and continue returning scalars.
  • Time-varying models return one-dimensional trajectories with shape (n_timepoints,).
  • Ascertainment models declare whether they require a calendar anchor. Require obs_start_date only when a registered component does.
  • CountObservation applies ascertainment after clinical-delay convolution, giving time-varying rates observation-date indexing:
potential_counts = convolve(infections, delay_pmf, p_observed=1.0)
predicted_counts = potential_counts * ascertainment_rate

Keep compute_delay_ascertained_incidence() unchanged.

  • Existing scalar ascertainment models must retain their current NumPyro sites, output shapes, and model behavior.
  • Add tests for scalar equivalence, full-axis trajectory validation, calendar-aligned sampling, and observation-date ascertainment.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    modelrelated to models created using pyrenewpyrenewrelated to pyrenew internals

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions