Hantavirus (person-to-person + risk perception)¶
SEIR hantavirus model coupling rodent-to-human spillover with Andes-virus person-to-person transmission and a dynamic risk-perception state that modulates both betas (Gutiérrez Jara & Muñoz Quezada, Medwave 2022).
HantavirusHumanJaxModel(config)
¶
Bases: Model
SEIR hantavirus model with person-to-person transmission and an endogenous risk-perception state (Gutiérrez Jara & Muñoz Quezada, Medwave 2022).
Initialize the model and resolve its disease and risk-perception rates.
Caches the admin zones for the per-zone exposed_fraction, supplies
fallback rates for the schema edges so the model can run without an
explicit TransmissionEdges block, and converts the percentage CFR
inputs to fractions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
Validated simulation configuration holding the
|
required |
Source code in compartment/models/hantavirus_human_jax_model/model.py
585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 | |
define_parameters(schema)
classmethod
¶
Declare the coupled human/rodent compartments, edges, and parameters.
Registers the human SEIR (plus the cumulative death tracker D_h), the
rodent SEIR, and the risk-perception state P. Only the pure
rate * source E->I and I->R flows become schema edges; the multi-rate
forces of infection, demographics, and lethality are applied manually in
equation().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schema
|
ParameterSchemaBuilder
|
Schema builder to populate with model info, compartments, transmission edges, disease parameters, admin-zone fields, and the case-isolation intervention. |
required |
Source code in compartment/models/hantavirus_human_jax_model/model.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 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 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 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 521 522 523 524 525 526 | |
get_initial_population(admin_zones, compartment_list, **kwargs)
classmethod
¶
Seed humans, rodents, and risk perception per zone.
Reads the standard population (total human population N_h) and
infected_population (initial I_h) fields, plus the custom
rodent_population (total rodents N_m), infected_rodent_count
(initial I_m), and initial_risk_perception (initial P, given
as a percent from 0-100) fields. Exposed and recovered compartments start
empty.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
admin_zones
|
list[dict]
|
Admin zone dicts supplying the human, rodent, and risk-perception seeding fields. |
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/hantavirus_human_jax_model/model.py
build_travel_matrix(admin_zones)
¶
Build the inter-zone travel matrix from the mobility parameters.
Delegates to gravity(), a Haversine gravity kernel driven by the
travel_sigma and travel_alpha custom fields.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
admin_zones
|
list[dict]
|
Admin zone dicts with |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The (n_zones, n_zones) travel matrix. |
Source code in compartment/models/hantavirus_human_jax_model/model.py
gravity(admin_zones, sigma, alpha=1.5)
¶
Build a gravity travel matrix from admin-zone lat/lon/population.
Entry T[i, j] is the fraction of zone i's population present in
zone j. Attraction from i to j is proportional to
pop_j / dist_ij^alpha over great-circle (Haversine) distances; rows
are normalised so the off-diagonal mass sums to sigma and the
diagonal is the stay-home fraction 1 - sigma. Falls back to an
identity matrix when there is only one zone or sigma is 0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
admin_zones
|
list[dict]
|
Admin zone dicts with |
required |
sigma
|
float
|
Fraction of each zone's population away from home on a given day. |
required |
alpha
|
float
|
Distance-decay exponent. The default 1.5 is a typical empirical value for inter-regional US mobility, steeper than the 1.0 used in simple gravity models because very distant zones contribute little. |
1.5
|
Returns:
| Type | Description |
|---|---|
ndarray
|
The (n_zones, n_zones) travel matrix. |
Source code in compartment/models/hantavirus_human_jax_model/model.py
prepare_initial_state()
¶
Return the initial compartment populations for the solver.
Returns:
| Type | Description |
|---|---|
ndarray
|
The (compartments, zones) initial state matrix. |
Source code in compartment/models/hantavirus_human_jax_model/model.py
equation(y, t, p)
¶
Compute derivatives for the coupled human, rodent, and risk states.
Schema edges supply the E->I flows, while the gamma_h edge is skipped
so I_h exits via competing hazards to R_h and D_h with an
effective CFR rising from cfr toward cfr_max as concurrent cases
exceed hospital_capacity * N_h. Risk perception scales both betas by
P_star / P; a cosine peaking at seasonal_peak_day modulates
spillover only, spillover reaches just the per-zone exposed_fraction,
and person-to-person pressure is coupled across zones by the gravity
travel matrix. Births enter the susceptible compartments, natural
mortality is removed from every live compartment, and perception evolves
as dP/dt = -lambda_1 * (P - P_star) + lambda_2 * I_h / N_h.
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 derivatives. |
Source code in compartment/models/hantavirus_human_jax_model/model.py
754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 | |