Skip to content

Commit d14351e

Browse files
authoredJul 14, 2020
Relative susceptible by interaction (BDI-pathogens#148)
* Bugfix - remove occupation network from params object once set up If model is created multiple times from the same params object then we get different answers. Problem with the Simulation Python interface, but not the Model Python interface (so was missed in tests). * Make releative_susceptibility_xxxx per interaction not per day Remove the normalisation to the based on the mean number of interactions to the adjusted susceptibility * Update baseline parameters for asypmtomatic, mild and hospitalised * Change equation to normalise by mean interactions Not mean interactions by age * Update doc with hew def of relative susceptibility * Update realtive severity infectiousness data with Sun data * Update the header of set_up_infectious_curves Remove the text saying we adjust by mean interactions for the age group * Update with calibrated infectious parameter and lockdown rate * Increase number of cases in test_disease_transition_times Test failing with a very small number of cases leading to inaccuracy * Decrease the infectious rate to reduce saturation effect test_relative_transmission_update is running in to saturation effect with the updated params
1 parent 3f2e046 commit d14351e

13 files changed

+299
-302
lines changed
 

‎documentation/covid19.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Combining all effects, we model the rate at which the virus is transmitted in a
126126

127127
<p><img src="eqn_transmission_rate.png" height="80"></p>
128128

129-
where *t* is the time since infection; *s<sub>i</sub>* indicates the infector's symptom status (asymtomatic, mild, moderate/severe); *a<sub>s</sub>* is the age of the susceptible; *n* is the type of network where the interaction occurred; *I<sub>a<sub>s</sub></sub>* is the mean number of daily interactions for somebody of the age of the susceptible; *f<sub>&#915;</sub>(u; &#956;,&#963;<sup>2</sup>)* is the probability density function of a gamma distribution; *&#956;<sub>i</sub>* and *&#963;<sub>i</sub>* are the mean and width of the infectiousness curve; *R* scales the overall infection rate (under some simplifying assumptions it is mean number of people infected by each moderately/severely symptomatic individual); *S<sub>a<sub>s</sub></sub>* is the scale-factor for the age of the susceptible; *A<sub>s<sub>i</sub></sub>* is the scale-factor for the infector being asymptomatic; *B<sub>n</sub>* is the scale-factor for the network on which the interaction occurred.
129+
where *t* is the time since infection; *s<sub>i</sub>* indicates the infector's symptom status (asymtomatic, mild, moderate/severe); *a<sub>s</sub>* is the age of the susceptible; *n* is the type of network where the interaction occurred; *I* is the mean number of daily interactions; *f<sub>&#915;</sub>(u; &#956;,&#963;<sup>2</sup>)* is the probability density function of a gamma distribution; *&#956;<sub>i</sub>* and *&#963;<sub>i</sub>* are the mean and width of the infectiousness curve; *R* scales the overall infection rate (under some simplifying assumptions it is mean number of people infected by each moderately/severely symptomatic individual); *S<sub>a<sub>s</sub></sub>* is the scale-factor for the age of the susceptible; *A<sub>s<sub>i</sub></sub>* is the scale-factor for the infector being asymptomatic; *B<sub>n</sub>* is the scale-factor for the network on which the interaction occurred.
130130
Table [Infection parameters](./parameters/infection_parameters.md) contains the values of the parameters used in simulations.
131131
The rate of virus transmission is converted to a probability of transmission
132132

-16.5 KB
Loading

‎documentation/parameters/disease_dynamics_parameters.md

+27-27
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,35 @@
1010
| `sd_time_to_recover` | 5 | &#963;<sub>rec</sub> | Standard deviation of time to recovery if hospitalisaion is not required (days) | Yang et al 2020 |
1111
| `mean_time_to_death` | 11.74 | &#956;<sub>death</sub> | Mean time to death after acquiring critical care (days) | Personal communication with SPI-M; data soon to be published |
1212
| `sd_time_to_death` | 8.79 | &#963;<sub>death</sub> | Standard deviation of time to death after acquiring critical care (days) | Personal communication with SPI-M; data soon to be published |
13-
| `fraction_asymptomatic_0_9` | 0.605 | &#966;<sub>asym</sub>(0-9) | Fraction of infected individuals who are asymptomatic, aged 0-9 | - |
14-
| `fraction_asymptomatic_10_19` | 0.546 | &#966;<sub>asym</sub>(10-19) | Fraction of infected individuals who are asymptomatic, aged 10-19 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
15-
| `fraction_asymptomatic_20_29` | 0.483 | &#966;<sub>asym</sub>(20-29) | Fraction of infected individuals who are asymptomatic, aged 20-29 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
16-
| `fraction_asymptomatic_30_39` | 0.418 | &#966;<sub>asym</sub>(30-39) | Fraction of infected individuals who are asymptomatic, aged 30-39 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
17-
| `fraction_asymptomatic_40_49` | 0.354 | &#966;<sub>asym</sub>(40-49) | Fraction of infected individuals who are asymptomatic, aged 40-49 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
18-
| `fraction_asymptomatic_50_59` | 0.294 | &#966;<sub>asym</sub>(50-59) | Fraction of infected individuals who are asymptomatic, aged 50-59 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
19-
| `fraction_asymptomatic_60_69` | 0.242 | &#966;<sub>asym</sub>(60-69) | Fraction of infected individuals who are asymptomatic, aged 60-69 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
20-
| `fraction_asymptomatic_70_79` | 0.199 | &#966;<sub>asym</sub>(70-79) | Fraction of infected individuals who are asymptomatic, aged 70-79 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
21-
| `fraction_asymptomatic_80` | 0.163 | &#966;<sub>asym</sub>(80) | Fraction of infected individuals who are asymptomatic, aged 80+ | - |
22-
| `mild_fraction_0_9` | 0.387 | &#966;<sub>mild</sub>(0-9) | Fraction of infected individuals with mild symptoms, aged 0-9 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
23-
| `mild_fraction_10_19` | 0.435 | &#966;<sub>mild</sub>(10-19) | Fraction of infected individuals with mild symptoms, aged 10-19 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
24-
| `mild_fraction_20_29` | 0.478 | &#966;<sub>mild</sub>(20-29) | Fraction of infected individuals with mild symptoms, aged 20-29 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
25-
| `mild_fraction_30_39` | 0.512 | &#966;<sub>mild</sub>(30-39) | Fraction of infected individuals with mild symptoms, aged 30-39 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
26-
| `mild_fraction_40_49` | 0.532 | &#966;<sub>mild</sub>(40-49) | Fraction of infected individuals with mild symptoms, aged 40-49 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
27-
| `mild_fraction_50_59` | 0.541 | &#966;<sub>mild</sub>(50-59) | Fraction of infected individuals with mild symptoms, aged 50-59 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
28-
| `mild_fraction_60_69` | 0.543 | &#966;<sub>mild</sub>(60-69) | Fraction of infected individuals with mild symptoms, aged 60-69 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
29-
| `mild_fraction_70_79` | 0.541 | &#966;<sub>mild</sub>(70-79) | Fraction of infected individuals with mild symptoms, aged 70-79 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
30-
| `mild_fraction_80` | 0.534 | &#966;<sub>mild</sub>(80) | Fraction of infected individuals with mild symptoms, aged 80+ | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
13+
| `fraction_asymptomatic_0_9` | 0.456 | &#966;<sub>asym</sub>(0-9) | Fraction of infected individuals who are asymptomatic, aged 0-9 | - |
14+
| `fraction_asymptomatic_10_19` | 0.412 | &#966;<sub>asym</sub>(10-19) | Fraction of infected individuals who are asymptomatic, aged 10-19 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
15+
| `fraction_asymptomatic_20_29` | 0.370 | &#966;<sub>asym</sub>(20-29) | Fraction of infected individuals who are asymptomatic, aged 20-29 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
16+
| `fraction_asymptomatic_30_39` | 0.332 | &#966;<sub>asym</sub>(30-39) | Fraction of infected individuals who are asymptomatic, aged 30-39 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
17+
| `fraction_asymptomatic_40_49` | 0.296 | &#966;<sub>asym</sub>(40-49) | Fraction of infected individuals who are asymptomatic, aged 40-49 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
18+
| `fraction_asymptomatic_50_59` | 0.265 | &#966;<sub>asym</sub>(50-59) | Fraction of infected individuals who are asymptomatic, aged 50-59 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
19+
| `fraction_asymptomatic_60_69` | 0.238 | &#966;<sub>asym</sub>(60-69) | Fraction of infected individuals who are asymptomatic, aged 60-69 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
20+
| `fraction_asymptomatic_70_79` | 0.214 | &#966;<sub>asym</sub>(70-79) | Fraction of infected individuals who are asymptomatic, aged 70-79 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
21+
| `fraction_asymptomatic_80` | 0.192 | &#966;<sub>asym</sub>(80) | Fraction of infected individuals who are asymptomatic, aged 80+ | - |
22+
| `mild_fraction_0_9` | 0.533 | &#966;<sub>mild</sub>(0-9) | Fraction of infected individuals with mild symptoms, aged 0-9 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
23+
| `mild_fraction_10_19` | 0.569 | &#966;<sub>mild</sub>(10-19) | Fraction of infected individuals with mild symptoms, aged 10-19 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
24+
| `mild_fraction_20_29` | 0.597 | &#966;<sub>mild</sub>(20-29) | Fraction of infected individuals with mild symptoms, aged 20-29 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
25+
| `mild_fraction_30_39` | 0.614 | &#966;<sub>mild</sub>(30-39) | Fraction of infected individuals with mild symptoms, aged 30-39 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
26+
| `mild_fraction_40_49` | 0.616 | &#966;<sub>mild</sub>(40-49) | Fraction of infected individuals with mild symptoms, aged 40-49 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
27+
| `mild_fraction_50_59` | 0.602 | &#966;<sub>mild</sub>(50-59) | Fraction of infected individuals with mild symptoms, aged 50-59 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
28+
| `mild_fraction_60_69` | 0.571 | &#966;<sub>mild</sub>(60-69) | Fraction of infected individuals with mild symptoms, aged 60-69 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
29+
| `mild_fraction_70_79` | 0.523 | &#966;<sub>mild</sub>(70-79) | Fraction of infected individuals with mild symptoms, aged 70-79 | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
30+
| `mild_fraction_80` | 0.461 | &#966;<sub>mild</sub>(80) | Fraction of infected individuals with mild symptoms, aged 80+ | Calibration of Riccardo et al. 2020 & Spanish Serology Survey |
3131
| `mean_asymptomatic_to_recovery` | 15 | &#956;<sub>a,rec</sub> | Mean time from infection to recovery (and no longer infectious) for an asymptomatic individual (days) | Yang et al 2020 |
3232
| `sd_asymptomatic_to_recovery` | 5 | &#963;<sub>a,rec</sub> | Standard deviation from infection to recovery for an asymptomatic individual (days) | Yang et al 2020 |
33-
| `hospitalised_fraction_0_9` | 0.002 | &#966;<sub>hosp</sub>(0-9) | Fraction of infected individuals with severe symptoms aged 0-9 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
34-
| `hospitalised_fraction_10_19` | 0.009 | &#966;<sub>hosp</sub>(10-19) | Fraction of infected individuals with severe symptoms aged 10-19 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
35-
| `hospitalised_fraction_20_29` | 0.017 | &#966;<sub>hosp</sub>(20-29) | Fraction of infected individuals with severe symptoms aged 20-29 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
36-
| `hospitalised_fraction_30_39` | 0.065 | &#966;<sub>hosp</sub>(30-39) | Fraction of infected individuals with severe symptoms aged 30-39 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
37-
| `hospitalised_fraction_40_49` | 0.186 | &#966;<sub>hosp</sub>(40-49) | Fraction of infected individuals with severe symptoms aged 40-49 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
38-
| `hospitalised_fraction_50_59` | 0.231 | &#966;<sub>hosp</sub>(50-59) | Fraction of infected individuals with severe symptoms aged 50-59 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
39-
| `hospitalised_fraction_60_69` | 0.324 | &#966;<sub>hosp</sub>(60-69) | Fraction of infected individuals with severe symptoms aged 60-69 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
40-
| `hospitalised_fraction_70_79` | 0.387 | &#966;<sub>hosp</sub>(70-79) | Fraction of infected individuals with severe symptoms aged 70-79 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
41-
| `hospitalised_fraction_80` | 0.439 | &#966;<sub>hosp</sub>(80) | Fraction of infected individuals with severe symptoms aged 80+ who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
33+
| `hospitalised_fraction_0_9` | 0.001 | &#966;<sub>hosp</sub>(0-9) | Fraction of infected individuals with severe symptoms aged 0-9 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
34+
| `hospitalised_fraction_10_19` | 0.006 | &#966;<sub>hosp</sub>(10-19) | Fraction of infected individuals with severe symptoms aged 10-19 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
35+
| `hospitalised_fraction_20_29` | 0.015 | &#966;<sub>hosp</sub>(20-29) | Fraction of infected individuals with severe symptoms aged 20-29 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
36+
| `hospitalised_fraction_30_39` | 0.069 | &#966;<sub>hosp</sub>(30-39) | Fraction of infected individuals with severe symptoms aged 30-39 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
37+
| `hospitalised_fraction_40_49` | 0.219 | &#966;<sub>hosp</sub>(40-49) | Fraction of infected individuals with severe symptoms aged 40-49 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
38+
| `hospitalised_fraction_50_59` | 0.279 | &#966;<sub>hosp</sub>(50-59) | Fraction of infected individuals with severe symptoms aged 50-59 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
39+
| `hospitalised_fraction_60_69` | 0.370 | &#966;<sub>hosp</sub>(60-69) | Fraction of infected individuals with severe symptoms aged 60-69 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
40+
| `hospitalised_fraction_70_79` | 0.391 | &#966;<sub>hosp</sub>(70-79) | Fraction of infected individuals with severe symptoms aged 70-79 who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
41+
| `hospitalised_fraction_80` | 0.379 | &#966;<sub>hosp</sub>(80) | Fraction of infected individuals with severe symptoms aged 80+ who are hospitalised | Calibration of Riccardo et al. 2020 & Spanish Serology Survey & Ferguson et al. 2020 |
4242
| `critical_fraction_0_9` | 0.05 | &#966;<sub>crit</sub>(0-9) | Fraction of hospitalised individuals aged 0-9 who need critical care | Ferguson et al, 2020 |
4343
| `critical_fraction_10_19` | 0.05 | &#966;<sub>crit</sub>(10-19) | Fraction of hospiatlised individuals aged 10-19 who need critical care | Ferguson et al, 2020 |
4444
| `critical_fraction_20_29` | 0.05 | &#966;<sub>crit</sub>(20-29) | Fraction of hospitalised individuals aged 20-29 who need critical care | Ferguson et al, 2020 |

‎documentation/parameters/infection_parameters.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
| `n_seed_infection` | 5 | - | Number of infections seeded at simulation start | - |
55
| `mean_infectious_period` | 5.5 | &#956; | Mean of the generation time distribution (days) | Ferretti et al in prep 2020; Ferretti & Wymant et al 2020; Xia et al 2020; He et al 2020; Cheng et al 2020 |
66
| `sd_infectious_period` | 2.14 | &#963; | Standard deviation (days) of infectious period | Ferretti et al in prep 2020; Ferretti & Wymant et al 2020; Xia et al 2020; He et al 2020; Cheng et al 2020 |
7-
| `infectious_rate` | 5.64 | *R* | Mean number of individuals infected by each infectious individual with moderate to severe symptoms | Derived from calibration |
8-
| `asymptomatic_infectious_factor` | 0.29 | *A<sub>asym</sub>* | Infectious rate of asymptomatic individuals relative to symptomatic individuals | Luo et al 2020 |
9-
| `mild_infectious_factor` | 0.48 | *A<sub>mild</sub>* | Infectious rate of mildly symptomatic individuals relative to symptomatic individuals | Luo et al 2020 |
7+
| `infectious_rate` | 5.18 | *R* | Mean number of individuals infected by each infectious individual with moderate to severe symptoms | Derived from calibration |
8+
| `asymptomatic_infectious_factor` | 0.33 | *A<sub>asym</sub>* | Infectious rate of asymptomatic individuals relative to symptomatic individuals | Personal communication, Sun |
9+
| `mild_infectious_factor` | 0.72 | *A<sub>mild</sub>* | Infectious rate of mildly symptomatic individuals relative to symptomatic individuals | Personal communction, Sun |
1010
| `relative_susceptibility_0_9` | 0.35 | *S<sub>0-9</sub>* | Relative susceptibility to infection, aged 0-9 | Zhang et al. 2020 |
1111
| `relative_susceptibility_10_19` | 0.69 | *S<sub>10-19</sub>* | Relative susceptibility to infection, aged 10-19 | Zhang et al. 2020 |
1212
| `relative_susceptibility_20_29` | 1.03 | *S<sub>20-29</sub>* | Relative susceptibility to infection, aged 20-29 | Zhang et al. 2020 |

‎documentation/parameters/parameter_dictionary.md

+36-36
Large diffs are not rendered by default.

‎documentation/parameters/passive_intervention_parameters.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
| `quarantined_daily_interactions` | 0 | - | Daily random interactions of a quarantined individual | - |
88
| `hospitalised_daily_interactions` | 0 | - | Daily random interactions of a hospitalised individual | - |
99
| `self_quarantine_fraction` | 0 | - | Proportion of people who self-quarantine upon symptoms | - |
10-
| `lockdown_occupation_multiplier_primary_network` | 0.22 | - | Relative change in number of occupation network contacts on lockdown for primary age | - |
11-
| `lockdown_occupation_multiplier_secondary_network` | 0.22 | - | Relative change in number of occupation network contacts on lockdown for secondary age | - |
12-
| `lockdown_occupation_multiplier_working_network` | 0.22 | - | Relative change in number of occupation network contacts on lockdown for working age | Based on an estimate of the number of key workers |
13-
| `lockdown_occupation_multiplier_retired_network` | 0.22 | - | Relative change in number of occupation network contacts on lockdown for retired age | - |
14-
| `lockdown_occupation_multiplier_elderly_network` | 0.22 | - | Relative change in number of occupation network contacts on lockdown for elderly | - |
15-
| `lockdown_random_network_multiplier` | 0.22 | - | Relative change in random network contacts on lockdown | - |
10+
| `lockdown_occupation_multiplier_primary_network` | 0.29 | - | Relative change in number of occupation network contacts on lockdown for primary age | - |
11+
| `lockdown_occupation_multiplier_secondary_network` | 0.29 | - | Relative change in number of occupation network contacts on lockdown for secondary age | - |
12+
| `lockdown_occupation_multiplier_working_network` | 0.29 | - | Relative change in number of occupation network contacts on lockdown for working age | Based on an estimate of the number of key workers |
13+
| `lockdown_occupation_multiplier_retired_network` | 0.29 | - | Relative change in number of occupation network contacts on lockdown for retired age | - |
14+
| `lockdown_occupation_multiplier_elderly_network` | 0.29 | - | Relative change in number of occupation network contacts on lockdown for elderly | - |
15+
| `lockdown_random_network_multiplier` | 0.29 | - | Relative change in random network contacts on lockdown | - |
1616
| `lockdown_house_interaction_multiplier` | 1.5 | - | Relative change in household network contacts on lockdown | - |

‎src/disease.c

+11-13
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ void set_up_transition_times( model *model )
5656
* Name: estimate_mean_interactions_by_age
5757
* Description: estimates the weighted mean number of interactions by age
5858
* each interaction is weighted by the type factor
59+
*
60+
* Argument: age - integer of the age group, if age == -1 then include everyone
61+
*
5962
* Returns: void
6063
******************************************************************************************/
6164
double estimate_mean_interactions_by_age( model *model, int age )
@@ -66,26 +69,26 @@ double estimate_mean_interactions_by_age( model *model, int age )
6669
double *weight = model->params->relative_transmission;
6770

6871
for( pdx = 0; pdx < model->params->n_total; pdx++ )
69-
if( model->population[pdx].age_type == age )
72+
if( ( model->population[pdx].age_type == age ) | ( age == -1 ) )
7073
{
7174
people++;
7275
inter += model->population[pdx].base_random_interactions * weight[RANDOM];
7376
}
7477

7578
for( pdx = 0; pdx < model->household_network->n_edges; pdx++ )
7679
{
77-
if( model->population[model->household_network->edges[pdx].id1].age_type == age )
80+
if( ( model->population[model->household_network->edges[pdx].id1].age_type == age ) | ( age == -1 ) )
7881
inter += weight[HOUSEHOLD];
79-
if( model->population[model->household_network->edges[pdx].id2].age_type == age )
82+
if( ( model->population[model->household_network->edges[pdx].id2].age_type == age ) | ( age == -1 ))
8083
inter += weight[HOUSEHOLD];
8184
}
8285

8386
for( ndx = 0; ndx < model->n_occupation_networks ; ndx++ )
8487
for( pdx = 0; pdx < model->occupation_network[ndx]->n_edges; pdx++ )
8588
{
86-
if( model->population[model->occupation_network[ndx]->edges[pdx].id1].age_type == age )
89+
if( ( model->population[model->occupation_network[ndx]->edges[pdx].id1].age_type == age ) | ( age == -1 ))
8790
inter += model->params->daily_fraction_work * weight[OCCUPATION];
88-
if( model->population[model->occupation_network[ndx]->edges[pdx].id2].age_type == age )
91+
if( ( model->population[model->occupation_network[ndx]->edges[pdx].id2].age_type == age ) | ( age == -1 ))
8992
inter += model->params->daily_fraction_work * weight[OCCUPATION];
9093
}
9194

@@ -97,12 +100,7 @@ double estimate_mean_interactions_by_age( model *model, int age )
97100
* Description: sets up discrete distributions and functions which are used to
98101
* model events and calculates infectious rate per interaction.
99102
*
100-
* The infectious rate per interaction adult is the infectious rate divided
101-
* by the mean number of daily interactions of an adult.
102-
*
103-
* Adjustments are calculated for children and elderly based upon their
104-
* difference in the number of daily interactions and the relative overall
105-
* susceptibility.
103+
* The infectious rate is adjusted by the total mean interactions
106104
*
107105
* Returns: void
108106
******************************************************************************************/
@@ -112,10 +110,10 @@ void set_up_infectious_curves( model *model )
112110
double infectious_rate, type_factor;
113111
int type, group;
114112

115-
infectious_rate = params->infectious_rate / model->mean_interactions[AGE_TYPE_ADULT];
113+
infectious_rate = params->infectious_rate / model->mean_interactions;
116114

117115
for( group = 0; group < N_AGE_GROUPS; group++ )
118-
params->adjusted_susceptibility[group] = params->relative_susceptibility[group] * model->mean_interactions[AGE_TYPE_ADULT] / model->mean_interactions[AGE_TYPE_MAP[group]];
116+
params->adjusted_susceptibility[group] = params->relative_susceptibility[group];
119117

120118
for( type = 0; type < N_INTERACTION_TYPES; type++ )
121119
{

‎src/model.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,7 @@ void set_up_networks( model *model )
241241
if( model->params->hospital_on )
242242
set_up_hospital_networks( model );
243243

244-
for( idx =0; idx < N_AGE_TYPES; idx++ )
245-
model->mean_interactions[idx] = estimate_mean_interactions_by_age( model, idx );
244+
model->mean_interactions = estimate_mean_interactions_by_age( model, -1 );
246245
}
247246

248247
/*****************************************************************************************

‎src/model.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct model{
6262
network **occupation_network;
6363
directory *household_directory;
6464
network *user_network;
65-
double mean_interactions[ N_AGE_TYPES ];
65+
double mean_interactions;
6666

6767
long manual_trace_interview_quota;
6868
long manual_trace_notification_quota;

‎tests/data/baseline_parameters.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
rng_seed,param_id,n_total,mean_work_interactions_child,mean_work_interactions_adult,mean_work_interactions_elderly,daily_fraction_work,work_network_rewire,mean_random_interactions_child,sd_random_interactions_child,mean_random_interactions_adult,sd_random_interactions_adult,mean_random_interactions_elderly,sd_random_interactions_elderly,random_interaction_distribution,child_network_adults,elderly_network_adults,days_of_interactions,end_time,n_seed_infection,mean_infectious_period,sd_infectious_period,infectious_rate,mean_time_to_symptoms,sd_time_to_symptoms,mean_time_to_hospital,mean_time_to_critical,sd_time_to_critical,mean_time_to_recover,sd_time_to_recover,mean_time_to_death,sd_time_to_death,fraction_asymptomatic_0_9,fraction_asymptomatic_10_19,fraction_asymptomatic_20_29,fraction_asymptomatic_30_39,fraction_asymptomatic_40_49,fraction_asymptomatic_50_59,fraction_asymptomatic_60_69,fraction_asymptomatic_70_79,fraction_asymptomatic_80,asymptomatic_infectious_factor,mild_fraction_0_9,mild_fraction_10_19,mild_fraction_20_29,mild_fraction_30_39,mild_fraction_40_49,mild_fraction_50_59,mild_fraction_60_69,mild_fraction_70_79,mild_fraction_80,mild_infectious_factor,mean_asymptomatic_to_recovery,sd_asymptomatic_to_recovery,household_size_1,household_size_2,household_size_3,household_size_4,household_size_5,household_size_6,population_0_9,population_10_19,population_20_29,population_30_39,population_40_49,population_50_59,population_60_69,population_70_79,population_80,daily_non_cov_symptoms_rate,relative_susceptibility_0_9,relative_susceptibility_10_19,relative_susceptibility_20_29,relative_susceptibility_30_39,relative_susceptibility_40_49,relative_susceptibility_50_59,relative_susceptibility_60_69,relative_susceptibility_70_79,relative_susceptibility_80,relative_transmission_household,relative_transmission_occupation,relative_transmission_random,hospitalised_fraction_0_9,hospitalised_fraction_10_19,hospitalised_fraction_20_29,hospitalised_fraction_30_39,hospitalised_fraction_40_49,hospitalised_fraction_50_59,hospitalised_fraction_60_69,hospitalised_fraction_70_79,hospitalised_fraction_80,critical_fraction_0_9,critical_fraction_10_19,critical_fraction_20_29,critical_fraction_30_39,critical_fraction_40_49,critical_fraction_50_59,critical_fraction_60_69,critical_fraction_70_79,critical_fraction_80,fatality_fraction_0_9,fatality_fraction_10_19,fatality_fraction_20_29,fatality_fraction_30_39,fatality_fraction_40_49,fatality_fraction_50_59,fatality_fraction_60_69,fatality_fraction_70_79,fatality_fraction_80,mean_time_hospitalised_recovery,sd_time_hospitalised_recovery,mean_time_critical_survive,sd_time_critical_survive,location_death_icu_0_9,location_death_icu_10_19,location_death_icu_20_29,location_death_icu_30_39,location_death_icu_40_49,location_death_icu_50_59,location_death_icu_60_69,location_death_icu_70_79,location_death_icu_80,quarantine_length_self,quarantine_length_traced_symptoms,quarantine_length_traced_positive,quarantine_length_positive,quarantine_dropout_self,quarantine_dropout_traced_symptoms,quarantine_dropout_traced_positive,quarantine_dropout_positive,quarantine_compliance_traced_symptoms,quarantine_compliance_traced_positive,test_on_symptoms,test_on_traced,test_release_on_negative,trace_on_symptoms,trace_on_positive,retrace_on_positive,quarantine_on_traced,traceable_interaction_fraction,tracing_network_depth,allow_clinical_diagnosis,quarantine_household_on_positive,quarantine_household_on_symptoms,quarantine_household_on_traced_positive,quarantine_household_on_traced_symptoms,quarantine_household_contacts_on_positive,quarantine_household_contacts_on_symptoms,quarantined_daily_interactions,quarantine_days,quarantine_smart_release_day,hospitalised_daily_interactions,test_insensitive_period,test_sensitive_period,test_sensitivity,test_specificity,test_order_wait,test_order_wait_priority,test_result_wait,test_result_wait_priority,priority_test_contacts_0_9,priority_test_contacts_10_19,priority_test_contacts_20_29,priority_test_contacts_30_39,priority_test_contacts_40_49,priority_test_contacts_50_59,priority_test_contacts_60_69,priority_test_contacts_70_79,priority_test_contacts_80,self_quarantine_fraction,app_users_fraction_0_9,app_users_fraction_10_19,app_users_fraction_20_29,app_users_fraction_30_39,app_users_fraction_40_49,app_users_fraction_50_59,app_users_fraction_60_69,app_users_fraction_70_79,app_users_fraction_80,app_turn_on_time,lockdown_occupation_multiplier_primary_network,lockdown_occupation_multiplier_secondary_network,lockdown_occupation_multiplier_working_network,lockdown_occupation_multiplier_retired_network,lockdown_occupation_multiplier_elderly_network,lockdown_random_network_multiplier,lockdown_house_interaction_multiplier,lockdown_time_on,lockdown_time_off,lockdown_elderly_time_on,lockdown_elderly_time_off,testing_symptoms_time_on,testing_symptoms_time_off,intervention_start_time,hospital_on,manual_trace_on,manual_trace_time_on,manual_trace_on_hospitalization,manual_trace_on_positive,manual_trace_delay,manual_trace_exclude_app_users,manual_trace_n_workers,manual_trace_interviews_per_worker_day,manual_trace_notifications_per_worker_day,manual_traceable_fraction_household,manual_traceable_fraction_occupation,manual_traceable_fraction_random
2-
1,1,1000000,10,7,3,0.5,0.1,2,2,4,4,3,3,1,0.2,0.2,10,200,5,5.5,2.14,5.64,5.42,2.7,5.14,2.27,2.27,12,5,11.74,8.79,0.605,0.546,0.483,0.418,0.354,0.294,0.242,0.199,0.163,0.29,0.387,0.435,0.478,0.512,0.532,0.541,0.543,0.541,0.534,0.48,15,5,7452,9936,4416,4140,1104,552,8054000,7528000,8712000,8835000,8500000,8968000,7069000,5488000,3281000,0.002,0.35,0.69,1.03,1.03,1.03,1.03,1.27,1.52,1.52,2,1,1,0.002,0.009,0.017,0.065,0.186,0.231,0.324,0.387,0.439,0.05,0.05,0.05,0.05,0.063,0.122,0.274,0.432,0.709,0.33,0.25,0.5,0.5,0.5,0.69,0.65,0.88,1,8.75,8.75,18.8,12.21,1,1,0.9,0.9,0.8,0.8,0.4,0.4,0.05,7,14,14,14,0.02,0.04,0.03,0.01,0.5,0.9,0,0,1,0,0,0,0,0.8,0,1,0,0,0,0,0,0,0,7,0,0,3,14,0.8,0.999,1,-1,1,-1,1000,1000,1000,1000,1000,1000,1000,1000,1000,0,0.09,0.8,0.97,0.96,0.94,0.86,0.7,0.48,0.32,10000,0.22,0.22,0.22,0.22,0.22,0.22,1.5,10000,10000,10000,10000,10000,10000,0,0,0,10000,1,0,1,0,300,6,12,1,0.8,0.05
2+
1,1,1000000,10,7,3,0.5,0.1,2,2,4,4,3,3,1,0.2,0.2,10,200,5,5.5,2.14,5.18,5.42,2.7,5.14,2.27,2.27,12,5,11.74,8.79,0.456,0.412,0.370,0.332,0.296,0.265,0.238,0.214,0.192,0.33,0.533,0.569,0.597,0.614,0.616,0.602,0.571,0.523,0.461,0.72,15,5,7452,9936,4416,4140,1104,552,8054000,7528000,8712000,8835000,8500000,8968000,7069000,5488000,3281000,0.002,0.35,0.69,1.03,1.03,1.03,1.03,1.27,1.52,1.52,2,1,1,0.001,0.006,0.015,0.069,0.219,0.279,0.370,0.391,0.379,0.05,0.05,0.05,0.05,0.063,0.122,0.274,0.432,0.709,0.33,0.25,0.5,0.5,0.5,0.69,0.65,0.88,1,8.75,8.75,18.8,12.21,1,1,0.9,0.9,0.8,0.8,0.4,0.4,0.05,7,14,14,14,0.02,0.04,0.03,0.01,0.5,0.9,0,0,1,0,0,0,0,0.8,0,1,0,0,0,0,0,0,0,7,0,0,3,14,0.8,0.999,1,-1,1,-1,1000,1000,1000,1000,1000,1000,1000,1000,1000,0,0.09,0.8,0.97,0.96,0.94,0.86,0.7,0.48,0.32,10000,0.29,0.29,0.29,0.29,0.29,0.29,1.5,10000,10000,10000,10000,10000,10000,0,0,0,10000,1,0,1,0,300,6,12,1,0.8,0.05

‎tests/data/baseline_parameters_transpose.csv

+208-208
Large diffs are not rendered by default.

‎tests/test_disease_dynamics.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -559,10 +559,10 @@ def test_disease_transition_times( self, test_params ):
559559

560560
params = ParameterSet(constant.TEST_DATA_FILE, line_number=1)
561561
params = utils.turn_off_interventions(params, 50)
562-
params.set_param("n_total", 20000)
562+
params.set_param("n_total", 50000)
563563
params.set_param("n_seed_infection", 200)
564-
params.set_param("end_time", 50)
565-
params.set_param("infectious_rate", 4.0)
564+
params.set_param("end_time", 30)
565+
params.set_param("infectious_rate", 6.0)
566566
params.set_param("hospital_on", 0) #turning off hospital as this affects disease transitions
567567
params.set_param( test_params )
568568

‎tests/test_infection_dynamics.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ class TestClass(object):
314314
test_params = dict(
315315
n_total = 100000,
316316
n_seed_infection = 100,
317-
infectious_rate = 6.0,
317+
infectious_rate = 5.0,
318318
relative_transmission_household = 1,
319319
relative_transmission_occupation = 1,
320320
relative_transmission_random = 1,

0 commit comments

Comments
 (0)
Please sign in to comment.