This repository (Reproduce_Results) provides simulation data to reproduce the results shown in Figure3.
- Set the
Reproduce_Resultsas the working directory. - Inference in original simulation data (Fig. 3c ~ 3e).
a. RunFigure3_cde.Rfile. - Inference in simulation data with measurement errors (Fig. 3f ~ 3h).
a. RunFigure3_fg.RandFigure3_h.Rfile. - Inference in simulation data when transmission rate changes (Fig. 3i ~ 3k).
a. RunFigure3_ijk.Rfile.
rstan: For constructing credible intervals of the estimates using the MCMC method.coda: For convergence diagnostics of the MCMC chains.ggplot2: For plotting the results.
HistD_estimation(): Function to estimate the initial condition using the Hist-D method (See detailed options in supporting information). This function returns the estimated initial condition projected for the specified date.HistD_stan(): Function to calculate the credible interval of the estimate using the MCMC method (See detailed options in supporting information). These results contain 50%, 75%, 95% credible interval of the initial condition and R hat for convergence diagnostics of the MCMC chains.
You can construct the simulation SEIR data by delay differential equations (DDE)
using the mean_trajectory_SEIR_original() function in the "SEIR_function.R" file.
day: Time point (date format) of the data (corresponding to 'Time (days)' in Fig. 3c–e).f_S->E: Number of daily exposed individuals (shown in Fig. 3a).f_E->I: Number of daily infectious individuals.E: True value of E (as shown in Fig. 3c).