@@ -52,32 +52,15 @@ def __init__(self, p: Parameters):
52
52
susceptible = p .population - infected
53
53
54
54
intrinsic_growth_rate = get_growth_rate (p .doubling_time )
55
+ self .intrinsic_growth_rate = intrinsic_growth_rate
55
56
56
57
gamma = 1.0 / p .infectious_days
57
-
58
- # Contact rate, beta
59
- beta = (
60
- (intrinsic_growth_rate + gamma )
61
- / susceptible
62
- * (1.0 - p .relative_contact_rate )
63
- ) # {rate based on doubling time} / {initial susceptible}
64
-
65
- # r_t is r_0 after distancing
66
- r_t = beta / gamma * susceptible
67
-
68
- # Simplify equation to avoid division by zero:
69
- # self.r_naught = r_t / (1.0 - relative_contact_rate)
70
- r_naught = (intrinsic_growth_rate + gamma ) / gamma
58
+ self .gamma = gamma
71
59
72
60
self .susceptible = susceptible
73
61
self .infected = infected
74
62
self .recovered = p .recovered
75
63
76
- self .beta = beta
77
- self .gamma = gamma
78
- self .beta_t = get_beta (intrinsic_growth_rate , self .gamma , self .susceptible , p .relative_contact_rate )
79
- self .intrinsic_growth_rate = intrinsic_growth_rate
80
-
81
64
if p .date_first_hospitalized is None and p .doubling_time is not None :
82
65
logger .info ('Using doubling_time: %s' , p .doubling_time )
83
66
self .i_day = 0
@@ -94,8 +77,6 @@ def __init__(self, p: Parameters):
94
77
self .beta_t = get_beta (intrinsic_growth_rate , self .gamma , self .susceptible , p .relative_contact_rate )
95
78
self .run_projection (p )
96
79
97
- self .r_t = self .beta_t / gamma * susceptible
98
- self .r_naught = self .beta / gamma * susceptible
99
80
logger .info ('Set i_day = %s' , i_day )
100
81
p .date_first_hospitalized = p .current_date - timedelta (days = i_day )
101
82
logger .info (
@@ -148,6 +129,7 @@ def __init__(self, p: Parameters):
148
129
self .susceptible = self .raw_df ['susceptible' ].values [self .i_day ]
149
130
self .recovered = self .raw_df ['recovered' ].values [self .i_day ]
150
131
132
+ # r_t is r_0 after distancing
151
133
self .r_t = self .beta_t / gamma * susceptible
152
134
self .r_naught = self .beta / gamma * susceptible
153
135
0 commit comments