Skip to content

Commit

Permalink
Abandon attempt at alternative stratification
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaris committed Mar 26, 2024
1 parent 9acc197 commit e8a8679
Showing 1 changed file with 52 additions and 17 deletions.
69 changes: 52 additions & 17 deletions notebooks/evaluation_2024.03/scenario1/epi_eval_sc1_strains.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
"id": "cc5147cc-9830-4b99-b144-0fa42eeaa61c",
"metadata": {},
"source": [
"## Alternative approach"
"## Alternative approach (currently abandoned)"
]
},
{
Expand All @@ -293,7 +293,9 @@
"metadata": {},
"outputs": [],
"source": [
"# Do the recovery branches first\n",
"# # Do the recovery branches first\n",
"# # FixMe: this only doesn't cover the cross-recovery process e.g. \n",
"# # I_alpha_delta -> R_alpha_delta is covered but I_delta_alpha -> R_alpha_delta isn't.\n",
"# reinf_params = {}\n",
"# recov_init = NaturalConversion(\n",
"# subject=infected,\n",
Expand Down Expand Up @@ -324,7 +326,35 @@
"metadata": {},
"outputs": [],
"source": [
"# Couple the infection processes together\n",
"# # Couple the infectious states together with the susceptible states\n",
"# rec_concepts = recovery_model.get_concepts_name_map()\n",
"\n",
"# infected_alpha = rec_concepts['infected_population_alpha']\n",
"# recovered_alpha = rec_concepts['immune_population_alpha']\n",
"\n",
"# = rec_concepts['infected_population_delta']\n",
"# = rec_concepts['immune_population_delta']\n",
"\n",
"# = rec_concepts['infected_population_omicron']\n",
"# = rec_concepts['immune_population_omicron']\n",
"\n",
"# = rec_concepts['infected_population_alpha_delta']\n",
"# = rec_concepts['infected_population_delta_alpha']\n",
"# = rec_concepts['immune_population_alpha_delta']\n",
"\n",
"# = rec_concepts['infected_population_alpha_omicron']\n",
"# = rec_concepts['infected_population_omicron_alpha']\n",
"# = rec_concepts['immune_population_omicron_alpha']\n",
" \n",
"# = rec_concepts['infected_population_delta_omicron']\n",
"# = rec_concepts['infected_population_omicron_delta']\n",
"# = rec_concepts['immune_population_delta_omicron']\n",
"\n",
"# infected_alpha_delta_omicron = rec_concepts['infected_population_alpha_delta_omicron']\n",
"# infected_alpha_omicron_delta = rec_concepts['infected_population_alpha_omicron_delta']\n",
"# infected_delta_omicron_alpha = rec_concepts['infected_population_delta_omicron_alpha']\n",
"# = rec_concepts['immune_population_alpha_delta_omicron']\n",
"\n",
"# alpha_infectors = [infected_alpha, infected_delta_alpha, infected_omicron_alpha, infected_delta_omicron_alpha]\n",
"# alpha_susceptibles = [susceptible, recovered_delta, recovered_omicron, recovered_delta_omicron]\n",
"\n",
Expand All @@ -335,15 +365,28 @@
"# omicron_susceptibles = [susceptible, recovered_alpha, recovered_delta, recovered_alpha_delta]\n",
"\n",
"# infection_templates = []\n",
"# infection_parameters = {}\n",
"# inf_rate_name = \"beta_{ix}_{inf_name}\"\n",
"# for strain, inf_agents, susceptibles in [\n",
"# ('alpha', alpha_infectors, alpha_susceptibles), \n",
"# ('delta', delta_infectors, delta_susceptibles),\n",
"# ('omicron', omicron_infectors, omicron_susceptibles)\n",
"# ]:\n",
"# # For each each susceptible, create an infection process from all possible infection states\n",
"# for subject in susceptibles:\n",
"# for infected in inf_agents:\n",
" "
"# for subject, outcome in zip(susceptibles, inf_agents):\n",
"# for ix, infected in enumerate(inf_agents):\n",
"# cc = ControlledConversion(\n",
"# subject=subject,\n",
"# controller=infected,\n",
"# outcome=outcome\n",
"# )\n",
"# param_name = inf_rate_name.format(ix=ix, inf_name=strain)\n",
"# cc.set_mass_action_rate_law(param_name)\n",
"# infection_parameters[param_name] = Parameter(name=param_name, value=1)\n",
"# infection_templates.append(cc)\n",
"\n",
"# infections_model = TemplateModel(templates=infection_templates, parameters=infection_parameters)\n",
"# infections_model.draw_jupyter('infections_model.png')"
]
},
{
Expand All @@ -353,18 +396,10 @@
"metadata": {},
"outputs": [],
"source": [
"# Now do one stratification where the recovered from reinfection, R', get reinfected to \n",
" \n",
"# strat1_model.draw_jupyter(\"sir_strat1.png\")"
"# # Now combine the infectiontion and recovery models\n",
"# alt_model = recovery_model.extend(template_model=infections_model, parameter_mapping=infections_model.parameters)\n",
"# alt_model.draw_jupyter(\"sir_3strain_alt.png\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5fd7b879-18e9-4760-9b65-fa82d2505c34",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit e8a8679

Please sign in to comment.