Skip to content

Bug: Day-of-week effects are applied on the padded model axis instead of the observation axis #824

@cdc-mitzimorris

Description

@cdc-mitzimorris

PopulationCounts applies day_of_week_rv across the full padded daily model axis, including the initialization/backprojection period before the first observation. Day-of-week effects are reporting-process effects and should only apply to actual observation/reporting days.

This causes problems in padded MultiSignalModel workflows. In the H+E tutorial model, changing the ED day-of-week effect from fixed truth to a stochastic scaled-Dirichlet random variable causes the PyRenew fit to diverge and produce pathological latent infection trajectories. The same model with fixed day-of-week effects samples normally.

The latent infection trajectory before observation time 0 is an initialization/backprojection device. There are no reported ED observations in that interval, so there should be no ED day-of-week reporting effect there.

Currently, PyRenew treats the day-of-week effect as if it belongs to the shared padded model axis. That conflates two different calendars:

  • the latent/model axis, which begins n_init days before the first observation
  • the observation/reporting axis, which begins on obs_start_date

Day-of-week reporting effects should be aligned to the first observed report date, not to model-axis element 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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