################
# This R chunk only exists as an easy way to add comments - a bit trickier in Markdown itself
################
# You can adjust settings in the YAML header for styling
#first make sure your simulator function is in the \R folder
#and your App is in an appropriately named folder inside \shinyapps
#use this template and fill it with information for your App
#turn this into an HTML file using RMarkdown (knitr/pandoc)
#make sure the HTML file is in the directory with all the App documentation
#run the processing script (processAllFiles.R), which processes all documentation
#if everything works, the information described below should automatically be displayed in tabs at the bottom of the App UI
#note that the processing script changes some of the styling as specified in the shinystyle.css file
This app allows you to explore a model with 2 pathogens. Read about the model in the “Model” tab. Then do the tasks described in the “What to do” tab.
This model tracks susceptible hosts, hosts infected with either pathogen 1, pathogen 2 or both, and individuals recovered from infection with pathogen 1, pathogen 2 or both. As usual, infected hosts are assumed to be infectious.
The following compartments are included:
The included processes/mechanisms are the following:
The flow diagram and the set of differential equations for the mathematical model implemented in this app are as follows:
Flow diagram for this model.
\[\dot S = - (b_{1} (I_1+I_{1X}) + b_{2} (I_2+I_{2X}) + b_{12}I_{12}) S \] \[\dot I_1 = (b_{1} (I_1+I_{1X}) + ab_{12} I_{12})S - (g_1 + b_{2} (I_2+I_{2X}) + b_{12} I_{12}) I_1\] \[\dot I_2 = (b_{2} (I_2+I_{2X}) + (1-a) b_{12} I_{12})S - (g_2 + b_{1}(I_1 + I_{1X}) + b_{12} I_{12}) I_2\] \[\dot I_{12} = (b_{2} (I_2+I_{2X}) + b_{12} I_{12}) I_1 + (b_{1}(I_1 + I_{1X}) + b_{12} I_{12}) I_2 - g_{12} I_{12}\] \[\dot R_1 = g_1 I_1 - (b_2 (I_2 + I_{2X}) + b_{12} I_{12}) R_1\] \[\dot R_2 = g_2 I_2 - (b_1 (I_1 + I_{1X}) + b_{12} I_{12}) R_2\] \[\dot I_{1X} = (b_1 (I_1 + I_{1X}) + b_{12} I_{12}) R_2 - g_{1} I_{1X}\] \[\dot I_{2X} = (b_2 (I_2 + I_{2X}) + b_{12} I_{12}) R_1 - g_{2} I_{2X}\] \[\dot R_{12} = g_{1} I_{1X} + g_{2} I_{2X} + g_{12} I_{12} \]
The tasks below are described in a way that assumes everything is in units of DAYS (rate parameters, therefore, have units of inverse days). If any quantity is not given in those units, you need to convert it first (e.g. if it says a week, you need to convert it to 7 days).
simulate_multipathogen.R
. You can call this function directly, without going through the shiny app. Type ?simulate_multipathogen
into the R console for more information (you need to exit the graphical interface first or start a new R session). If you go that route, you need to use the results returned from this function and produce useful output (such as a plot) yourself.vignette('DSAIDE')
into the R console).