# Orzechowska M, Bednarek AK: Forecasting COVID-19 pandemic in Poland according to government regulations and people behavior (2020) library(devtools) install_github("lilywang1988/eSIR") library(eSIR) set.seed(22052020) # Poland: 04.03.2020 -> 22.05.2020 NI_complete = c(1,1,5,6,11,17,22,31,51,68,104,125,177,238,287,355,425,536,634,749,901,1051,1221,1389,1638,1862,2055,2311,2554,2946,3383,3627,4102,4413,4848,5205,5575,5955,6356,6674,6932,7202,7582,7918,8375,8709,9224,9530,9793,10106,10448,10829,11210,11554,11839,12155,12577,12877,13105,13375,13693,14006,14412,14723,15026,15363,15651,15996,16326,16882,17204,17615,18016,18257,18529,18885,19267,19738,20143,20619) RI_complete = c(0,0,0,0,0,0,0,0,1,2,3,3,4,6,6,6,6,6,8,9,11,14,17,17,19,23,32,34,44,58,72,195,228,269,320,380,458,499,583,671,732,881,954,1088,1198,1328,1400,1513,1697,1938,2193,2437,2649,2800,3027,3250,3648,3879,4141,4424,4622,4791,4995,5388,5617,5959,6221,6497,6626,6969,7271,7579,7825,8090,8376,8564,8851,9145,9424,9713) N = 37.96e6 R = RI_complete / N Y = NI_complete / N - R # 04.03 -> 22.05 change_time = c("03/12/2020", "03/16/2020", "03/25/2020", "04/16/2020", "05/18/2020") NI_complete_1 = c(1,1,5,6,11,17,22,31,51) RI_complete_1 = c(0,0,0,0,0,0,0,0,1) R1 = RI_complete_1 / N Y1 = NI_complete_1 / N - R1 # 04.03 -> 12.03 change_time1 = c("03/12/2020") pi0_0.2 = c(0.95, 0.7, 0.5, 0.4, 0.2, 0.2) pi0_0.4 = c(0.95, 0.7, 0.5, 0.4, 0.2, 0.4) pi0_0.6 = c(0.95, 0.7, 0.5, 0.4, 0.2, 0.6) pi0_0.8 = c(0.95, 0.7, 0.5, 0.4, 0.2, 0.8) pi0_1 = c(1) res.step_02 = tvt.eSIR(Y, R, begin_str = "03/04/2020", T_fin = 300, pi0 = pi0_0.2, change_time = change_time, dic = T, casename = "Poland_step_02", save_files = T, save_mcmc=F, save_plot_data = T, M = 5e5, nburnin = 2e5) res.step_04 = tvt.eSIR(Y, R, begin_str = "03/04/2020", T_fin = 300, pi0 = pi0_0.4, change_time = change_time, dic = T, casename = "Poland_step_04", save_files = T, save_mcmc=F, save_plot_data = T, M = 5e5, nburnin = 2e5) res.step_06 = tvt.eSIR(Y, R, begin_str = "03/04/2020", T_fin = 300, pi0 = pi0_0.6, change_time = change_time, dic = T, casename = "Poland_step_06", save_files = T, save_mcmc=F, save_plot_data = T, M = 5e5, nburnin = 2e5) res.step_08 = tvt.eSIR(Y, R, begin_str = "03/04/2020", T_fin = 300, pi0 = pi0_0.8, change_time = change_time, dic = T, casename = "Poland_step_08", save_files = T, save_mcmc=F, save_plot_data = T, M = 5e5, nburnin = 2e5) res.step_1 = tvt.eSIR(Y1, R1, begin_str = "03/04/2020", T_fin = 300, pi0 = pi0_1, change_time = change_time1, dic = T, casename = "Poland_step_1", save_files = T, save_mcmc=F, save_plot_data = T, M = 5e5, nburnin = 2e5)