Skip to content

Commit

Permalink
Merge branch 'master' of github.com:monash-emu/AuTuMN
Browse files Browse the repository at this point in the history
  • Loading branch information
dshipman committed May 30, 2024
2 parents fcc77b2 + 5067954 commit e435849
Show file tree
Hide file tree
Showing 12 changed files with 820 additions and 55 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,15 @@ def update_rcparams():
"infection_deaths": "COVID-19 deaths",
"infection_deaths_ma7": "COVID-19 deaths",
"cumulative_infection_deaths": "Cumulative deaths",
"cumulative_incidence": "Cumulative incidence",
"cumulative_incidence": "Cumulative infections",

"hospital_admissions": "new daily hospital admissions",
"hospital_admissions": "Daily hospital admissions",
"icu_admissions": "new daily admissions to ICU",
"incidence": "daily new infections",
"hospital_admissions": "daily hospital admissions",
"incidence": "Daily infections",
"hospital_occupancy": "Hospital pressure",
"icu_admissions": "daily ICU admissions",
"icu_occupancy": "total ICU beds",
"prop_ever_infected": "ever infected",
"prop_ever_infected": "Prop. ever infected",
"prop_ever_infected_age_matched": "Prop. ever infected\n(age-matched)",

"transformed_random_process": "Transformed random process",
Expand All @@ -73,8 +72,9 @@ def update_rcparams():
)

SCHOOL_COLORS = {
'partial': 'silver', # 'azure',
'full': 'gold' # 'thistle'
'partial': 'darkgrey', # 'silver', # 'azure',
'full': 'dimgrey', # 'gold', # 'thistle'
'academic': 'thistle'
}

def y_fmt(tick_val, pos):
Expand Down Expand Up @@ -162,7 +162,7 @@ def plot_model_fit_with_uncertainty(axis, uncertainty_df, output_name, iso3, inc
title = "Prop. ever infected"

axis.set_ylabel(title)
plt.tight_layout()
# plt.tight_layout()

if include_legend:
plt.legend(markerscale=2.)
Expand All @@ -180,7 +180,7 @@ def plot_two_scenarios(axis, uncertainty_dfs, output_name, iso3, include_unc=Fal
time = df.index

colour = unc_sc_colours[i_sc]
label = "baseline" if i_sc == 0 else "schools open"
label = "Historical" if i_sc == 0 else "Counterfactual"
scenario_zorder = 10 if i_sc == 0 else i_sc + 2

if include_unc:
Expand Down Expand Up @@ -212,7 +212,7 @@ def plot_two_scenarios(axis, uncertainty_dfs, output_name, iso3, include_unc=Fal

axis.yaxis.set_major_formatter(tick.FuncFormatter(y_fmt))

plt.tight_layout()
# plt.tight_layout()


def plot_final_size_compare(axis, uncertainty_dfs, output_name):
Expand Down Expand Up @@ -244,7 +244,7 @@ def plot_final_size_compare(axis, uncertainty_dfs, output_name):

title = output_name if output_name not in title_lookup else title_lookup[output_name]
axis.set_ylabel(title)
axis.set_xticks(ticks=[1, 2], labels=["baseline", "schools open"]) #, fontsize=15)
axis.set_xticks(ticks=[1, 2], labels=["Historical", "Counterfactual"]) #, fontsize=15)

axis.set_xlim((0.5, 2.5))
axis.set_ylim((0, y_max * 1.2))
Expand Down Expand Up @@ -424,17 +424,6 @@ def make_country_output_tiling(iso3, uncertainty_dfs, diff_quantiles_df, output_
plot_diff_outputs(ax9, diff_quantiles_df, ["delta_hospital_peak_relative"])
remove_axes_box(ax9)

# plot_incidence_by_age(derived_outputs, ax9, 1, as_proportion=False)
# plt.setp(ax9.get_xticklabels(), visible=False)

# # bottom left
# ax10 = fig.add_subplot(inner_grid[2, 0], sharex=ax8)
# plot_incidence_by_age(derived_outputs, ax10, 0, as_proportion=True)
# # bottom right
# ax11 = fig.add_subplot(inner_grid[2, 1], sharex=ax9)
# plot_incidence_by_age(derived_outputs, ax11, 1, as_proportion=True)

# fig.savefig(os.path.join(output_folder, "tiling.png"), facecolor="white")
fig.savefig(os.path.join(output_folder, "tiling.pdf"), facecolor="white")

plt.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
}

BOX_COLORS= {
"cases_averted_relative": "steelblue", # "black",
"deaths_averted_relative": "mediumseagreen", # "purple",
"delta_hospital_peak_relative": "tomato", # "firebrick"
"cases_averted_relative": "firebrick", # "steelblue", # "black",
"deaths_averted_relative": "firebrick", # "mediumseagreen", # "purple",
"delta_hospital_peak_relative": "firebrick", # "tomato", # "firebrick"
}

ANALYSIS_COLORS = {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
141 changes: 136 additions & 5 deletions docs/tex/tex_descriptions/projects/sm_covid/results.tex
Original file line number Diff line number Diff line change
@@ -1,17 +1,148 @@
\section{Sensitivity analyses}
\subsection{SA1: }
\subsection{SA2: }

\subsection{SA1: Increased household transmission during school closures}
In this sensitivity analysis, we assumed that effective contact rates within households were increased during school closure periods.
Specifically, we assumed that each individual had 20\% more household contact potential when schools were fully closed.\\
The results of this sensitivity analysis are presented in Figure \ref{fig:SA1_rel_outputs} and Figure \ref{fig:SA1_maps}.

\begin{figure}[!ht]
\begin{center}
\includegraphics[width=1.0\textwidth]{../../../../user/rragonnet/remote_run_outputs/31902886_full_analysis_05Oct2023_increased_hh_contacts/COMMON_DIRECTORY/relative_outputs.pdf}
\end{center}
\caption{Relative impact of school closures on COVID-19 infections, deaths and peak hospital occupancy (SA1: increased household transmission during closures)}
Results are presented as relative percentage reductions in COVID-19 infections (A),
COVID-19 deaths (B), and peak hospital occupancy (C). The counterfactual ``schools open'' scenario was used as reference.
Estimates are presented as medians (horizontal lines), interquartile ranges (boxes), and 95\% central credible intervals (vertical lines).
Countries are listed in descending order from left to right, based on the estimated median effect for each disease indicator. See Table 1 to find the country associated with each ISO3 code.
\label{fig:SA1_rel_outputs}
\end{figure}

\begin{figure}[!ht]
\begin{center}
\includegraphics[width=1.0\textwidth]{../../../../user/rragonnet/remote_run_outputs/31902886_full_analysis_05Oct2023_increased_hh_contacts/COMMON_DIRECTORY/maps/combined_single_page.pdf}
\end{center}
\caption{Geographic representation of the effects of school closures on COVID-19 (SA1: increased household transmission during closures)}
Results presented as median relative percentage reductions in SARS-CoV-2 infections (A), COVID-19 deaths (B), and peak hospital occupancy (C), due to school closures. The counterfactual “schools open” scenario was used as reference. Countries in light grey were not included in the analysis. Negative percentages indicate configurations where school closures are estimated to have had a negative impact on the considered indicator.
\label{fig:SA1_maps}
\end{figure}



\subsection{SA2: Google Mobility data not included}

In this sensitivity analysis, we removed the contribution of Google Mobility data from our model.
Under this configuration, we exclusively rely on the non-mechanistic component (i.e., random process) to capture
mobility changes in locations other than households and schools.
\\

The results of this sensitivity analysis are presented in Figure \ref{fig:SA2_rel_outputs} and Figure \ref{fig:SA2_maps}.

\begin{figure}[!ht]
\begin{center}
\includegraphics[width=1.0\textwidth]{../../../../user/rragonnet/remote_run_outputs/31915437_full_analysis_05Oct2023_no_google_mobility/COMMON_DIRECTORY/relative_outputs.pdf}
\end{center}
\caption{Relative impact of school closures on COVID-19 infections, deaths and peak hospital occupancy (SA2: no Google Mobility data)}
Results are presented as relative percentage reductions in COVID-19 infections (A),
COVID-19 deaths (B), and peak hospital occupancy (C). The counterfactual ``schools open'' scenario was used as reference.
Estimates are presented as medians (horizontal lines), interquartile ranges (boxes), and 95\% central credible intervals (vertical lines).
Countries are listed in descending order from left to right, based on the estimated median effect for each disease indicator. See Table 1 to find the country associated with each ISO3 code.
\label{fig:SA2_rel_outputs}
\end{figure}

\begin{figure}[!ht]
\begin{center}
\includegraphics[width=1.0\textwidth]{../../../../user/rragonnet/remote_run_outputs/31915437_full_analysis_05Oct2023_no_google_mobility/COMMON_DIRECTORY/maps/combined_single_page.pdf}
\end{center}
\caption{Geographic representation of the effects of school closures on COVID-19 (SA2: no Google Mobility data)}
Results presented as median relative percentage reductions in SARS-CoV-2 infections (A), COVID-19 deaths (B), and peak hospital occupancy (C), due to school closures. The counterfactual “schools open” scenario was used as reference. Countries in light grey were not included in the analysis. Negative percentages indicate configurations where school closures are estimated to have had a negative impact on the considered indicator.
\label{fig:SA2_maps}
\end{figure}




\subsection{Output comparisons between analyses}
In this section, we present side-by-side comparisons of the main outputs between the three analyses (Base-case, SA1 and SA2).
We present comparisons for the effect of school closures on infections (Figure \ref{fig:compare_infections}), deaths (Figure \ref{fig:compare_deaths}) and peak hospital occupancy (Figure \ref{fig:compare_hosp}).\\
Finally, Figure \ref{fig:compare_median} provides overall comparisons across all countries analysed, considering the estimated median effects alone.

\begin{figure}[!ht]
\begin{center}
\includegraphics[width=1.0\textwidth]{../../../../user/rragonnet/remote_run_outputs/analyses_compare_plots/analyses_compare_cases_averted_relative.pdf}
\end{center}
\caption{Comparison of school closure effects on SARS-CoV-2 infections}
\label{fig:compare_infections}
\end{figure}


\begin{figure}[!ht]
\begin{center}
\includegraphics[width=1.0\textwidth]{../../../../user/rragonnet/remote_run_outputs/analyses_compare_plots/analyses_compare_deaths_averted_relative.pdf}
\end{center}
\caption{Comparison of school closure effects on COVID-19 deaths}
\label{fig:compare_deaths}
\end{figure}


\begin{figure}[!ht]
\begin{center}
\includegraphics[width=1.0\textwidth]{../../../../user/rragonnet/remote_run_outputs/analyses_compare_plots/analyses_compare_delta_hospital_peak_relative.pdf}
\end{center}
\caption{Comparison of school closure effects on peak hospital occupancy}
\label{fig:compare_hosp}
\end{figure}


\begin{figure}[!ht]
\begin{center}
\includegraphics[width=0.7\textwidth]{../../../../user/rragonnet/remote_run_outputs/analyses_compare_plots/analyses_median_deltas.pdf}
\end{center}
\caption{Relative difference between median estimated effects of school closures between the different analyses}
\label{fig:compare_median}
\end{figure}






\subsection{Likelihood comparisons between analyses}

In this section, we aimed to compare the ability of the different models to fit the data. For this, we present the values of the a-posteriori log-likelihood
function (see Section \ref{calibration} for definition and Equation \ref{eq:acc_qtt}) obtained under the different configurations in Figure \ref{fig:compare_likelihood}.\\

To better understand the differences observed in the a-posteriori log-likelihood values, we also presented the likelihood component that is
relevant to the time-variant random-process in Figure \ref{fig:compare_rp_likelihood} (see Section \ref{eq:random_process} for definition).

\begin{figure}[!ht]
\begin{center}
\includegraphics[width=1.0\textwidth]{../../../../user/rragonnet/remote_run_outputs/analyses_compare_plots/ll_compare_logposterior.pdf}
\end{center}
\caption{Comparison of a-posteriori log-likelihood values between analyses}
The a-posteriori log-likelihood combines the model likelihood, the parameter priors and the random process likelihood. Higher values indicate
more realistic model fits. Note that the quantity presented in Equation \ref{eq:acc_qtt} is not exactly the a-posteriori likelihood but a quantity that
is proportional to the latter. This is why the log-likelihood quantity presented here includes an offset.
\label{fig:compare_likelihood}
\end{figure}

\section{Detailed country-specific results}

\begin{figure}[!ht]
\begin{center}
\includegraphics[width=1.0\textwidth]{../../../../user/rragonnet/remote_run_outputs/analyses_compare_plots/ll_compare_ll_extra_ll.pdf}
\end{center}
\caption{Comparison of likelihood-components relevant to the time-variant random process}
Higher values indicate less overall variability in the random-process.
\label{fig:compare_rp_likelihood}
\end{figure}



\clearpage
\newpage
\section{Detailed country-specific results}
The next pages include detailed country-specific results for the 74 countries included in
our analysis, under the base-case configuration. Detailed country-specific results associated
with the two sensitivity analyses (SA1 and SA2) are available online at \textcolor{red}{ADD LINK TO COUNTRY-SPECIFIC PROFILES SA1-2}.
with the two sensitivity analyses (SA1 and SA2) are \textcolor{blue}{\textbf{\href{https://github.com/monash-emu/AuTuMN/tree/master/docs/school_closures_country_profiles}{available online}}}.

You can access any country's outputs under the base-case configuration by clicking on the relevant country's name below:\\

Expand All @@ -25,4 +156,4 @@ \section{Detailed country-specific results}
\textcolor{blue}{\hyperlink{profiles.\x}{\pgfmathparse{\countrynames[\x]}\pgfmathresult} } \tab
}

\includepdf[pages=-,nup=2x2,frame=true,link=true,linkname=profiles]{../../../../user/rragonnet/remote_run_outputs/31747883_full_analysis_26Sep2023_main/COMMON_DIRECTORY/multi_tiling.pdf}
\includepdf[pages=-,nup=1x2,frame=true,link=true,linkname=profiles, delta=20mm 20mm]{../../../../user/rragonnet/remote_run_outputs/31747883_full_analysis_26Sep2023_main/COMMON_DIRECTORY/multi_highlights.pdf}
Binary file modified docs/tex/user/rragonnet/sm_covid.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions docs/tex/user/rragonnet/sm_covid.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
% Preamble / options / packages %
% ---------------------------------------- %
\documentclass[10pt,a4paper]{report}
\counterwithout{figure}{chapter}
\author{
--------------- Add Authors List here ---------------
}
Expand Down
80 changes: 80 additions & 0 deletions user/rragonnet/remote_run_outputs/country_highlights.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"from pathlib import Path\n",
"from matplotlib import pyplot as plt \n",
"\n",
"from autumn.projects.sm_covid2.common_school.output_plots import country_highlight as ch\n",
"from autumn.projects.sm_covid2.common_school.runner_tools import INCLUDED_COUNTRIES\n",
"full_iso3_list = list(INCLUDED_COUNTRIES['all'].keys())"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"analysis_folders = {\n",
" \"main\": Path.cwd() / \"31747883_full_analysis_26Sep2023_main\",\n",
" \"increased_hh_contacts\": Path.cwd() /\"31902886_full_analysis_05Oct2023_increased_hh_contacts\",\n",
" \"no_google_mobility\": Path.cwd() /\"31915437_full_analysis_05Oct2023_no_google_mobility\"\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"for analysis in analysis_folders:\n",
" for iso3 in full_iso3_list:\n",
" print(f\"{analysis}: {iso3}\")\n",
" folder_path = analysis_folders[analysis] / iso3\n",
" uncertainty_dfs = {sc: pd.read_parquet(folder_path/ f\"uncertainty_df_{sc}.parquet\") for sc in [\"baseline\", \"scenario_1\"]}\n",
" diff_quantiles_df = pd.read_parquet(folder_path / f\"diff_quantiles_df.parquet\")\n",
" derived_outputs = pd.read_pickle(folder_path / \"derived_outputs.pickle\") \n",
" fig = ch.make_country_highlight_figure(iso3, uncertainty_dfs, diff_quantiles_df, derived_outputs, include_country_name=True)\n",
" for file_format in [\"png\", \"pdf\"]:\n",
" fig.savefig(folder_path / f\"highlights_{iso3}.{file_format}\", bbox_inches='tight')\n",
"\n",
" plt.close()\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "summer2",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit e435849

Please sign in to comment.