Ebola Virus Disease¶
Discrete-time stochastic SEIR model with hospitalisation and funeral transmission, Erlang(2) passage times via linear chain (Li et al. 2019, Getz & Dougherty 2018).
EbolaJaxModel(config)
¶
Bases: Model
Discrete-time stochastic Ebola model with Erlang(2) linear chain.
Initialise the model, derive Erlang(2) step probabilities, and seed the PRNG.
Converts the mean exposed and infectious periods into per-step Erlang(k=2)
transition probabilities (p = 1 - exp(-k / mean_period) at dt = 1
day), reads the community/ETU/funeral proportions from the Disease
config block, and fixes the FOI denominator to the initial population sum.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
Validated simulation configuration. A |
required |
Source code in compartment/models/ebola_jax_model/model.py
define_parameters(schema)
classmethod
¶
Declare compartments, transmission edges, parameters, and interventions.
Builds the Erlang(2) linear-chain structure (S, E1/E2, I1/I2, H1/H2, Funeral, R) plus aggregate cumulative trackers, the ETU and funeral transmission-risk parameters, gravity-model mobility, and the stochastic run count (Li et al. 2019; Getz & Dougherty 2018).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schema
|
ParameterSchemaBuilder
|
Schema builder to populate. |
required |
Source code in compartment/models/ebola_jax_model/model.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | |
get_initial_population(admin_zones, compartment_list, **kwargs)
classmethod
¶
Distribute each zone's population across S and I1/I2 (50/50 split).
The 50/50 I1/I2 split approximates steady-state Erlang(2) seeding; the chain relaxes to the correct distribution within a few simulated days regardless of the initial split.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
admin_zones
|
list[dict]
|
Admin-zone dicts providing |
required |
compartment_list
|
list[str]
|
Ordered compartment names, used for column indexing. |
required |
**kwargs
|
Any
|
Additional keyword arguments (unused). |
{}
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Initial populations of shape (n_zones, n_compartments). |
Source code in compartment/models/ebola_jax_model/model.py
build_travel_matrix(admin_zones)
¶
Build the inverse-square gravity mobility matrix.
Driven by the travel_sigma custom field and used for spatial FOI
mixing in equation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
admin_zones
|
list[dict]
|
Admin-zone dicts with |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Travel matrix of shape (n_zones, n_zones) whose entry
|
Source code in compartment/models/ebola_jax_model/model.py
prepare_initial_state()
¶
Return the initial compartment populations for the integrator.
Returns:
| Type | Description |
|---|---|
ndarray
|
Population matrix of shape (n_compartments, n_zones). |
equation(y, t, p)
¶
Compute the per-step deltas for the discrete stochastic Erlang(2) chain.
With STOCHASTIC = True the framework uses Euler integration:
y_{t+1} = y_t + 1 * equation(y_t, t, p). Transitions are binomial draws
on the per-step probabilities, and the force of infection combines
community, ETU, and funeral infectiousness mixed across zones by the
travel matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y
|
ndarray
|
Current compartment values, ordered by
|
required |
t
|
float
|
Current time in days since the simulation start date. |
required |
p
|
tuple
|
Packed parameter tuple, unpacked via |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Stacked per-compartment deltas for this step. |
Source code in compartment/models/ebola_jax_model/model.py
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | |