Calculate transmission metrics to estimate epidemic potential, velocity, and spread
Effective Reproduction
The Effective Reproduction Number (Re) is the average number of secondary premises infected by a source per day. Re is used to estimate epidemic potential.
Example code demonstrates the workflow for the Eastern U.S. region. Central U.S. figures are included in the regional panels below. Select the tabs to view regional comparisons.
Epidemic Velocity
The epidemic velocity is the distance (km) of spread per day. The epidemic velocity is estimated by first calculating the daily spread distances.
Calculate Daily Distances
compile_daily_summary() calculates distances (km) between source farms and those infected for each iteration, then calculates the percentiles by day across all iterations to get the average statistics.
Compare scenarios by looking for patterns at the level of individual iterations. iteration_metrics() will use the other output in daily_summary to look at trends between optimal and suboptimal responses.
The function returns iteration specific metrics:
auc_log
The amount of area (total) under the plotted line (distance x day) above on a log scale, i.e., the Area Under Curve (AUC). This represents the total distance covered during the outbreak`s spread (on the log scale).
peak_spread
The maximum distance spread in any one day (log scale).
peak_day
The infect day that the maximum spread distance (peak_spread) occurred.
## Filter data to scenarioiteration_metrics_select <- iteration_metrics %>%filter(scenario_type =="Suboptimal") %>%filter(preclinical =="3")## Select and order columns to displayiteration_metrics_select <- iteration_metrics_select[c("iteration", "auc_log", "peak_spread", "peak_day")]head(iteration_metrics_select)
iteration
auc_log
peak_spread
peak_day
1
57.56127
5.302539
18
2
231.03620
5.451650
25
3
901.49964
5.527616
89
4
162.08489
7.021728
36
5
244.14070
5.940245
12
6
197.69113
5.667478
56
Cumulative Spread
Drop the low-virulence scenarios to compare optimal and suboptimal detection scenarios. Plot the estimated Area Under the Curve (AUC). auc_log represents the total cumulative spread distance, for each scenario by iteration, on a log scale.
Code
## Drop the low-virulence scenarioiteration_metrics_no_low <- iteration_metrics %>%filter(scenario_type !="Low-Virulence")## Plot AUCggplot(iteration_metrics_no_low, aes(x = preclinical, y = auc_log, color = scenario_type)) +geom_point(shape=1, alpha =0.3, size =2) +# individual iterationsgeom_smooth(method ="lm", se =FALSE, linewidth=1.2) +# trendfacet_grid(. ~ scenario_type) +scale_color_manual(values =c("Suboptimal"="#74add1", "Optimal"="orange2")) +labs(x ="Preclinical Infectious Duration (days)",y ="Cumulative Spread (log AUC)",title =" " ) +theme_minimal() +theme(plot.margin =unit(c(0.25, 0.25, 0.25, 0.25), "cm"),legend.position ="none",strip.text =element_text(size =18, face ="bold", color ="gray40"),axis.title.x =element_text(size =22, face ="bold"),axis.title.y =element_text(size =22, face ="bold"),axis.text.x =element_text(size =18, face ="bold"),axis.text.y =element_text(size =18, face ="bold"),plot.title =element_text(size =22, face ="bold", hjust =0.5) )
Significance Test
Fit a linear model with an interaction term to quantify the influence of preclinical infectious duration (preclinical) and detection scenario (scenario_type) on cumulative outbreak spread (auc_log).