Post processing
Overview Structs
Overview Functions
GEMS.age_incidence
GEMS.attack_rate
GEMS.compartment_fill
GEMS.compartment_periods
GEMS.cumulative_cases
GEMS.cumulative_deaths
GEMS.cumulative_disease_progressions
GEMS.cumulative_quarantines
GEMS.deathsDF
GEMS.detected_infections
GEMS.detected_tick_cases
GEMS.detection_rate
GEMS.effectiveR
GEMS.hospital_df
GEMS.household_attack_rates
GEMS.individuals_per_age_group
GEMS.infections
GEMS.infectionsDF
GEMS.observed_R
GEMS.pooltestsDF
GEMS.populationDF
GEMS.population_pyramid
GEMS.reported_tick_cases
GEMS.rolling_observed_SI
GEMS.setting_sizes
GEMS.settingdata
GEMS.sim_infectionsDF
GEMS.simulation
GEMS.testsDF
GEMS.tick_cases
GEMS.tick_cases_per_setting
GEMS.tick_deaths
GEMS.tick_generation_times
GEMS.tick_pooltests
GEMS.tick_serial_intervals
GEMS.tick_tests
GEMS.time_to_detection
GEMS.total_detected_cases
GEMS.total_quarantines
GEMS.total_tests
GEMS.weighted_error_sum
Structs
GEMS.PostProcessor
— TypePostProcessor
A type to provide data processing features supplying reports, plots, or other data analyses.
Internal Fields
simulation::Simulation
: Simulation objectinfectionsDF::DataFrame
: Infections (joined with popuation to get information on infeter and infectee)populationDF::DataFrame
: Population dataframe with one row per individualvaccinationsDF::DataFrame
: Output of the vaccination loggerdeathsDF::DataFrame
: Output of the death loggertestsDF::DataFrame
: Output of the test loggerpooltestsDF::DataFrame
: Output of the pool test loggerquarantinesDF::DataFrame
: Output of th quarantine loggercache::Dict{String, Any}
: Internal cache to store and retrieve intermediate results
Constructors
GEMS.PostProcessor
— MethodPostProcessor(simulation::Simulation)
Create a PostProcessor
object for an associated Simulation
. Post Processing requires a simulation to be done.
GEMS.PostProcessor
— MethodPostProcessor(simulations::Vector{Simulation})
Create a vector of PostProcessor
objects for a vector of associated Simulation
objects. Post Processing requires all simulations to be done.
GEMS.PostProcessor
— MethodPostProcessor(batch::Batch)
Create a vector of PostProcessor
objects for all Simulation
s in a Batch
. Post Processing requires all simulations to be done.
Functions
GEMS.age_incidence
— Functionage_incidence(postProcessor::PostProcessor, timespan::Int64, basesize::Int64)
Returns a DataFrame
containing the infection incidence stratified by (10-year) age groups. The timespan
parameter defines a time window in ticks and the basesize
parameter defines the reference population size to calculate incidences. Assuming 1 tick to be 1 day, a timespan = 7
and basesize = 100_000
configuration results in the commonly known seven-day incidence per 100,000.
The structure assumes no individuals exceeding the age of 100.
Parameters
postProcessor::PostProcessor
: Post processor instancetimespan::Int64
: Reference time window to calculate incidencebasesize::Int64
: Reference population size to calculate incidence
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
total | Float64 | Total incidence |
a0_10 | Float64 | Incidence in age cohort 0-10 |
a11_20 | Float64 | Incidence in age cohort 11-20 |
a21_30 | Float64 | Incidence in age cohort 21-30 |
a31_40 | Float64 | Incidence in age cohort 31-40 |
a41_50 | Float64 | Incidence in age cohort 41-50 |
a51_60 | Float64 | Incidence in age cohort 51-60 |
a61_70 | Float64 | Incidence in age cohort 61-70 |
a71_80 | Float64 | Incidence in age cohort 71-80 |
a81_90 | Float64 | Incidence in age cohort 81-90 |
a91_100 | Float64 | Incidence in age cohort 91-100 |
age_incidence(rd::ResultData)
Returns a DataFrame with incidence over time stratified by age groups. Look up the PostProcessor
docs to find the column definitions. Returns an empty dictionary if the data is not available in the input ResultData
object.
GEMS.attack_rate
— Methodattack_rate(postProcessor::PostProcessor)
Divides the number of individuals who have been infected one (or multiple) time(s) by the total number of individuals.
GEMS.compartment_fill
— Methodcompartment_fill(postProcessor::PostProcessor)
Returns a DataFrame
containing the total count of infected individuals in the respective disease states exposed, infectious, deceased and recovered.
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
exposed_cnt | Int64 | Total number of individuals in the exposed state |
infectious_cnt | Int64 | Total number of individuals in the infectious state |
recovered_cnt | Int64 | Total number of individuals in the recovered state |
deaths_cnt | Int64 | Total number of individuals in the deceased state |
GEMS.compartment_periods
— Methodcompartment_periods(postProcessor::PostProcessor)
Calculates the durations of the disease compartments of all infections and returns a DataFrame
containing all additional infectee-related information.
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
infection_id | Int32 | Infectee id |
total | Int16 | Total duration of infection in ticks |
exposed | Int16 | Duration of the exposed period in ticks |
infectious | Int16 | Duration of the infectious period in ticks |
pre_symptomatic | Int16 | Duration of the pre-symptomatic period in ticks |
asymptomatic | Int16 | Duration of the asymptomatic period in ticks |
symptomatic | Int16 | Duration of the symptomatic period in ticks |
GEMS.cumulative_cases
— Methodcumulative_cases(postProcessor::PostProcessor)
Returns a DataFrame
containing the cumulative infections count of infected individuals in the respective disease states exposed, infectious, and removed.
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
exposed_cum | Int64 | Total number of individuals in the exposed state |
infectious_cum | Int64 | Total number of individuals in the infectious state |
removed_cum | Int64 | Total number of individuals in the removed state |
GEMS.cumulative_deaths
— Methodcumulative_deaths(postProcessor::PostProcessor)
Returns a DataFrame
containing the total count of individuals that died.
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
deaths_cum | Int64 | Total number of individuals that have died until now |
GEMS.cumulative_disease_progressions
— Methodcumulative_disease_progressions(postProcessor::PostProcessor)
Calculates the accumulated number of individuals in a certain disease state (latent, presymptomatic, symptomatic and asymptomatic) after the individual has been infected. Rows indicate the number of elapsed ticks since infections.
Example: Row 8 showing [20, 47, 290, 50] would mean that eight ticks after exposure, 20 individuals were latent, 47 were presymptomatic (no symptoms yet, but will be developing), 290 had symptoms and 50 are not experiencing symptoms and won't ever do.
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
latent | Int64 | Number of latent individuals X ticks after exposure |
pre_symptomatic | Int64 | Number of pre-symptomatic individuals X ticks after exposure |
symptomatic | Int64 | Number of symptomatic individuals X ticks after exposure |
asymptomatic | Int64 | Number of asymptomatic individuals X ticks after exposure |
GEMS.cumulative_quarantines
— Methodcumulative_quarantines(postProcessor::PostProcessor)
Returns a DataFrame
containing cumulative information about days spent in isolation.
Columns
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
quarantined | Int64 | Total number of individuals in isolation during that tick |
students | Int64 | Total number of students in isolation during that tick |
workers | Int64 | Total number of workers in isolation during that tick |
other | Int64 | Total number of non-students and -workers in isolation during that tick |
GEMS.deathsDF
— MethoddeathsDF(postProcessor::PostProcessor)
Returns the internal flat deaths DataFrame
.
Columns
Name | Type | Description |
---|---|---|
tick | Int16 | Tick of the death event |
id | Int32 | Individual's id |
sex | Int8 | Individual's sex |
age | Int8 | Individual's age |
education | Int8 | Individual's education level |
occupation | Int8 | Individual's occupation group |
household | Int32 | Individual's associated household |
office | Int32 | Individual's associated office |
school | Int32 | Individual's associated school |
GEMS.detected_infections
— Methoddetected_infections(postProcessor::PostProcessor)
A subset of the infections
dataframe with only the detected cases. An infection is considered to be detected if the infection has a non-missing first_detected_tick
. For the column definitions, look up the infectionsDF(postProcessor)
documentation.
Returns
DataFrame
: Please look up the column definitions in theinfectionsDF(postProcessor)
documentation.
GEMS.detected_tick_cases
— Methoddetected_tick_cases(postProcessor::PostProcessor)
Returns the number of detected cases per tick and the number of true new exposures. This analysis is based on the tick_test
column of the infections-dataframe which indicates when an individual with an active infection was first tested positive. Thus, there might be a delay between exposure_cnt
and detected_cnt
.
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
total_reported_cases | Int64 | Total number of reported cases at that tick |
new_detections | Int64 | Number of true new detected cases at that tick (not known before) |
double_reports | Int64 | Number of cases that were reported at that tick but were known before |
false_positives | Int64 | Number of false positive reports at that tick |
exposed_cnt | Int64 | Number of new infections at that tick |
GEMS.detection_rate
— Methoddetection_rate(postProcessor::PostProcessor)
Returns the fraction of detected cases.
GEMS.effectiveR
— MethodeffectiveR(postProcessor::PostProcessor)
Returns a DataFrame
containing the effective R value for each tick.
For each infectee, this method looks ahead for secondary infections this individual might cause during the total span of the simulation. These infections are then counted towards the R-value of the initial infection. If individual A, for example, is infected at time 42 and causes four secondary infections during the next 14 ticks, these four infections are counted towards the R-value of time 42.
Note: This only works in scenarios without re-infection as the current implementation just evaluates the total infections caused by each individual in general. If an individual was infected multiple times, secondary infections will inflate the statistic.
Returns
Dataframe
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
effective_R | Float64 | Effective R-value |
rolling_R | Float64 | Effective R rolling average of the 7 previous ticks |
GEMS.hospital_df
— Methodhospital_df(postProcessor::PostProcessor)
Creates a DataFrame that includes information about the current hospitalizations etc.
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
hospital_cnt | Int64 | New hospitalizations per tick |
hospital_releases | Int64 | Hospital releases per tick |
icu_cnt | Int64 | New ICU admissions per tick |
icu_releases | Int64 | ICU releases per tick |
ventilation_cnt | Int64 | New ventilations per tick |
ventilation_releases | Int64 | Ventilation stops |
current_hospitalized | Int64 | Number of currently hospitalized agents |
current_icu | Int64 | Number of agents currently in the ICU |
current_ventilation | Int64 | Number of currently ventilated agents |
GEMS.household_attack_rates
— Methodhousehold_attack_rates(postProcessor::PostProcessor; hh_samples::Int64 = HOUSEHOLD_ATTACK_RATE_SAMPLES)
Returns a DataFrame
containing data on the in-household attack rate. The in-household attack rate is defined as the fraction of individuals in a given household that got infected within the household (in-household infection chain) caused by the first introduction of the pathogen in this household. It does not reflect overall fraction of individuals that were infected in this household throughout the course of the simuation. As the attack rate calculation is very computationally intensive, it is not done for all household but rather for a subset of households. You can change the desired subset size through the optional hh_samples
argument. Its default can be found in constants.jl
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
first_introduction | Int16 | Time of when the first member of the respective household was exposed |
hh_id | Int32 | Household setting identifier |
hh_size | Int16 | Household size |
chain_size | Int32 | Number of individuals that got infected within the household |
hh_attack_rate | Float64 | Number of infected individuals divided by household size |
GEMS.individuals_per_age_group
— Functionindividuals_per_age_group(post_processor::PostProcessor, interval_steps::Int64)
The population in populationDF
will be splitted in age groups of size interval_steps
and the number of individuals per age group is counted.
The input DataFrame already needs a column called "sum" where the sum of individuals in this age is stored.
Returns
- returns a DataFrame with the follwing structure:
Name | Type | Description |
---|---|---|
age_group | String | Min and Max age in this age group |
num_individuals | Int64 | Total number of individuals |
individuals_per_age_group(post_processor::PostProcessor, interval_steps::Int64, aggregation_bound::Int64)
The the population in populationDF
will be splitted in age groups of size interval_steps
and the number of individuals per age group is counted. The splitting is capped at aggregation_bound
.
The input DataFrame already needs a column called "sum" where the sum of individuals in this age is stored.
Returns
- returns a DataFrame with the follwing structure:
Name | Type | Description |
---|---|---|
age_group | String | Min and Max age in this age group |
num_individuals | Int64 | Total number of individuals |
GEMS.infections
— Methodinfections(postProcessor::PostProcessor)
Returns the internal flat infections DataFrame
.
Columns
Name | Type | Description |
---|---|---|
infection_id | Int32 | Unique identifier of an infection |
tick | Int16 | Tick of the infection event |
id_a | Int32 | Infecter id |
id_b | Int32 | Infectee id |
infectious_tick | Int16 | Tick at which infectee becomes infectious |
removed_tick | Int16 | Tick at which infectee becomes removed (recovers) |
symptoms_tick | Int16 | Tick at which infectee develops symptoms |
severeness_tick | Int16 | Tick at which infectee's symptoms become severe |
hospital_tick | Int16 | Tick at which infectee is hospitalized |
icu_tick | Int16 | Tick at which infectee is admitted to ICU |
ventilation_tick | Int16 | Tick at which infectee requires ventilation |
symptom_category | Int8 | Disease progression category (asymp., mild, severe, critical) |
setting_id | Int32 | Id of setting in which infection happens |
setting_type | Char | Setting type of the infection setting |
lat | Float32 | Latitude of infection location |
lon | Float32 | Longitude of infection location |
ags | Int32 | German Community Identification Number of infection |
source_infection_id | Int32 | ID of the infection even that caused this infection (chain) |
generation_time | Int16 | Time between preceeding infection and this exposure |
serial_interval | Int16 | Time between onset of symptoms of this and preceeding infection |
test_type | String | Type of test which detected this infection |
first_detected_tick | Int16 | Tick of (reportable) test that first detected this infection |
sex_a | Int8 | Infecter sex |
age_a | Int8 | Infecter age |
number_of_vaccinations_a | Int8 | Infecter number of previous vaccinations |
vaccination_tick_a | Int16 | Infecter last time of vaccination |
education_a | Int8 | Infecter education level |
occupation_a | Int8 | Infecter occupation group |
household_a | Int32 | Infecter associated household |
office_a | Int32 | Infecter associated office |
schoolclass_a | Int32 | Infecter associated school |
sex_b | Int8 | Infectee sex |
age_b | Int8 | Infectee age |
number_of_vaccinations_a | Int8 | Infecter number of previous vaccinations |
vaccination_tick_a | Int16 | Infecter last time of vaccination |
education_b | Int8 | Infectee education level |
occupation_b | Int8 | Infectee occupation group |
household_b | Int32 | Infectee associated household |
office_b | Int32 | Infectee associated office |
schoolclass_b | Int32 | Infectee associated schoolclass |
household_ags_b | Int32 | Infectee household German Community Identification Number |
GEMS.infectionsDF
— MethodinfectionsDF(postProcessor::PostProcessor)
Returns the internal flat infections DataFrame
. Lookup the docstring of infections(postProcessor::PostProcessor)
for column definitions.
GEMS.observed_R
— Methodobserved_R(postProcessor::PostProcessor)
Returns a DataFrame
containing estimations for the effective (current) reproduction number R, based on detected infections. The calculation uses the estimation for the (rolling) observed serial interval (SI) and the total of detected cases within a time window of the length defined in R_ESTIMATION_TIME_WINDOW
(lookup constants.jl
) ending with a current tick t
. It divides the total detected infections in the current time window with the total detected infections in the time window that lies one SI behind. The function does this for the mean estimate of the serial interval as well as the (floored) lower-95% confidence bound and the (ceiled) upper-95% confidence bound.
Example
- For tick
t = 42
and - Given the
R_ESTIMATION_TIME_WINDOW = 7
, and - The rolling observed serial interval being
4
, - This function does:
sum(infections[35:42]) / sum(infections[31:38])
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
mean_est_R | Float64 | Mean estimation (based on detected infections) for R |
lower_est_R | Float64 | Lower bound estimation (based on detected infections) for R |
upper_est_R | Float64 | Upper bound estimation (based on detected infections) for R |
GEMS.pooltestsDF
— MethodpooltestsDF(postProcessor::PostProcessor)
Returns the internal flat pool tests DataFrame
.
Columns
Name | Type | Description |
---|---|---|
test_tick | Int16 | Tick of the test event |
setting_id | Int32 | Setting id of the tested pool |
setting_type | Int32 | Setting type |
test_result | Bool | Test result (pos./neg.) |
no_of_individuals | Int32 | Number of tested individuals |
no_of_infected | Int32 | Number of actually infected individuals |
test_type | String | Name of test type |
GEMS.populationDF
— MethodpopulationDF(postProcessor)
Returns the internal flat population DataFrame
.
Columns
Name | Type | Description |
---|---|---|
id | Int32 | Individual id |
sex | Int8 | Individual sex |
age | Int8 | Individual age |
education | Int8 | Individual education level |
occupation | Int8 | Individual occupation group |
household | Int32 | Individual associated household |
office | Int32 | Individual associated office |
school | Int32 | Individual associated school |
GEMS.population_pyramid
— Methodpopulation_pyramid(postProcessor::PostProcessor)
Returns a DataFrame
containing data to generate a population pyramid. It provides the sum of all female and male individuals in all age groups in the population model. Sums for female are multiplied by -1 to facilitate visualization.
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
age | Int8 | 1-year age classes |
sex | Int8 | Sex according to population DataFame (0 = female, 1 = male) |
gender | String | String variant of Sex [Female, Male] |
sum | Int64 | Total of all genders in all ages (females multiplied by -1) |
GEMS.reported_tick_cases
— Methodreported_tick_cases(postProcessor::PostProcessor)
Returns the number of reported positive test cases per tick. This analysis is based on the testDF
dataframe.
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
reported_cnt | Int64 | Number of newly reported infections (positive reportable tests) at that tick |
GEMS.rolling_observed_SI
— Methodrolling_observed_SI(postProcessor::PostProcessor)
Returns a DataFrame
containing aggregated estimations on the serial interval based on true detected cases. The estimations are based on all true detected cases in a 14-past-days time window. If fewer than 50 infections were recorded in that time window, detections prior to that are added until the sample is complete. This is done in order to reduce large stochastic fluctuations due to small sample size.
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
min_SI | Int16 | Minimal serial interval recored for any infection that tick |
max_SI | Int16 | Maximum serial interval recored for any infection that tick |
lower_95_SI | Float64 | Lower 95% confidence interval for serial intervals that tick |
upper_95_SI | Float64 | Upper 95% confidence interval for serial intervals that tick |
std_SI | Float64 | Stanard deviation for serial intervals that tick |
mean_SI | Float64 | Mean for serial intervals that tick |
GEMS.setting_sizes
— Methodsetting_sizes(postProcessor::PostProcessor)
Returns a Dictionary
containing information about size of the settings. The keys are equal to the settingtypes and the values correspond to a countmap of the setting sizes.
Returns
Dict{String, Dict{Int64, Int64}}
: Nested dictionary where the first key is the name of the setting type (e.g., "Household") and the innter dictionary is a countmap with the key being a setting size (e.g., 5) and the value the number of occurences.
GEMS.settingdata
— Methodsettingdata(postProcessor::PostProcessor)
Returns a DataFrame
containing information about setting types
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
setting_type | String | Setting type identifier (name) |
number_of_settings | Int64 | Overall number of settings of that type |
min_individuals | Float64 | Lowest number of individuals assigned to a setting of this type |
max_individuals | Float64 | Highest number of individuals assigned to a setting of this type |
avg_individuals | Float64 | Average number of individuals assigned to a setting of this type |
GEMS.sim_infectionsDF
— Methodsim_infectionsDF(postProcessor::PostProcessor)
Returns a DataFrame
containing all infections that happened during the simulation run. As it is a direct filter on the PostProcessor
s internal infectionsDF
, the column structure is identical to the output of infectionsDF(postProcessor)
GEMS.simulation
— Methodsimulation(postProcessor::PostProcessor)
Returns the associated Simulation
object.
GEMS.testsDF
— MethodtestsDF(postProcessor::PostProcessor)
Returns the internal flat tests DataFrame
. It was joined with the population dataframe to also obtain personal characteristics about the testees.
Columns
Name | Type | Description |
---|---|---|
test_tick | Int16 | Tick of the test event |
id | Int32 | Individual's id |
test_result | Bool | Test result |
infected | Bool | Individual's current infection state |
infection_id | Int32 | Individual's infection id |
test_type | String | Test name |
reportable | Bool | If true, a positive test result will be "reported" |
sex | Int8 | Individual's sex |
age | Int8 | Individual's age |
number_of_vaccinations | Int8 | Individual's number of vaccinations |
vaccination_tick | Int16 | Tick when the individual was last vaccinated |
education | Int8 | Individual's education level |
occupation | Int8 | Individual's occupation group |
household | Int32 | Individual's associated household |
office | Int32 | Individual's associated office |
school | Int32 | Individual's associated school |
GEMS.tick_cases
— Methodtick_cases(postProcessor::PostProcessor)
Returns a DataFrame
containing the count of individuals currently entering in the respective disease states exposed, infectious, and removed.
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
exposed_cnt | Int64 | Number of individuals entering the exposed state |
infectious_cnt | Int64 | Number of individuals entering the infectious state |
removed_cnt | Int64 | Number of individuals entering the removed state |
GEMS.tick_cases_per_setting
— Methodtick_cases_per_setting(postProcessor::PostProcessor)
Returns a DataFrame
containing information about the infections in different setting types
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Current tick of the simulation |
setting_type | String | Setting type identifier (name) |
daily_cases | Int64 | Cases for setting and tick |
GEMS.tick_deaths
— Methodtick_deaths(postProcessor::PostProcessor)
Returns a DataFrame
containing the count of individuals that died per tick.
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
death_cnt | Int64 | Number of individuals that dies |
GEMS.tick_generation_times
— Methodtick_generation_times(postProcessor::PostProcessor)
Returns a DataFrame
containing aggregated information on the generation time per tick.
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
min_generation_time | Int16 | Minimal generation time recored for any infection that tick |
max_generation_time | Int16 | Maximum generation time recored for any infection that tick |
lower_95_generation_time | Float64 | Lower 95% confidence interval for generation times that tick |
upper_95_generation_time | Float64 | Upper 95% confidence interval for generation times that tick |
std_generation_time | Float64 | Stanard deviation for generation times that tick |
mean_generation_time | Float64 | Mean for generation times that tick |
GEMS.tick_pooltests
— Method tick_pooltests(postProcessor::PostProcessor)
Returns a Dict for each employed test_type containing their name as a key and a DataFrame
containing the number of applied pool tests (positive/negative/total) per tick.
Returns
Dict{String, DataFrame}
: The key is theTestType
's name. The values areDataFrames
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
positive_tests | Int64 | Number of positive tests |
negative_tests | Int64 | Number of negative tests |
total_tests | Int64 | Number of tests performed |
GEMS.tick_serial_intervals
— Methodtick_serial_intervals(postProcessor::PostProcessor)
Returns a DataFrame
containing aggregated information on the serial interval per tick.
Returns
DataFrame
with the follwing columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
min_SI | Int16 | Minimal serial interval recored for any infection that tick |
max_SI | Int16 | Maximum serial interval recored for any infection that tick |
lower_95_SI | Float64 | Lower 95% confidence interval for serial intervals that tick |
upper_95_SI | Float64 | Upper 95% confidence interval for serial intervals that tick |
std_SI | Float64 | Stanard deviation for serial intervals that tick |
mean_SI | Float64 | Mean for serial intervals that tick |
GEMS.tick_tests
— Methodtick_tests(postProcessor::PostProcessor)
Returns a Dict for each employed test_type containing their name as a key and a DataFrame
containing the count of individuals that got tested (positive/negative) as well as the people reported positive for the first time per tick.
Returns
Dict{String, DataFrame}
: The key is theTestType
's name. The values areDataFrames
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int16 | Simulation tick (time) |
reported_cases | Int16 | Number cases tested positive for the first time |
positive_tests | Int64 | Number of positive tests |
negative_tests | Int64 | Number of negative tests |
total_tests | Int64 | Number of tests performed |
positive_rate | Float64 | Fraction of positive tests |
rolling_positive_rate | Float64 | Positive rate rolling average of the 7 previous ticks |
GEMS.time_to_detection
— Methodtime_to_detection(postProcessor::PostProcessor)
Returns the mean, standard deviation, minimum, maximum, upper- and lower 95% confidence intervals of the time to detection for all detected cases. The time to detection is defined as the number of ticks between the time of exposure and time of detection.
Returns
DataFrame
with the following columns:
Name | Type | Description |
---|---|---|
tick | Int64 | Simulation tick (time) |
mean_time_to_detection | Int64 | Mean time to detection at that tick |
std_time_to_detection | Int64 | Standard deviation of time to detection at that tick |
min_time_to_detection | Int64 | Minimum time to detection at that tick |
max_time_to_detection | Int64 | Maximum time to detection at that tick |
upper_95_time_to_detection | Int64 | Upper 95% confidence interval of time to detection at that tick |
lower_95_time_to_detection | Int64 | Lower 95% confidence interval of time to detection at that tick |
GEMS.total_detected_cases
— Methodtotal_detected_cases(postProcessor::PostProcessor)
Returns the total number of detected cases.
GEMS.total_quarantines
— Methodtotal_quarantines(postProcessor::PostProcessor)
Returns the total number of total ticks spent in quarantine. E.g., if 10 indiviuals were in quarantine for 5 ticks each, this function will return 50.
GEMS.total_tests
— Methodtotal_tests(postProcessor::PostProcessor)
Sums up the total number of tests per test type.
Returns
Dict{String, Int64}
: Dictionary where the key is theTestType
's name and the value the number of tests that were applied.
GEMS.weighted_error_sum
— Functionweighted_error_sum(post_processor::PostProcessor, error_matrix::ContactMatrix{T})::T where T <: Number
Calculate a weighted error sum for the given contact matrix. Each cell will be multiplied by the number of individuals in the corresponding age group and then divided by the number of individuals in the whole population.
weighted_error_sum = (cell value * individuals per age group) / population size)
To calculate the weighted sum, "weighted arithmetic mean" is used.
Assumptions
error_matrix
Matrix contains error values between two contact matrices.
weighted_error_sum(post_processor::PostProcessor, setting::DataType, reference_matrix::ContactMatrix{T}; fit_to_reference_matrix::Bool)::T where T <: Number
Calculate a "weighted error sum" for a setting specific contact matrix compared to a reference_matrix
. The post_processor
is used to calculate a contact matrix for the associated simulation that will then be fitted by a factor alpha
calculated from the differences between the simulation contact matrix and the reference_matrix
.
Compared to weighted_error_sum(post_processor::PostProcessor, error_matrix::ContactMatrix{T})::T where T <: Number
the error_matrix
first needs to be calculated using the post_processor
and the reference_matrix
.
Each cell of the calculated error matrix will be multiplied by the number of individuals in the corresponding age group and then divided by the number of individuals in the whole population of the simulation.
weighted_error_sum = (cell value * individuals per age group) / population size)
To calculate the weighted sum, "weighted arithmetic mean" is used.
Parameters
post_processor::PostProcessor
:PostProcessor
object containing the simulation and population datasetting::DataType
: Settingtype of thereference_matrix
(i.e. Household)reference_matrix::ContactMatrix{T}
: Matrix containing mean number of contacts per age group between individuals of one settingtype.fit_to_reference_matrix::Bool
: Flag, indicating if the matrix calculated from the simulation should be fitted to the 'reference_matrix`.
Assumptions
reference_matrix
logically stems from the same setting assetting
!