\documentclass{beamer}
%\usetheme{AnnArbor}
\usepackage{hyperref}

\begin{document}



\begin{frame}
\vspace*{-.5 true cm}
\begin{figure}
\centering
\includegraphics[width=10cm]{simiode-wordheader-Color}
\end{figure}
\vspace*{.5 true cm}

\begin{center}
{\Huge \bf Modeling Nonlethal\\ Influenza Epidemic}

\vspace*{.9 true cm}

Brian Winkel, Director@simiode.org

\vspace*{.4 true cm}
SIMIODE, Cornwall NY USA
\end{center}
\end{frame}


\begin{frame}
\frametitle{Overview of Class}
%\tableofcontents
\vspace*{-1 true cm}
\centerline{\Large \bf Modeling Nonlethal Influenza Epidemic}
\vspace*{.4 true cm}
We  use data on the spread of a nonlethal influenza in an English boarding school to model the spread of an epidemic.

\vspace*{.2 true cm}

\begin{enumerate}
\item Examine historical data from English boarding school.
\vspace*{.1 true cm}\item Build a model of interaction between populations: Susceptible, Infected, and Removed.
\vspace*{.1 true cm}\item Solve the system of nonlinear differential equations, estimate parameters,   validate model.
\end{enumerate}
\end{frame}

\begin{frame}

{\bf Sources:} 

\begin{itemize}
\item [] \hspace*{-.8 true cm} {\bf \href{https://qubeshub.org/community/groups/simiode/publications?id=2956\&v=1}{6-001-Epidemic }} Modeling Scenario in SIMIODE

\vspace*{.4 true cm} 
\item [] \hspace*{-.8 true cm} Communicable Disease Surveillance Center. 1978. News and Notes: Influenza in a Boarding School. {\it British Medical Journal\/}. 1(6112): 586-590. 
\end{itemize}

\end{frame}

\begin{frame}
A boarding school with 763 students is a relatively closed community in which all students live on campus, teachers tend to live on or near campus, and students do not regularly interact with people not in the boarding school community. 

\vspace*{.2 true cm}
Table~\ref{table:Bedriddens} gives data for an influenza outbreak at a boarding school in England during which there were no fatalities.

\begin{table}[h]
\small
\begin{center}
\begin{tabular}{|c||c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline
\hspace*{-.2 true cm} Time (days) \hspace*{-.2 true cm} & \hspace*{-.2 true cm}  0\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  1\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  2 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 3\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  4 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 5\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  6 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 7 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 8\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  9\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  10 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 11\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  12 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 13\\ \hline
\hspace*{-.2 true cm} Sick Students \hspace*{-.2 true cm} & \hspace*{-.2 true cm}  1\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  3 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 25 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 72\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  222\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  282 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 256 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 233\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  189 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 123 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 70 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 25\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  11\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  4\\ \hline
\end{tabular}

\caption{\label{table:Bedriddens} 1. Total Number of Bedridden Students on Day $t$.}
\end{center}

\end{table}
\end{frame}

\begin{frame}


\begin{table}[h]
\small
\begin{center}
\begin{tabular}{|c||c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline
\hspace*{-.2 true cm} Time (days) \hspace*{-.2 true cm} & \hspace*{-.2 true cm}  0\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  1\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  2 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 3\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  4 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 5\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  6 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 7 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 8\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  9\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  10 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 11\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  12 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 13\\ \hline
\hspace*{-.2 true cm} Sick Students \hspace*{-.2 true cm} & \hspace*{-.2 true cm}  1\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  3 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 25 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 72\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  222\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  282 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 256 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 233\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  189 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 123 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 70 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 25\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  11\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  4\\ \hline
\end{tabular}

\caption{ 1. Total Number of Bedridden Students on Day $t$.}
\end{center}

\end{table}


\begin{figure}
\centering
\includegraphics[width=8cm]{SIR-DataPlot.png}


\parbox{6.8 true cm}{\caption{\label{fig:SIR-DataPlot.png}  1. Plot of number of sick or infirmed students in English boarding school over time.}}

\end{figure}
\end{frame}

\begin{frame}
What characteristics do the students have with respect to the influenza disease on campus?  

\vspace*{.3 true cm}

We list them here \ldots 
\end{frame}

\begin{frame}
What characteristics do the students have with respect to the influenza disease on campus? Or what categories might students fall into with respect to the influenza disease on campus?
\vspace*{.3 true cm}


We list them here \ldots 
\begin{itemize}
\item Infected with the influenza
\end{itemize}

\end{frame}

\begin{frame}
What characteristics do the students have with respect to the influenza disease on campus? Or what categories might students fall into with respect to the influenza disease on campus?

\vspace*{.3 true cm}

We list them here \ldots 
\begin{itemize}
\item Infected with the influenza
\item Not infected or Susceptible to the influenza
\end{itemize}

\end{frame}

\begin{frame}
What characteristics do the students have with respect to the influenza disease on campus? Or what categories might students fall into with respect to the influenza disease on campus?

\vspace*{.3 true cm}

We list them here \ldots 
\begin{itemize}
\item Infected
\item Not infected or Susceptible to the influenza
\item Immune by built up immunities from having the influenza - call them Recovered
\end{itemize}
\vspace*{.3 true cm}

Of course, we could have other categories, including initially immune to the influenza, removed by virtue of going home, super effective social distancing, etc. 
\end{frame}


\begin{frame}
\begin{itemize}
\item Infected
\item Not infected or Susceptible to the influenza
\item  Immune by built up immunities from having the influenza - call them Recovered
\end{itemize}

Through what stages do students progress with regard to the spreading influenza?

\begin{figure}
\centering
\includegraphics[width=8cm]{SIR-States.png}


\parbox{8.8 true cm}{\caption{\label{fig:SIR-States}  2. States for students with respect to influenza $S$usceptible, $I$nfected,$R$ecovered.}}

\end{figure}
\end{frame}

\begin{frame}

Through what transition do students progress with regard to the spreading influenza?
\begin{figure}
\centering
\includegraphics[width=8cm]{SIR-General.png}


\parbox{8.8 true cm}{\caption{\label{fig:SIR-General}  3. A general flow model of the spread of the epidemic from $S$usceptible, to $I$nfected, to $R$ecovered stages.}}

\end{figure}
\vspace*{.3 true cm}

At what rate would student move from one state to another, $S$usceptible to $I$nfected;  $I$nfected to $R$ecovered?

\vspace*{.3 true cm}
Ask what would cause a student to move from one stage or state to another, $S$usceptible to $I$nfected;  $I$nfected to $R$ecovered?
\end{frame}

\begin{frame}

Let us sketch  the reasons for transition for a particular student through the stages. Further, let us model just what is involved in each transition:  $S$usceptible, to $I$nfected, to $R$ecovered.

\vspace*{.3 true cm}
How about moving from $S$usceptible to $I$nfected?
\vspace*{2 true cm}

How about moving from $I$nfected to $R$ecovered?

\end{frame}


\begin{frame}
One at a time. We seek the reasons for transition for a particular student through the stages. Further, let us model just what is involved in each transition:  $S$usceptible, to $I$nfected, to $R$ecovered.

\vspace*{.5 true cm}
{\bf Main reason} for a student to move from  $S$usceptible to $I$nfected is that a student who is $S$usceptible comes in contact with a student who is  $I$nfected and somehow the influenza is transmitted, e.g., cough, shaking hands, sharing facilities.
\vspace*{.4 true cm}

So how can we express the fact that it is contact between   $S$usceptible and $I$nfected that causes the number of  $I$nfected students to go up and the number  of $S$usceptible students to go down by that same number?
\end{frame}


\begin{frame}

We want to build a mathematical model of the change in the number of  $S$usceptible and it will depend on the interactions between $S$usceptible and $I$nfected.

\vspace*{.4 true cm}

Let us define some variables:
\begin{itemize}
\item $S(t)$ is the number of  $S$usceptible at time $t$ in days;
\item $I(t)$ is the number of  $I$nfected at time $t$ in days; and 
\item $R(t)$ is the number of  $R$ecovered at time $t$ in days.
\end{itemize}
\end{frame}

\begin{frame}

So how can we express the fact that it is contact between   $S$usceptible and $I$nfected that causes the number of  $I$nfected students to go up and the number  of $S$usceptible students to go down by that same number?
\vspace*{.4 true cm}

Which one of these mathematical expressions seem reasonable or unreasonable for the rate of change in the number of $S$usceptible at time $t$ and why? Let us assume $a >0$ here.

\begin{enumerate}
\item $S'(t) = -a (S(t) + I(t))$
\item  $S'(t) = -a (S(t)\cdot I(t))$
\item $S'(t) = -a (S(t) - I(t))$
\item  $S'(t) = -S(t)\cdot I(t)$
\item  $S'(t) = -a S(t)^{I(t)}$
\end{enumerate}

\vspace*{.2 true cm}
One good way to challenge a proposed term in a model is to consider extreme cases, e.g., if $S(t) = 0$ or $I(t) = 0$. Does it make sense in those cases?  Say (5)?

\end{frame}


\begin{frame}
Of these four (Could there be more? Did we miss some you thought of?)
(2) and (4) are alike but (2) has the added  parameter $a$ which might reflect the percentage of possible interactions  between $S$usceptible, $S(t)$,  and $I$nfected, $I(t)$ which result in a transmission of the influenza. 

\vspace*{.3 true cm}
\centerline{(2)  $S'(t) = -a (S(t)\cdot I(t))$   \qquad OR   \qquad(4)  $S'(t) = -S(t)\cdot I(t)$\,.}

\vspace*{.3 true cm}
Indeed, (4) suggests that if we had 50 $S$usceptible, $S(t)$, and 24 $I$nfected, $I(t)$, the change in $S$usceptible per day, $S'(t)$, would be $50\cdot 24 = 1,200$. But, we only have 763 students! 
\vspace*{.4 true cm}



\end{frame}

\begin{frame}

Thus we could settle on (2) as a way to model the change in the $S$usceptible, $S(t)$, population of students at time $t$ for there will be no new entries to ADD and we will assume the only way a student leaves the $S$usceptible population is by becoming infected.
\vspace*{.3 true cm}

Thus this assumption precludes $S$usceptible  students from withdrawing from the school, something which might need to be revisited in our model if it were to happen.

\vspace*{.3 true cm}
\centerline{(2)  $S'(t) = -a (S(t)\cdot I(t))$\,.}

\vspace*{.3 true cm}


Thus the parameter $a$ can reflect (unknown) aspects and frequencies of interactions; maybe even reflect policy, e.g., students sharing a room vs. students in single dorm rooms or class structures involving social distancing.

\end{frame}

\begin{frame}

We return to our attempt to  sketch  the reasons for transition for a particular student through the stages. Further, let us model just what is involved in the transition from  $I$nfected to $R$ecovered.



\vspace*{.3 true cm}
{\bf Main reason} for a student to move from   $I$nfected  to  $R$ecovered is that the student has recovered from the influenza!!

\vspace*{.4 true cm}

So what is the rate at which students recover?  We might not know this?   For example, we would need to know the length of time an $I$nfected stays $I$nfected. In lieu of knowing this we might use a parameter (to be determined), say $b$. 

\end{frame}

\begin{frame}


Which one of these equations for the rate of change in  $I$nfected, $I'(t)$, would serve to model the transition from $I$nfected to $R$ecovered? Assume $b > 0$.

\begin{enumerate}
\item $I'(t) = -b I(t) R(t)$
\item  $I'(t) = -b I(t)$
\item  $I'(t) = -b (I(t)+ R(t)$
\item $I'(t) = -b R(t)^{I(t)}$
\item $I'(t) = b R(t)$\, .
\end{enumerate}

\vspace*{.3 true cm}
Hints:
\begin{enumerate}
\item What might $R$ecovered students have to do with this?
\item Movement from $I$nfected only depends upon $I$nfecteds.
\item What happens when $I(t) = 0$ and $R(t)> 0$ in this case?
\item  If $I(t) = 0$ then $I'(t) = b$ constantly.
\item With no $I$nfecteds  we are increasing $I$nfecteds due to  $R$ecovered. Really?
\end{enumerate}

\end{frame}

\begin{frame}

\begin{figure}
\centering
\includegraphics[width=8cm]{SIR-Flow.png}


\parbox{8.8 true cm}{\caption{\label{fig:SIR-Flow}  4. A specific  flow model of the spread of the epidemic from $S$usceptible, to $I$nfected, to $R$ecovered.}}

\end{figure}

From this figure we can see the system of nonlinear differential equations:

\begin{eqnarray}\label{eq:cont}  \nonumber
S'(t) &=& - a S(t) I(t)\\
I'(t) &=& a S(t) I(t) - b I(t)\\  \nonumber
R'(t) &=& b I(t).
\end{eqnarray}

\noindent where $S(t)$ is  number of students susceptible to  disease at time $t$, $I(t)$ is  number of students infected or infectious at time $t$, and $R(t)$ is  number of students who have recovered at time $t$.
\end{frame}

\begin{frame}
Here we have a model:

\begin{eqnarray*}
S'(t) &=& - a S(t) I(t)\\
I'(t) &=& a S(t) I(t) - b I(t)\\  
R'(t) &=& b I(t).
\end{eqnarray*}

\noindent and here we have data


\begin{center}

\small
\begin{tabular}{|c||c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline
\hspace*{-.2 true cm} Time (days) \hspace*{-.2 true cm} & \hspace*{-.2 true cm}  0\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  1\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  2 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 3\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  4 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 5\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  6 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 7 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 8\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  9\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  10 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 11\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  12 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 13\\ \hline
\hspace*{-.2 true cm} Sick Students \hspace*{-.2 true cm} & \hspace*{-.2 true cm}  1\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  3 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 25 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 72\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  222\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  282 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 256 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 233\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  189 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 123 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 70 \hspace*{-.2 true cm} & \hspace*{-.2 true cm} 25\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  11\hspace*{-.2 true cm} & \hspace*{-.2 true cm}  4\\ \hline
\end{tabular}
\end{center}

Can we find parameters $a$ and $b$ such that  model will fit  data?
\vspace*{.2 true cm}

What strategy would we use?
\end{frame}


\begin{frame}
In general systems of nonlinear differential equations are not solvable in closed form and so whatever we do will involve numerical solutions. 
\vspace*{.2 true cm}

But how could we solve our system without numbers for $a$ and $b$? 



\begin{eqnarray*}
S'(t) &=& - a S(t) I(t)\\
I'(t) &=& a S(t) I(t) - b I(t)\\  
R'(t) &=& b I(t).
\end{eqnarray*}

Perhaps use educated guesses for  $a$ and $b$ and trial and error.

\vspace*{.2 true cm}
OR use grid of many, many possibilities for $a$ and $b$ with some measure of how good a fit each pair of parameters offers.
\end{frame}


\begin{frame}
What criteria would we use to determine best fitting parameters  $a$ and $b$?
\vspace*{.2 true cm}

Consider the sum of square errors between what our model will predict with a given pair of $a$ and $b$  compared to our actual data and see which  $a$ and $b$ renders the least sum of square errors.

\begin{center}

\small
\begin{tabular}{|c||c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline
\hspace*{-.22 true cm} Time (days) $t_i$ \hspace*{-.22 true cm} & \hspace*{-.22 true cm}  0\hspace*{-.22 true cm} & \hspace*{-.22 true cm}  1\hspace*{-.22 true cm} & \hspace*{-.22 true cm}  2 \hspace*{-.22 true cm} & \hspace*{-.22 true cm} 3\hspace*{-.22 true cm} & \hspace*{-.22 true cm}  4 \hspace*{-.22 true cm} & \hspace*{-.22 true cm} 5\hspace*{-.22 true cm} & \hspace*{-.22 true cm}  6 \hspace*{-.22 true cm} & \hspace*{-.22 true cm} 7 \hspace*{-.22 true cm} & \hspace*{-.22 true cm} 8\hspace*{-.22 true cm} & \hspace*{-.22 true cm}  9\hspace*{-.22 true cm} & \hspace*{-.22 true cm}  10 \hspace*{-.22 true cm} & \hspace*{-.22 true cm} 11\hspace*{-.22 true cm} & \hspace*{-.22 true cm}  12 \hspace*{-.22 true cm} & \hspace*{-.22 true cm} 13\\ \hline
\hspace*{-.22 true cm} Sick Students $I_i$ \hspace*{-.22 true cm} & \hspace*{-.22 true cm}  1\hspace*{-.22 true cm} & \hspace*{-.22 true cm}  3 \hspace*{-.22 true cm} & \hspace*{-.22 true cm} 25 \hspace*{-.22 true cm} & \hspace*{-.22 true cm} 72\hspace*{-.22 true cm} & \hspace*{-.22 true cm}  222\hspace*{-.22 true cm} & \hspace*{-.22 true cm}  282 \hspace*{-.22 true cm} & \hspace*{-.22 true cm} 256 \hspace*{-.22 true cm} & \hspace*{-.22 true cm} 233\hspace*{-.22 true cm} & \hspace*{-.22 true cm}  189 \hspace*{-.22 true cm} & \hspace*{-.22 true cm} 123 \hspace*{-.22 true cm} & \hspace*{-.22 true cm} 70 \hspace*{-.22 true cm} & \hspace*{-.22 true cm} 25\hspace*{-.22 true cm} & \hspace*{-.22 true cm}  11\hspace*{-.22 true cm} & \hspace*{-.22 true cm}  4\\ \hline
\end{tabular}
\end{center}

$${\rm SSE}(a,b) = {\rm Sum}_{i=1}^{14}(I(t_i) - I_i)^2\, .$$

Here $t_i$ is the $i^{\rm th}$ observation at time $t_i$ of the  observed $I$nfected population and $I(t_i)$ will be the model value of the  $I$nfected population evaluated at time $t_i$. 
\end{frame}






\begin{frame}
The plot below shows a contour plot of some 40,000 data points $(a, b, {\rm SSE}(a,b))$  computed numerically over a grid $\{(a,b)\vert a \in [0, 0.006], b \in [0, 0.8]\}.$  
\begin{figure}
\centering
\includegraphics[width=7cm]{SIR-ParameterContourPlot.png}


\end{figure}

\end{frame}

\begin{frame}
For each of the 4,000 values of $(a,b)$ we have 
\begin{enumerate}
\item computed a numerical solution to the system of differential equations (\ref{eq:cont});  
\item computed the values for $I(t_i)$ at the 14 times $t_i$, with $i = 1, 2, \ldots 14$;  
\item computed the sum of the square errors  $SSE(a,b) = {\rm Sum}_{i=1}^{14}(I(t_i) - I_i)^2$; and 
\item  used Mathematica's ContourPlot command to sketch  the contours of ${\rm SSE}(a,b)$ over this grid. 
\end{enumerate}

\vspace*{-.3 true cm}
\begin{figure}
\centering
\includegraphics[width=2.5cm]{SIR-ParameterContourPlot.png}


\end{figure}
\vspace*{-.3 true cm}

The solid dot in the center shows the actual value for $a$ and $b$ which does minimize ${\rm SSE}(a,b)$. We shall find this using the Solver Command in the Excel spreadsheet.
\end{frame}

\begin{frame}

This plot shows the resulting best fit model plotted over the data from the contour approach above.

\vspace*{.2 true cm}
\begin{figure}
\centering
\includegraphics[width=10cm]{SIR-ModelDataPlot.png}


\parbox{8.8 true cm}{\caption{\label{fig:SIR-ModelDataPlot}  6. Plot of model compared to data using best fit parameters $a = 0.00258$ and $b = 0.484$ from contour plot of parameter space $(a, b, {\rm SSE}(a,b))$ approach.}}

\end{figure}

\end{frame}


\begin{frame}
Let's get to work to actually find  best fitting parameters $a$ and $b$.
\vspace*{.2 true cm}

The way we will proceed is to 
\begin{enumerate}
\item enter the data in an Excel spreadsheet, 
\item convert our differential equation model to a difference equation modal, 
\item solve the difference equation model numerically, 
\item form the sum of the squared errors ${\rm SSE}(a,b)$ between our 14 data points and the corresponding values of $I$nfecteds from our numerical solution, and  
\item use Excel's Solver command to ascertain the parameters $a$ and $b$ which minimize the value of ${\rm SSE}(a,b)$. 
\end{enumerate}

\end{frame}


\begin{frame}
First we convert 

\begin{eqnarray*}
S'(t) &=& - a S(t) I(t)\\
I'(t) &=& a S(t) I(t) - b I(t)\\  
R'(t) &=& b I(t)\, .
\end{eqnarray*}

\noindent into a system of difference equations:

\begin{eqnarray*}
S(n) &=& S(n - 1) - a S(n - 1) I(n - 1)\\
I(n)  &=& I(n - 1) + a S(n - 1) F(n - 1) - b I(n - 1)\\
R(n)  &=& R(n - 1) + b I(n - 1)\, .
\end{eqnarray*}
	

\end{frame}


\begin{frame}
The key identification to convert a differential equation to a difference equation is the following

\begin{eqnarray*}
S'(t) &=& \lim_{\Delta t \to 0}\frac{S(t+ \Delta t) - S(t)}{\Delta t}\\
&\approx& \frac{S(t+ 1) - S(t)}{1} = S(t+1) - S(t)\, .
\end{eqnarray*}

And after identifying $S(t)$ with $S(t_n) = S(n)$ we have for our first difference equation from our original differential equation for the $S$usceptible population:

$$S'(t) = - a S(t) I(t)$$
$$S(n) = S(n - 1) - a S(n - 1) I(n - 1) \, . $$

Our difference equation says the size of the $S$usceptible population at iteration $n$, $S(n)$,  is what it was at iteration $n-1$,  $S(n-1)$, plus the change during that iteration $- a S(n - 1) I(n - 1)$.

\end{frame}


\begin{frame}The full system of difference equations for $S$usceptible, $In$fected, and $R$ecovered now follow in the same manner.
\vspace*{-.2 true cm}
\begin{eqnarray*}
S(n) &=& S(n - 1) - a S(n - 1] I(n - 1)\\
I(n)  &=& I(n - 1) + a S(n - 1) F(n - 1) - b I(n - 1)\\
R(n)  &=& R(n - 1) + b I(n - 1)\, .
\end{eqnarray*}

We turn to spreadsheet (Excel)  discuss solutions and parameter estimations for $a$ and $b$.
\end{frame}


\begin{frame}
We turn to spreadsheet (Excel)  to discuss solutions and parameter estimations for $a$ and $b$. 

\vspace*{.2 true cm}

Excel sheets published in SIMIODE in {\bf \href{https://www.simiode.org/resources/7779/}{Supporting Docs}} in Remote Teaching Module - Modeling a Nonlethal Influenza Epidemic.




\begin{figure}
\centering
\includegraphics[width=10cm]{SIR-InfectedData}
\end{figure}
\vspace*{.2 true cm}
Describe what you see and what you believe it says about the presence of the Influenza in the school.

\end{frame}


\begin{frame}
\begin{figure}
\centering
\includegraphics[width=12cm]{SIR-FirstModelSlide}
\end{figure}



\end{frame}


\begin{frame}
\begin{figure}
\centering
\includegraphics[width=11cm]{SIR-ModelCellSteps.png}
\end{figure}

\end{frame}

\begin{frame}
Let us Go to {\bf \href{https://www.simiode.org/resources/7789/download/SIMIODE-Module-Epidemic.xlsx}{Excel Live}}  and use Solver capability to find best fitting parameters $a$ and $b$.

\vspace*{3 true cm}

\hspace*{1. true cm} Thus we have our final analysis and we turn it over to you.
\end{frame}

\begin{frame}

\centerline{\bf Assignment}

\vspace*{.3 true cm}



{\bf Activity 1.} Write an overview of the modeling process to obtain our model, parameters, and comparison with data  for the spread of nonlethal influenza, being sure to identify the variables and the units  - not all details, just highlights. Arrive at the model


\begin{eqnarray*}
S'(t) &=& - a S(t) I(t)\\
I'(t) &=& a S(t) I(t) - b I(t)\\  
R'(t) &=& b I(t)\, ,
\end{eqnarray*}

\noindent in which 
\begin{itemize}
\item $S(t)$ is the number of  $S$usceptible at time $t$ in days;
\item $I(t)$ is the number of  $I$nfected at time $t$ in days; and 
\item $Rt)$ is the number of  $R$ecovered at time $t$ in days.
\end{itemize}


\end{frame}



\begin{frame}
\vspace*{.4 true cm}

{\bf Activity 2.} Below is comparable data for an identical school with 763 students, except that this school is somewhat careless and does not encourage the students to practice good hygiene, distance themselves, and report symptoms early.

\vspace*{.2 true cm}

Perform a model analysis as we did in the original schools, obtain the model parameters and compare the results of the two schools, offering up comments on any changes in the parameters with an explanation.



\begin{center}\small
\begin{tabular}{|c||c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline
 Time (days)   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     0  \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     1  \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     2   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}    3  \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     4   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}    5  \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     6   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}    7   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}    8  \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     9  \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     10   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}    11  \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     12   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}    13\\ \hline
 Sick Students   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     1  \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     80   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}    517   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}    368  \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     229  \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     142   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}    87   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}    54  \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     33   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}    20   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}    12   \hspace*{-.2 true cm} & \hspace*{-.2 true cm}    8  \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     5  \hspace*{-.2 true cm} & \hspace*{-.2 true cm}     3\\ \hline
\end{tabular}
\vspace*{.1 true cm}


Number of Bedridden Students on Day $t$ in ``careless'' school.
\end{center}
\end{frame}


\begin{frame}
\noindent {\bf CONGRATULATIONS!!!}
\vspace*{.3 true cm}

\noindent We went from
 
\begin{itemize}
\item seeing the data, 
\item to conjecturing a system differential equations models, 
\item to realizing a differential equations model,
\item to converting to a system of difference equations model, 
\item to solving the difference equations, 
\item to estimating our parameters, 
\item to comparing our model with the actual data.
\end{itemize}
\end{frame}






\end{document}