% SIMIODETemplate-TeacherORStudent.tex and simiode.cls for LaTeX2e
% Version 29 July 2015.
% 
% This class (simiode.cls) is a modification of that used by 
% the journal PRIMUS - Problems, Resources, and Issues in 
% Mathematics Undergraduate Studies. 
% 
% See http://www.tandfonline.com/loi/upri .
% 
% The class was developed by  Marc Frantz with suggestions of the 
% PRIMUS Editorial Board, especially John Thoo.
%
% This template is to be used with the  class file "simiode.cls". 
%  
% The latest version of this class and template files 
% can be found at
% 
%       <http://www.SIMIODE.org> in the Author section.
%
% A "Quick Start Guide" appears below.
%
% This file must be processed with version LaTeX2e or higher.
%
\documentclass{simiode}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% With this version of the tex file and the associated SIMIODE.cls file you can produce BOTH a Student Version and a Teacher Version of your modeling scenario or technique narrative.
%
% Basically the Student Version contains the title STUDENT VERSION along with the NAME OF SCENARIO, with no abstract, no keywords, no tags, no author identifiers, and no COMMENTS section. The Student Version contains only the STATEMENT of the modeling scenario with appropriate figures, data, instructions, and perhaps a bibliography appropriate for student resourcing, but nothing in the bibliography which would "give away" the nature of the modeling scenario, etc.
%
%The Teacher Version contains the material in the Student Version, namely the title NAME OF SCENARIO, now headed with   TEACHER VERSION, but also full author  identification, abstract, key words, tag words, and, following the STATEMENT, a section of COMMENTS which can be discussion of presentation  ideas, "solutions," techniques, etc.
%
% Authors can prepare a full Teacher Version using the notions immediately below  to create a pdf for review (but in review please eliminate all information about the author as we use a double-blind referee system. Such information will be restored when accepted and published in SIMIODE at www.simiode.org.
%
%***********   Toggle the following line to turn the teacher version on (1) or off (0). ***********
%
%
\def\TeacherEdition{0} % Toggle this line's value.
\newcommand{\teacher}[1]{\ifnum\TeacherEdition=1 #1 \fi}
%
%
% The \teacher{ } command wraps any text that will appear only in the teacher version of
% the document. See this file for examples. This has been done for you in the document below.   
% Rename the pdf after you compile each final version.
% This option was created  by Eric Sullivan, Carroll College, Helena MT.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{amsmath,amssymb}
\usepackage{color}
\usepackage{graphicx}
%\usepackage{hyperref}
\usepackage{url}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NOTE regarding double spacing %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Manuscripts should be submitted doubled spaced.  This is 
% accomplished via the \baselinestretch command below.
% However, you may obtain an idea of how your article will 
% look in final form, so that you can better plan your 
% presentation.  To see your manuscript formatted very 
% similarly to the on-line published format of  SIMIODE, 
% comment the following line out by inserting a percent sign % (%) at its beginning.

\renewcommand{\baselinestretch}{1.3}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NOTE regarding macros %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Any macros defined for your paper should be contained in 
% the top matter. Likewise, any environment definitions such 
% as \newtheorem or \newenvironment should also go in the 
% top matter. 
% 
% Do not \input your macros as separate files within your 
% final version because more files make it harder for the 
% editors and users to keep track of and/or modify and 
% append your paper.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Top matter is above and 
% the beginning of the document below.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\newpage
% You only need to change the NAME OF SCENARIO in the next line and delete the footnote. See above for instructions on toggling from Teacher Version to Student Version.
\title{\ifnum\TeacherEdition=1 TEACHER VERSION  \else STUDENT VERSION \fi\\STOCHASTIC POPULATION MODEL}



\teacher{
    \keywords{stochastic, population, differential equation, first order, probability}

\tagwords{mean, variance, deterministic, model}
}


\markboth{Stochastic Population Models}{Stochastic Population Models}






\author{Daniel E.~Flath\\
Macalester College\\
St.~Paul MN 55105 USA\\
flath@macalester.edu
}

\makeStitlePDFLaTex



\begin{abstract}
We offer students the opportunity to develop several strategies for creating a population model using some simple probabilistic assumptions. These assumptions lead to a system of differential equations for the probability that a system is in state (or population size) $n$ at time $t$.  We go further and compare the mean  population levels to the deterministic models from direct differential equations development.
\end{abstract}


\section*{SCENARIO DESCRIPTION}

We will develop stochastic or probabilistic models; for the probability that a population is size $N$ at time $t$.  In actual populations there is a random component to the growth that may not
be captured in simpler differential equations models.  We examine this approach  in a straightforward    way.

 We are going to describe the population by an infinite  sequence of functions:

\begin{equation}\label{eq:seq}
P_0(t), P_1(t), \ldots,  P_N(t), \ldots \,  . 
\end{equation}

\begin{itemize}
\item  Here, $P_N(t)$ is the
probability that at time $t$ the population size is $N$.  
\item At a given time $t$ we
have a probability distribution:  $0\le P_N(t)\le 1$ for  $N = 0, 1, 2, \ldots $, and $\sum_{j=0}^\infty  P_j(t)
= 1$. 
\item As time $t$ moves forward the probability distribution evolves.  If the
population is probabilistically growing, the bulk of the probabilities is moving to $P_N(t)$
for larger and larger $N$.
\end{itemize}

\subsection*{Assumptions}

\begin{enumerate}
\item  We are going to allow births, but not deaths just to make our modeling simpler.
\item During  a very short time  interval the only two possibilities for
the population are to  (1) remain constant or (2) go up by 1 (single birth).  This 
assumption does not apply for long time intervals.  
\item There is a positive
constant $r$ (a birth rate) such that for very short time intervals $\Delta
t$ in a population of size $N$ the probabilities of population growth are given approximately as follows:
\begin{eqnarray*} \hbox{Prob}(\hbox{1 birth}) &\approx&
rN(\Delta t)\\
\hbox{Prob}(\hbox{0 births}) &\approx& 1- rN(\Delta t)
\end{eqnarray*}
So for short time periods the probability of a birth is proportional to the time
elapsed and the size of the population (number of possible parents).  You can think of $N\Delta t$ as having units of  ``man-hours"  (or perhaps more appropriately "woman-hours").  

\end{enumerate}


\subsection*{The dynamical system}

We develop the differential equation models for each probability distribution $P_N(t)$': 
\begin{eqnarray*}P_N(t+\Delta t) &=&
P_{N-1}(t)\times \hbox{Prob}(\hbox{1 birth between $t$ and $t+\Delta t$})\\
&&  \quad +
P_N(t) \times
\hbox{Prob}(\hbox{0 births between $t$ and $t+\Delta t$})\\
 &=& r(N-1)\Delta t P_{N-1}(t) + (1-rN\Delta
t)P_N(t)
\end{eqnarray*}
Thus $$ \frac{P_N(t+\Delta t)-P_N(t)}{\Delta t}=r(N-1) P_{N-1}(t)
-rNP_N(t)$$ and in the limit $$   \frac{dP_N(t)}{dt} = r(N-1)
P_{N-1}(t) -rNP_N(t)\, .$$ 


We also have initial conditions corresponding to a definite starting population of $N_0$:
$$P_0(0) = \cdots = P_{N_0-1}(0)= 0;\quad P_{N_0}(0)= 1;\quad  P_{N_0+1}(0)= \cdots = 0.$$

One can think of this as a compartment model, where the bins correspond to
possible populations with  probability flows from one bin to the next.

\section*{ACTIVITIES}

\subsection*{Activity 1 - Model Building}

\begin{itemize}
\item [a)]  What is the difference equation (and limiting differential equation) for $P_0(t)$? 
\item [b)]  Solve the differential equation in (a) for $P_0(t)$ .
\item [c)] Use the differential equation for $P_0(t)$ in the differential equation you can obtain for $P_1(t)$ and solve for $P_1(t)$.
\item [d)] Continue to develop the solutions for $P_2(t)$, $P_3(t), \ldots ,  P_N(t)$ in the same way.
\item [e)] Confirm the solutions for  $P_N(t)$, $N = 0, 1, 2, \ldots $ satisfy the differential equations in which they appear.
\end{itemize}


\subsection*{Activity 2 - Expected Value}
Since the model is stochastic, we can not give the future population precisely.  We can give statistics on the future population. For instance, we can compute the mean or average population size at time $t$.  To do this we use the notion of {\it expected value\/} defined below.


The {\it expected value} of population $N(t)$ at time $t$ with initial population $N(0)= N_0$ is, 
\begin{equation}\label{eq:EV}
E(N(t))= \sum_{n=0}^\infty n\cdot P_n(t)\, ,
\end{equation}

\begin{itemize}
\item [a)]   Determine $E(N(t))$. Hint:  First develop a differential equation  for $E(N(t))$.  (Alternatively, use the explicit formulas for $P_n(t)$ found in Activity 1.)
\item [b)]  How does the average population at time $t$ compare to the results we would obtain from a deterministic model in which we posit that $N'(t) = r N(t)$ with initial condition $N(0) = N_0$?
\end{itemize}

\subsection*{Activity 3 - Variance}
With more work you can find the variance: 
$$\hbox{Var}(N(t)) = E( (N(t)-E(N(t))^2) = N_0(1-e^{-r t})e^{2 r t}.$$
Standard deviation increases with time, so future predictions are
made with less and less certainty.



\teacher{
\section*{NOTES FOR TEACHERS}

This project, as does any stochastic endeavor, offers good prospects for computer simulations using random number generator features of software and numerical efforts to approximate activities.

A good question is, ``What if you want to use the model, but are uncertain about
the initial population?''  How sensitive to deviations in initial values are the models?

What if you allows deaths as well as births? In general, how might we enhance our stochastic model to incorporate more and more realistic features, e.g.. how could we  make a logistic stochastic model?



For Activity 1 we expect students will develop:


\begin{eqnarray*}\label{eq:many}
P_0(t) &=& \cdots = P_{N-1}(t)= 0\, ,\\
P_{N}(t) &=&
e^{-r N t}\, ;\\
P_{N+1}(t)&=& N e^{-r N t}(1-e^{-r t})\, .
\end{eqnarray*}



We show the computations for Activity 2 - Expected Value.  Use the dynamical system solutions in Activity 1 to find a differential equation for the expected value; then solve it.  This yields the exponential equation $E(N(t)) = N_0 e^{r t}$. For consider the following computations. These lead to a differential equations for $E(N(t))$ with initial condition $E(N(0)) = N_0$.
\begin{eqnarray*} 
\frac{d}{dt}E(N(t)) &=&  \sum_{n=0}^\infty n\frac{d}{dt} P_n(t) \\
&=& \sum_{n=0}^\infty n   r(n-1)
P_{n-1}(t) -\sum_{n=0}^\infty n r n P_n(t)\\ 
&=& \sum_{n=0}^\infty r n P_n(t)\\
&=& E(N(t))\\
E(N(0)) &=& N_0\, .
\end{eqnarray*}



\subsection*{Resource}

An exceptional text (a bible) for building stochastic models in biology is \cite{GoelDyn1974} wherein many models, single and multiple population and chemical reaction, for example, are studied. As much as possible the approach is to get closed forms for functions of the kind $P_n(t)$ and certainly for the mean and variance, often through the use of generating functions. The last resort approach of steady  state analysis where $\lim_{t\to \infty}P_n(t) = p_n$, is also presented for really difficult models.

Both \cite{McCarthy2016} and \cite{Winkel2015} offer more analyses of birth and death stochastic processes.

\begin{thebibliography}{99}


\bibitem{McCarthy2016} McCarthy, C. 2016. Stochastic Birth/Death/Immigration Processes. \url{https://www.simiode.org/resources/pgf}. Accessed 6 September 2016.

\bibitem{GoelDyn1974} Goel, N.~S. and N. Richter-Dyn. 1974. {\it Stochastic Models in Biology\/}. New York:  Academic Press.

\bibitem{Winkel2015} Winkel, B. 2015. Stochastic Processes. \url{https://www.simiode.org/resources/1899/download/1-27-T-StochasticProcesses-TeacherVersion.pdf}. Accessed 6 September 2016.
\end{thebibliography}
}


\end{document}
