Closed aminadibi closed 6 years ago
Seems we have incidence population in the first year, which should not be the case really
Trying to make incidence = 0 for the first year of the model.
Setting this:
if (output.n_agents>settings.n_base_agents) //now we are done with prevalent cases and are creating incident cases;
{
double incidence = 0;
if (calendar_time != 0) {
incidence = exp(input.agent.l_inc_betas[0]+input.agent.l_inc_betas[1]*calendar_time+input.agent.l_inc_betas[2]*calendar_time*calendar_time);
}
if(incidence<0.000000000000001) calendar_time=input.global_parameters.time_horizon; else calendar_time=calendar_time+1/(incidence*settings.n_base_agents);
}
last_id++;
Resulted in:
and
The first year seems to be matched, which is what we expected. Interesting though that the remainder looks so weird.
What does this do?
if(incidence<0.000000000000001) calendar_time=input.global_parameters.time_horizon; else calendar_time=calendar_time+1/(incidence*settings.n_base_agents);
problem solved.
The issue was that in order to prevent double population in the first year, we were suppressing prevalence and let incidence create all first year agents. Reversing that fixed the problem:
if (output.n_agents>settings.n_base_agents) //now we are done with prevalent cases and are creating incident cases;
{
double incidence = exp(input.agent.l_inc_betas[0]+input.agent.l_inc_betas[1]*calendar_time+input.agent.l_inc_betas[2]*calendar_time*calendar_time);
if(incidence<0.000000000000001) calendar_time=input.global_parameters.time_horizon; else {
if (calendar_time!=0) calendar_time=calendar_time+1/(incidence*settings.n_base_agents); else calendar_time=calendar_time+1; //suprresing incidence cases in the first year
}
}
last_id++;
validate_population in epicR v0.15.2 produces this:
Which comes from this data: