resplab / epicR

R package for the Evaluation Platform in COPD (EPIC), an agent-based whole-disease model for projection of health and economic outcomes and COPD interventions.
11 stars 11 forks source link

Force identical simulations across different case detection scenarios #133

Open rachaelmountain opened 2 years ago

rachaelmountain commented 2 years ago

In the budget impact analysis I'm comparing multiple case detection scenarios. In each, case detection is introduced in 2022, giving 7 years worth of simulation data pre case detection. Is there any way to force those 7 years to be exactly the same across scenarios so we have identical baseline year (2021) values? For my analysis my cohort size is 18 million so baseline difference aren't huge but still a slight issue.

I had a go at this myself by refilling the random numbers at each agent creation (and also setting seed within R, of course). To do this I had to change how the multivariate normal and negative binomial random numbers were being simulated. This worked for small sample sizes (about 1,000) but not larger. I couldn't work out why - I'm guessing there's some other randomization within EPIC that I wasn't accounting for.