From c04cfa4bea69a556bc496fd4244528792437dc61 Mon Sep 17 00:00:00 2001 From: ben18785 Date: Mon, 12 Aug 2024 17:34:11 +0100 Subject: [PATCH] Update fitting_synthetic_data_using_epidp.Rmd --- vignettes/fitting_synthetic_data_using_epidp.Rmd | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vignettes/fitting_synthetic_data_using_epidp.Rmd b/vignettes/fitting_synthetic_data_using_epidp.Rmd index 0a1fc9a..24c3d64 100644 --- a/vignettes/fitting_synthetic_data_using_epidp.Rmd +++ b/vignettes/fitting_synthetic_data_using_epidp.Rmd @@ -119,17 +119,20 @@ i_0 <- 10 epidemic_df <- simulate_renewal_epidemic(rt_fun, nt, mean_si, sd_si, i_0) # plot +transform_factor <- 150 epidemic_df %>% select(-c(w_dist, lambda_t)) %>% + mutate(R_t = R_t * transform_factor) %>% pivot_longer(c(i_t, R_t)) %>% ggplot(aes(x = t, y = value, colour = name)) + geom_line() + scale_y_continuous( name = "Incidence (i_t)", - sec.axis = sec_axis(~ . / 1000, name = "Reproduction Number (R_t)") + sec.axis = sec_axis(~ . / transform_factor, name = "Reproduction Number (R_t)") ) + - labs(x = "Time", colour = "Variable") + - theme_minimal() + labs(x = "Time") + + theme_minimal() + + scale_color_brewer("Series", palette = "Dark2") ``` We now use a Stan version of EpiFilter to estimate the $R_t$ profile.