Skip to content

Is infection stratification flexible enough to current and future extensions #246

Open

Description

@seabbs

s_turing_model(model, Y)readsn_groupsandn_time`

How will this work if we have i.e a reporting triangle or other form of data that can't be expressed in a matrix. It seems like we might need to generalise this/rework it so it takes dimensions at build time in some other more flexible way.

Originally posted by @seabbs in #245

Activity

  1. seabbs-bot commented on Sep 2, 2026

    @seabbs-bot
    Collaborator

    Noted while working through the current batch, recording where this stands rather than closing it.

    The concrete constraint is that infection stratification is read off a matrix shape: _obs_data_shape derives n_strata from infection_strata applied to the observation stream count, which is the matrix's row count or the number of NamedTuple entries. A reporting triangle is neither, so it cannot state its stratum count that way.

    This overlaps #326 (Aggregate cannot take a MissingObservations carrier), which is being fixed now. Both are cases of a component needing to describe its own data shape rather than have one inferred from an array's dimensions. Rather than open a design issue blind, I will report back after #326 lands on whether that work makes taking dimensions at build time cheap, or whether it needs its own change.

    No action here for now.

    This was opened by a bot. Please ping @seabbs for any questions.

  2. seabbs-bot commented on Sep 4, 2026

    @seabbs-bot
    Collaborator

    Fixed in #363.

    The generalisation this asked for turned out to be smaller than a rework. The shape was already taken at build time; it was taken from the wrong place. _obs_data_shape read the stratum count off the data's array dimensions, which is right only where those dimensions are observation streams. A dense reporting triangle's rows are reference days and a BinomialError's N is a trials covariate, so both produced a stratified infection process nobody asked for and then failed with RandomWalk produces one path. Wrap it in a Stratify.

    #363 adds observation_streams(model, y_t), the seam a component uses to say how many observation streams a data value holds for it, and resolves the shape from the chain's own declaration first, reading the data only for what the chain leaves open. It extends the data_requirements machinery rather than adding a parallel one.

    No explicit dimensions slot was added to IDProblem. The build-time escape hatch already exists as as_turing_model(model, y_t, n) on IDModel, and the fault here was not a missing route but a wrong inference. Opened #364 for the IDProblem slot, should a case turn up that the seam cannot describe.

    This was opened by a bot. Please ping @seabbs for any questions.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions