Open hannahslater opened 8 months ago
To add two quick thoughts:
The rn and dn0 parameters used should sum to 1 or less, so I retried the script here with
dn0 = matrix(c(.43, .43), nrow = 2, ncol = 1), # Matrix of death probabilities for each mosquito species over time rn = matrix(c(.56, .56), nrow = 2, ncol = 1), # Matrix of repelling probabilities for each mosquito species over time
I also got a closer match bewteen the red and black line when i set enable_heterogeneity to FALSE in case that helps identify issues
simparams <- get_parameters( list(human_population = human_population, enable_heterogeneity = FALSE) )
Looks to me like sample_intervention()
is called here even when a bednet timestep is associated with 0 coverage, which would throw the RNG state off.
First try would be to add an if statement here to skip that call if coverage at that timepoint == 0
https://github.com/mrc-ide/malariasimulation/blob/397a7b7efe90958dd01f97110a1d16c71d041f33/R/vector_control.R#L137-L142
We were interested if there was different behaviour between having an intervention turned off compared to having it on at zero coverage. If you don’t set.seed, you get two runs that are different the whole way through (as you’d expect, and we were assuming this is the normal stochastic variation between runs)
But then if you set.seed before each run (and assuming the same seed), that’s when it gets a bit weird…(code attached is extended from your example on th
this refers to the second graph that the code below makes Black line is the simplest model run with no interventions Red line is LLINs turned ON but coverage = 0, but bednetstimesteps <- c(1, 4) Blue line is LLINs turned on, coverage = c(0, 0.4) and bednetstimesteps <- c(1, 4)
So you see that the black and red lines (which should be the same if they have the same set.seed?), but they start to diverge at t=365, the first LLIN timestep And then the blue and red lines (both LLIN on) are overlapping until the second LLIN timestep
So is something happening where the seed is changing after the interventions are being turned on?
[edited code formatting]