src.plotting.msm_plots

Module Contents

Functions

plot_estimation_moment(results, name)

Visualize an estimation moment over several runs.

_extract_grouped_moment(results, name)

Extract a moment defined on subgroups from list of msm results.

_extract_aggregated_moment(results, name)

Extract a moment defined on the population level from list of msm results.

_plot_simulated_and_empirical_moment(simulated, empirical, ax=None)

Plot moments into axis.

_split_name(name)

_sort_age_groups(age_groups)

plot_infection_channels(results, aggregate=False, unit='incidence')

Plot average infection channels over several runs.

_aggregate_models_over_domain(df)

plot_line_with_gaps(x, y, ax, **kwargs)

"Lineplot that does skips where there are no observations.

plot_estimation_moment(results, name)[source]

Visualize an estimation moment over several runs.

It is assumed that the entries in results only differ by their random seed.

Parameters
  • results (list) – List of msm criterion outputs

  • name (str) – Name of the estimation moment.

_extract_grouped_moment(results, name)[source]

Extract a moment defined on subgroups from list of msm results.

Parameters
  • results (list) – List of msm results

  • name (str) – Key of the moment in the moment dictionary

Returns

simulated moment per age group pd.Series: empirical moment per age_group

Return type

pd.DataFrame

_extract_aggregated_moment(results, name)[source]

Extract a moment defined on the population level from list of msm results.

Parameters
  • results (list) – List of msm results

  • name (str) – Key of the moment in the moment dictionary

Returns

simulated moment per age group pd.Series: empirical moment per age_group

Return type

pd.DataFrame

_plot_simulated_and_empirical_moment(simulated, empirical, ax=None)[source]

Plot moments into axis.

_split_name(name)[source]
_sort_age_groups(age_groups)[source]
plot_infection_channels(results, aggregate=False, unit='incidence')[source]

Plot average infection channels over several runs.

It is assumed that the entries in results only differ by their random seed.

Parameters
  • results (list) – List of msm criterion outputs

  • aggregate (bool) – Whether contact models are aggregated over the domains work, households, school, young_educ and other.

_aggregate_models_over_domain(df)[source]
plot_line_with_gaps(x, y, ax, **kwargs)[source]

“Lineplot that does skips where there are no observations.