MPOX¶
A simple SIR compartmental model for MPOX
MpoxJaxModel(input)
¶
Bases: Model
A simple SIRS compartmental model for MPOX with spatial mobility
Initialise the MPOX SIRS model from a configuration dictionary.
Sets up the population matrix, transmission parameters, simulation window, mobility fields, ring-vaccination state, and the modeler-supplied transition-multiplier schedule.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
dict
|
Simulation configuration with |
required |
Source code in compartment/models/mpox_jax_model/model.py
define_parameters(schema)
classmethod
¶
Declare the SIRS compartments, edges, mobility fields, and intervention.
Declares the S->I, I->R, and waning R->S edges, the cumulative I_total
tracker, the ring-vaccination intervention, and the exponential
distance-decay mobility fields consumed by build_travel_matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schema
|
ParameterSchemaBuilder
|
Schema builder to populate. |
required |
Source code in compartment/models/mpox_jax_model/model.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 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 | |
build_travel_matrix(admin_zones)
¶
Build the exponential distance-decay mobility matrix.
Driven by the travel_sigma and travel_scale_km custom fields.
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). |
Source code in compartment/models/mpox_jax_model/model.py
mobility(admin_zones, sigma, scale_km=500.0)
¶
Build an exponential distance-decay travel matrix from admin zones.
Flow from zone i to zone j is proportional to
population_j * exp(-distance_ij / scale_km), using great-circle
distances. Returns the identity matrix for a single zone or zero sigma.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
admin_zones
|
list[dict]
|
Admin-zone dicts with |
required |
sigma
|
float
|
Fraction (0-1) of each zone's population travelling out per timestep. |
required |
scale_km
|
float
|
Characteristic decay distance in km. |
500.0
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Travel matrix of shape (n_zones, n_zones) whose entry
|
Source code in compartment/models/mpox_jax_model/model.py
ring_vaccination_intervention(beta, t, prop_infective)
¶
Apply the mpox ring-vaccination reduction to the transmission rate.
Activates either when the simulation date falls within the configured
window (date-based) or when the proportion of infectives crosses the start
threshold (threshold-based), and reduces beta by
adherence * transmission_reduction while active. Returns beta unchanged
when the intervention is not configured.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
beta
|
ndarray
|
Baseline transmission rate before the reduction. |
required |
t
|
float
|
Elapsed simulation time in days since |
required |
prop_infective
|
ndarray
|
Current proportion of the population that is infectious, used for threshold activation. |
required |
Returns:
| Type | Description |
|---|---|
tuple
|
The possibly reduced beta and the updated intervention-status dict. |
Source code in compartment/models/mpox_jax_model/model.py
prepare_initial_state()
¶
Return the initial compartment populations for the solver.
Returns:
| Type | Description |
|---|---|
ndarray
|
Population matrix of shape (n_compartments, n_zones). |
Source code in compartment/models/mpox_jax_model/model.py
equation(y, t, p)
¶
Compute the SIRS compartment derivatives for one integration step.
The I->R and R->S edges are handled by the base class, while the S->I flow is applied manually so the force of infection can be coupled across zones through the travel matrix. Ring vaccination and the scheduled transition multipliers scale the rates before the flows are computed.
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 (dy/dt). |