You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A strata Split with a weight map cannot simulate from missing data #365
Found while fixing #246, while checking every branch of the shape resolution.
Split(template, map) resolves a stratum count from its weight map with no data, so as_turing_model builds the right-shaped infection process for y_t = missing. The model then fails inside Split:
problem =IDProblem(
infection =DirectInfections(;
Z =Stratify(RandomWalk(), Hierarchy(; across =IID(Normal(0, 0.5)))),
initialisation =Normal(log(20), 0.2)),
observation_model =Split(PoissonError(), [1.01.01.0]),
tspan = (1, 12))
as_turing_model(problem, (; y_t =missing))
# ERROR: A strata Split needs a NamedTuple or AbstractMatrix `y_t` to name its streams
_split_names reads the stream names off y_t, and missing names nothing. The workaround is to pass a matrix of missings of the right stream count, which is what the tests and the IDModel docstring do. That works but means the shape is being carried by a placeholder array rather than by the model.
A map fixes the stream count outright as size(map, 1), so _split_names could fall back to "group1", "group2", … for that many streams rather than erroring. That would make a mapped Split simulate the way every other observation model does.
Behaviour on main and unchanged by #363, which only resolves the shape.
This was opened by a bot. Please ping @seabbs for any questions.
Activity