Skip to content

Let netsim_scenarios() cycle a vector of restart paths across batches #69

Description

@smjenness

netsim_scenarios() and step_tmpl_netsim_scenarios() take a single path_to_x, so every replicate of every scenario reinitializes from the same saved state. That state's deviation is common to all replicates, so it is inherited as bias rather than averaged away, and adding replicates does not touch it.

Measured in EpiModel/LA-PrEP-2026 over 45 restart draws: at 250 replicates, restart-driven error in gonorrhea incidence is 8.23% against 0.57% from replication. Spreading the same replicate budget over several restarts is the largest error reduction available and it costs nothing: 8.23% at one restart, 4.12% at four, 2.06% at sixteen.

Today that needs either J separate workflow steps writing into J output directories, or a step_tmpl_map() fan-out. Both work and both are awkward to read back.

Proposed change: let path_to_x take a character vector and cycle it deterministically by batch, so batch b uses path_to_x[(b - 1) %% J + 1].

The determinism is the part that matters. Projects that pair arms under common random numbers need batch b of every scenario to share a restart as well as a seed, or the pairing breaks and every contrast gets noisier. A fixed cycle on the batch index gives that. Anything sampled per scenario does not.

Evidence: plan/calibration-restart-recommendations.md in EpiModel/LA-PrEP-2026.

The diagnostic that would have caught this before the calibration is EpiModel/EpiModelHIV-Template#62.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions