---
# System prepended metadata

title: Debugging HeuristicV1 Revision 1
tags: [Debug]

---

---
tags: Debug
---

# Debugging HeuristicV1 Revision 1

### Description
The goal of this work is to debug the simulator by viewing chains of infections and information about each person in the chain. We use the Heuristic because it has many rules which will allow us to identify (and reason about) issues where risk / recommendation level do not align with the epidemiology or heuristic algorithm.

Please refer to this googledoc for a high-level description of the heuristic (v1): https://docs.google.com/document/d/1_J1jcn5b0h7h5_bzjH-qx4LerWNFRJOzBI2vCm1n3AA/edit?usp=sharing

Please refer to [the wiki](https://hackmd.io/N-g61aZLQaSB_cz5SttM6Q) for information on how to read the plots.

### Infection Chains
![](https://i.imgur.com/gJ0pG0c.png)

Observations:
- Humans 605, 947, and 29 all live together.
- Humans 470 and 714 live together.
- Therefore, the primary infection that we wish we could have stopped was human 605.

Questions:
- We should show severity of most severe symptom, because this is what drives the heuristic setting of risk/rec level. 
- why is h470 sending 62 update messages to the next guy? weird.
- Q: shouldn't H470 have gone to R=7 earlier than March 11th, since he had symptoms since March 7th? 
- Q: Person 714 works from home, and human 605 works from a workplace. How did human 714 infect 605?
- Q: Why is human 470 green on 03-09 while human 605 is yellow?
    - A: I think it's because human 470 didn't report their symptoms while 605 did. 
- The next day (03-10) human 470 was _still_ green. They reported symptoms and were still green, and were tested negative... maybe the negative test over-ruled the positive?
- Why is Human 470 only Orange on March 12th even though they got a positive test result?
- why does it take 6 days for the app to kick in (when intervention day is 5)

Changes:
- need to show the severity of the most severe symptoms
- need to show the observed symptoms, not true ones

![](https://i.imgur.com/VUEvVlo.png)

Questions:
- why is h503 getting infected ONE DAY after h404 got infected? it seems too quick. At least 2 days of incubation, no?
- why is h404 doing a test (with + answer) for so many consecutive days???
- maybe try INTERVENTION_DAY=0 or 1

### Baseball Cards
![](https://i.imgur.com/82TH2Dd.png)
![](https://i.imgur.com/AC4Gfqb.png)
![](https://i.imgur.com/35WyyVO.png)
![](https://i.imgur.com/LLKiKcz.png)
![](https://i.imgur.com/k4mZ3MO.png)
![](https://i.imgur.com/a0V8TEX.png)
![](https://i.imgur.com/YPMJO0w.png)
![](https://i.imgur.com/z3umGnP.png)
![](https://i.imgur.com/V49q85v.png)


### Simulation Logs
######## DEMOGRAPHICS #########
age distribution
                  0
count  1000.000000
mean     42.025000
std      23.473419
min       1.000000
25%      23.000000
50%      41.000000
75%      60.000000
max     101.000000
house age distribution
                 0
count  386.000000
mean    41.544344
std     15.098008
min     16.000000
25%     30.500000
50%     39.250000
75%     50.729167
max    101.000000
house size distribution
                 0
count  386.000000
mean     2.528497
std      1.214829
min      1.000000
25%      2.000000
50%      2.000000
75%      3.000000
max      5.000000
Fraction of asymptomatic 0.229
######## COVID PROPERTIES #########
Avg. incubation days  5.48
Avg. recovery days  18.99
Avg. infectiousnes onset days  3.27
######## COVID SPREAD #########
human-human transmissions 129
environment-human transmissions 59
environmental transmission ratio 0.457
Ro 1.7628571428571427
Generation times 6.016636904761904 
Cumulative Incidence [0.0, 0.0010050251256281408, 0.004024144869215292, 0.00101010101010101, 0.011122345803842264, 0.0010224948875255625, 0.008188331627430911, 0.0041279669762641896, 0.0051813471502590676, 0.004166666666666667, 0.005230125523012552, 0.006309148264984227, 0.007407407407407408, 0.0031982942430703624, 0.0021390374331550803, 0.0053590568060021436, 0.005387931034482759, 0.0021668472372697724, 0.0054288816503800215, 0.002183406113537118, 0.006564551422319475, 0.006607929515418502, 0.0022172949002217295, 0.0033333333333333335, 0.006688963210702341, 0.003367003367003367, 0.0022522522522522522, 0.010158013544018058, 0.009122006841505131]
R : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.0, 2.0, 1.5, 1.6, 1.7142857142857142, 2.0, 1.9090909090909092, 1.5714285714285714, 1.3333333333333333, 1.2272727272727273, 1.0, 1.0344827586206897, 1.0909090909090908, 0.9473684210526315]
******** R0 *********
Asymptomatic R0 1.2
Presymptomatic R0 1.6153846153846154
Symptomatic R0 1.2222222222222223
******** Transmission Ratios *********
% asymptomatic transmission  4.65%
% presymptomatic transmission 32.56%
% symptomatic transmission 17.05%
******** R0 LOCATIONS *********
household R0 1.4827586206896552
workplace R0 1.4545454545454546
school R0 1.4285714285714286
hospital R0 1.0
######## SYMPTOMS #########
P(symptoms = x | covid patient), where x is:
   sneezing                    : 0.3467
    nausea_vomiting             : 0.3467
    heavy_trouble_breathing     : 0.3333
    moderate_trouble_breathing  : 0.2533
    runny_nose                  : 0.2133
    confused                    : 0.1333
    lost_consciousness          : 0.0267
    extremely-severe            : 0.0267
    unusual                     : 0.0267
    severe_chest_pain           : 0.0133
P(symptoms = x | human had some sickness e.g. cold, flu, allergies, covid), where x is:
   sneezing                    : 0.1769
    nausea_vomiting             : 0.1769
    heavy_trouble_breathing     : 0.1701
    moderate_trouble_breathing  : 0.1293
    runny_nose                  : 0.1088
    confused                    : 0.0680
    lost_consciousness          : 0.0136
    extremely-severe            : 0.0136
    unusual                     : 0.0136
    severe_chest_pain           : 0.0068
######## MOBILITY #########
Day - 
Mon #avg: 9.30375 %:16.22 
Tue #avg: 9.36975 %:16.33 
Wed #avg: 7.49875 %:13.07 
Thurs #avg: 6.87175 %:11.98 
Fri #avg: 8.9152 %:15.54 
Sat #avg: 7.786 %:13.57 
Sun #avg: 7.62025 %:13.28 
Average Daily Contacts 
(1, 10) #avg: 24.142810670136623 %:15.57 
(11, 20) #avg: 21.472100313479615 %:14.37 
(21, 30) #avg: 13.139959432048684 %:10.87 
(31, 40) #avg: 13.364817591204398 %:11.22 
(41, 50) #avg: 13.49030172413793 %:10.50 
(51, 60) #avg: 13.63423645320197 %:11.61 
(61, 70) #avg: 13.26044294925708 %: 9.92 
(71, 80) #avg: 16.834845735027226 %: 7.78 
(81, 101) #avg: 31.19326383319968 %: 8.16 
######## COVID Testing Statistics #########
Proportion infected :  13.400%
Positivity rate:  26.160%
Total Tests: 237 Total positive tests: 62 Total negative tests: 175
Maximum tests given to an individual: 5
Proportion of population tested until end:  23.700%
Proportion of population tested daily Avg:  0.741%
Proportion of population tested daily Max:  1.100%
Proportion of population tested daily Min:  0.000%
P(tested | symptoms = x), where x is 
    extremely-severe  0.000
    severe  0.607
    moderate  1.000
    mild  0.558
P(symptoms = x | tested), where x is:
   sneezing                    : 0.1097
    headache                    : 0.1055
    moderate_trouble_breathing  : 0.0759
    heavy_trouble_breathing     : 0.0717
    severe                      : 0.0717
    chills                      : 0.0422
    light_trouble_breathing     : 0.0380
    unusual                     : 0.0127
    lost_consciousness          : 0.0084
    confused                    : 0.0042
######## Effective Contacts & % infected #########
Eff. contacts: 5.853 	 % infected:  12.900%

### Analysis
- Maximum tests given to an individual: 5 is too high

### Todo
- run with event logging
- run experiment which has intervention_day start with 0
- 