Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well...

29
Created by Claudia Neuhauser Worksheet 1: Stochastic Processes An Introductory Example Van Bael, S. and S. Pruett-Jones. 1996. Exponential population growth on Monk Parakeets in the United States. Wilson Bulletin 108(3):584-588. Abstract: Van Bael and Pruett-Jones used records from the National Audubon Society Christmas Bird Count (CBC) during the winters from 1971-72 to 1994-95. The CBC is a citizen

Transcript of Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well...

Page 1: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Created by Claudia NeuhauserWorksheet 1: Stochastic Processes

An Introductory Example

Van Bael, S. and S. Pruett-Jones. 1996. Exponential population growth on Monk Parakeets in the United States. Wilson Bulletin 108(3):584-588.

Abstract:

Van Bael and Pruett-Jones used records from the National Audubon Society Christmas Bird Count (CBC) during the winters from 1971-72 to 1994-95. The CBC is a citizen science effort where thousands of citizens count birds in designated 15-mile diameter sample areas (http://www.audubon.org/bird/cbc/index.html). This event has taken place for over one hundred years during the winter holiday season (December 14 to January 5), and has resulted in a large amount of data.

Page 2: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

IN-CLASS ACTIVITY

The following data set from the CBC was used in Van Bael and Pruett-Jones (1996) as a proxy for population size. We will use this data set to build a model that describes the population growth of this species.

YearNumberOfMonkParakeets

PerPartyHour(effort)76 0.03077 0.03178 0.03579 0.02780 0.04181 0.04882 0.02683 0.04884 0.06485 0.08386 0.17787 0.12188 0.23489 0.20090 0.39391 0.41492 0.43693 0.38794 0.38795 0.501

(a) Graph the data in EXCEL. Set year 1976 equal to 76 on your graph. Describe the growth. (Tab “Parakeet Data”)

(b) The accompanying paper mentions “exponential population growth” in its title. How can you decide whether an exponential function is a suitable description? (We will talk more about this in the second module.)

(c) What assumptions are made to infer population size from the CBC data?

- 2 -

Page 3: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

Exponential Growth

Deterministic Models

Many species reproduce in distinct seasons. Populations of such species are then best modeled using discrete time models. In their simplest form where the population size at generation t+1, denoted by Nt+1, only depends on the population size at time t, denoted by Nt, we can model this recursively as

As the initial condition, we need to specify the population size at time 0, N0. If the population size from one generation to the next is multiplied by a constant factor, exponential growth results. The recursive equation for this type of growth is

(1)

where R is a nonnegative constant, called the growth parameter. We assume that . To use this recursion, we need to specify the population size at time 0, N0. This model can be solved explicitly, that is, we can find a function g(t) that describes the population size explicitly as a function of t. Here is how to find the function:

Thus,

(2)

is the solution of (1). It is an exponential function. Figure 1 shows the behavior of the graph of this function.

- 3 -

Page 4: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

Figure 1: Exponential growth (R=1.1) and decay (R=0.9)

Note that for , the population size is decreasing exponentially (exponential decay), whereas for , it is increasing exponentially (exponential growth). We can express the long-term behavior formally using limits. Namely,

In this model, the population size is viewed as a continuous variable. This is an approximation since a population size is measured in number of individuals, which is a discrete variable. In the model, if the initial population size is positive, the population size will remain positive for all times. As a consequence, if a population is declining in size, the population size will approach zero but never be equal to zero, and population sizes that are unrealistic, namely positive but less than one, will result. Modeling a population size with a continuous variable has the advantage that analytical tools are better developed for continuous variables than for discrete variables. Having tools for rigorous analysis allows us to go beyond simulations, which makes the results more robust.

A Very Brief Introduction to EXCEL and MATLAB

IN-CLASS ACTIVITY

EXCEL

We will use an EXCEL spreadsheet (Tab: “Logistic Growth”) to code exponential growth for and determine the population size for t=1,2,…,20 when the

- 4 -

Page 5: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

population size is 1 at time 0. Let’s take the recursive equation [Equation (1)] and the explicit function [Equation (2)] and set up a spreadsheet in the following way.

  A B C D1 Discrete Time Logistic Growth23 Parameters4 R N_05 0.5 167 Time Equation (1) Equation (2)8 0 1 19 1 0.5 0.5

10 2 0.25 0.2511 3 0.125 0.12512 4 0.0625 0.0625

In Row 5, enter the parameters. In Cell A8, enter 0; in Cell A9, enter 1. Highlight both Cells A8 and A9 and drag them

down to time 20. In Cell B8, enter “=$B$5”, in Cell B9, enter “=$A$5*B8”. Explain why. In Cell C8, enter “=$B$5*$A$5^A8”. Explain why. Drag Cell B9 down to time 20; drag C8 down to time 20. Note that the two equations

yield the same answers (which you should expect). You can now change the parameter R in cell A5 and explore the behavior.

Office 2003: Graphical explorations are very valuable and we will graph Nt as a function of t using Equations (1). To graph this, highlight the array you want to include in the graph (i.e., cells A7-A28 and B7-B28), and click on the Chart Wizard on your spreadsheet (follow instructions during lecture). Choose XY (Scatter) from the options and click on Next. The Wizard will guide you through the steps to label the graph. It is important to choose the appropriate chart type. Since this is a discrete time model, you need to plot the values at the discrete times 0,1,2,…, which you can do by choosing the appropriate Chart sub-type. Sometimes it is useful to connect the dots but you should make sure that the markers remain visible.

Office 2007: Graphical explorations are very valuable and we will graph Nt as a function of t using Equations (1). To graph this, highlight the array you want to include in the graph (i.e., cells A7-A28 and B7-B28), and click on the Insert tab. Choose Scatter in the Charts group, and click on the Scatter with only Markers option. This will plot population size as a function of time. It is important to choose the appropriate chart type. Since this is a discrete time model, you need to plot the values at the discrete times 0,1,2,…, which you can do by choosing the appropriate Chart sub-type. Sometimes it is useful to connect the dots but you should make sure that the markers remain visible. Label the graph.

- 5 -

Page 6: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

MATLAB

MATLAB is a much more sophisticated software program than EXCEL. We will use both of these programs. EXCEL is very easy to use and gives you immediate feedback. It is excellent for exploring models. However, if you work on a research project, MATLAB is typically more appropriate (unless the model is really simple).

In MATLAB, you write your programs in m-files. We’ll use exponential growth to explain how you get a program running, including creating a plot. Write the following into an m-file. Save the m-file as “expgrowth.”

%exponential growthclearr=1.5; %parameter for growthendtime=21; %end timepopsize=zeros(1,endtime); %initializing the population row vectorpopsize(1)=20; %initializing the population size at time 0 generation=0:1:endtime-1; %specifying the generation vectorfor i=1:endtime-1 popsize(i+1)=r*popsize(i); %recursive formend plot(generation, popsize,'kx')xlabel('Generation')ylabel('Population Size')title(['Exponential Growth with parameter R=', num2str(r)])

To run this in MATLAB, you need to go to the Command Window and type the file name, i.e., expgrowth. This will generate a graph. Make sure that MATLAB looks for the file in the appropriate directory. You might need to change the directory. The command for changing directories is cd(‘directory name’)

Stochastic Models

Stochastic or random processes are ubiquitous in biology. Yet, stochasticity is rarely included in models of population or community dynamics. The theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic processes. Simulations can help a great deal to get a better sense of the effects of stochasticity. Let’s again look at the simplest population growth model, exponential growth in discrete time:

The parameter R, which is assumed to be positive, is the growth parameter. We investigated the behavior of this model and found that the solution is

- 6 -

Page 7: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

We can define a critical value where the behavior changes, namely . For , the population goes extinct, whereas for , the population will grow indefinitely provided . We assumed in this model that the parameter R is the same in each generation. This, of course, need not be. There are many factors that may change the parameter R from time step to time step. In Figure 2, we compare deterministic exponential growth and stochastic exponential growth. In this figure, we set R=1.05 in the deterministic case and let R vary randomly between 0.85 and 1.25 (i.e., ) in the stochastic case (we will give a precise definition below of “vary randomly”). Figure 2 shows a single realization of this stochastic process and compares it to a deterministic process with the same value of R.

Figure 2: Stochastic and deterministic exponential growth.

The simulation of the exponential growth was done in EXCEL. EXCEL has a random number generator that generates pseudo-random variables that are uniformly distributed in the interval (0,1). The function is RAND() and when entered this way into a cell will generate a pseudo-random number. Since this is a function you need to type ‘=RAND()’ into the cell (without the quotation marks). Try it! Use the F9 key to get a different realization. To get an idea of how a population behaves in a random environment, we need to repeat this simulation many times. This is better done in MATLAB.

Before we can code up exponential growth in a random environment in either EXCEL or MATLAB, we need to develop the theory further. We will begin our discussion with defining the uniform distribution and then explain how a computer can generate random numbers that follow this distribution. We will then introduce a number of other distributions and explain how to simulate these.

The Uniform Distribution

- 7 -

Page 8: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

A random variable X is uniformly distributed over the interval (a,b) if the probability that the random variable falls into a subinterval of a given length that is contained in (a,b) is proportional to the length of the subinterval.

Figure 3: The uniform distribution over the interval (a,b).

Another way to describe this distribution is to use the distribution function. A distribution function of a random variable X is defined as . A distribution function is a nondecreasing function between 0 and 1. It has the property

and

If X is uniformly distributed over the interval (0,1), then the distribution function is given by

Figure 4: The distribution function of a uniform distribution.

The distribution function of this random variable is a continuous function (Figure 4). We therefore call the random variable a continuous random variable. We can use the distribution function to compute probabilities, such as . Namely,

The uniform distribution can also be described by a density function. A density function is defined as

and has the properties

- 8 -

a b c d

x1

1

0

Page 9: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

It follows from the fundamental theorem of calculus that where is

differentiable. Therefore, the density function of a uniformly distributed random variable over the interval (0,1) is given by

Task 1

The density function of a uniformly distributed random variable over the interval (a,b), , is given by

Find the distribution function and verify that , provided .

Below, we will need the expectation of a random variable. The expected value of a random variable X that is distributed according to a probability distribution with density

is given by

if the integral is defined.

Example: Find the expected value of a uniformly distributed random variable over the interval with .

- 9 -

Page 10: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

Solution: Using the definition and the result of Task 1, we need to evaluate

We find that the expected value of X is the midpoint of the interval .

To define the expected value of a function of a random variable, let X be a random variable that is distributed according to a probability distribution with density and let be a function. Then

if the integral is defined.

Task 2

Let X be a uniformly distributed random variable on the interval (a,b), , with density function

(a) Find for general values of a and b. (b) Find for general values of a and b. (c) Compare your results in (a) and (b) for a=1 and b=2.

Random Number Generator

Generating pseudo-random numbers on a computer is surprisingly simple. Here is an algorithm that generates pseudo-random variables that are uniformly distributed over (0,1). We define three numbers, a, c, and m, and a positive number, called seed, . The following algorithm defines a sequence of numbers that generates both a new seed and the pseudo-random number:

(3)

Here is an example with and :

- 10 -

Page 11: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

The new seed is and the pseudo-random variable is .

The numbers that are generated this way are not truly random. In fact, with , there are at most 6075 different seeds this algorithm can produce, namely all the integers between 0 and 6074. Once the algorithm produces an integer that has already come up, the pseudo-random numbers will repeat the previous numbers. The shorter the cycle length, the worse the algorithm. In fact, the algorithm we gave above is a really bad random number generator since its cycle length is quite short, less than .

There are tables that list combinations of numbers for a, c, and m that produce better sequences of pseudo-random numbers. There are also more sophisticated algorithms. Researchers have developed criteria to check whether a random number generator is “good.”

IN-CLASS ACTIVITY

Set up a spreadsheet (Tabb: “Random Number Generator”) to generate 10 pseudo-random variables using the algorithm provided in Equation (3) with

and .

  A B C D E12 a c m I_03 106 1283 6075 456745 j aI_j+c seed random number6     4567 7 0 485385 5460 0.8987654328 1     9 2     

10 3     11 4     12 5     13 6     14 7     15 8     16 9     17 10     

Cell C7: =($B$3*D6+$C$3)Cell D7: =MOD(C7,$D$3)Cell E7: =D7/$D$3

EXCEL can produce pseudo-random numbers as well. The random number generator in EXCEL can be called using the command RAND(). It is known to be a bad random

- 11 -

Page 12: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

number generator since it has a short cycle length. Even though the random number generator in EXCEL should never be used for scientific research, it is good enough for educational purposes to illustrate effects of stochasticity, provided not too many pseudo-random variables are called. If you enter “=RAND()” into a cell in an EXCEL spreadsheet and hit Enter, you will see a number between 0 and 1 appearing in the cell. Every time you hit the F9 key, EXCEL will generate a new pseudo-random number. Try it!

Generating Other Random Variables

Discussion1: Suppose you wanted to generate pseudo-random variables that come from a generator that generates uniform random variables over the interval (0,1). How would you proceed?

We wish to generalize this approach to arbitrary continuous distributions. The following result will help us (Figure 5).

Theorem. If X is distributed according to a distribution given by the distribution function , then is uniformly distributed over the interval (0,1).

Proof. The proof is very short: For ,

.

How do we use this theorem? We generate a random variable that is uniformly distributed over (0,1). Call this random variable U. We next compute the inverse function of , denoted by . The random variable we seek is then .

Figure 5: Finding random variables with arbitrary, continuous distribution functions.

Example: Suppose a random number generator that generates uniformly distributed pseudo-random numbers in the interval between (0,1) generated the following two pseudo-random variables: 0.3858 and 0.8627. Use these two pseudo-random variables to generate uniformly distributed pseudo-random variables in the interval (0,2).

1 You would generate a uniform random variable in (0,1) and then multiply the outcome by 2.

- 12 -

F(x)

x

U

X

Page 13: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

Solution: Informally, we already know that we need to multiply each of the pseudorandom variables by 2 since we “stretch” the interval (0,1) by 2 to get a uniform distribution on (0,2). But let’s see how we would proceed more formally. The distribution

function of a uniform random variable in the interval (0,2) is given by for

. To invert the distribution function, we compute

which means that (after interchanging the roles of x and y). Hence, we find

The Bernoulli Distribution

The Bernoulli distribution is a discrete distribution. We say that a random variable X is Bernoulli distributed with parameter p if X takes on two values, 0 and 1, with probabilities p and 1-p, respectively. That is,

We can use a random number generator to generate Bernoulli distributed random variables as follows. Let U denote the random variable that is uniform on (0,1) and by X the Bernoulli random variable with parameter p. Generate a uniform random variable and assume that the outcome is u. If u is between 0 and p, then assign the value 1 to X, otherwise, assign the value 0.

IN-CLASS ACTIVITY

We will use the random number generator RAND() in EXCEL to generate Bernoulli pseudo-random variables with parameter . Suppose the parameter p is stored in the cell C3, then the command “=IF(RAND()<$C$3,1,0)” will produce a Bernoulli random variable with that parameter p. Set up a spreadsheet (Tab: “Bernoulli”) to produce 10 Bernoulli pseudo-random variables.The Binomial Distribution

The binomial distribution is a discrete distribution. We say that a random variable X is binomially distributed with parameters p and n if X takes on value k, where k takes on values 0,1,2,…,n, with probability

- 13 -

Page 14: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

A binomial distribution models the number of successes in n trials where each trial is a Bernoulli experiment with success probability p.

Exponential Growth in a Temporally Varying Environment

We now return to exponential growth in a temporally varying environment. We define the population size at generation t as , and set

(4)

We assume now that the growth parameter may vary from generation to generation. Iterating Equation (4), we find

(5)

If we set

we can write Equation (5) as . The new parameter is called the geometric mean of the numbers . Whether or not the population will grow thus depends on the geometric mean of the growth parameters that define the growth in each generation.

Geometric and Arithmetic Averages

You might be more familiar with arithmetic averages. If you have a series of positive numbers, , then the arithmetic average is given by

The geometric average of the same set of numbers is given by

Below, we will show that , that is, the geometric average is at most as large as the arithmetic average. But first an example that illustrates this:

- 14 -

Page 15: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

Example: Find the arithmetic and the geometric average of the ten integers, 1,2,…,10.

Solution: We find

illustrating that the geometric average is less than the arithmetic average.

To show that arithmetic averages exceed geometric averages, we need the following inequality (which is a special case of Jensen’s inequality),

(6)

provided . This follows from the fact that is concave down.

Figure 6: Jensen’s inequality when n=2.

If we exponentiate both sides of Inequality (6) and then simplify, we find

Back to Exponential Growth

The fact that the geometric average is at most as large as the arithmetic average has important implications for population growth. When a population is followed for several

- 15 -

x1 (x1+x2)/2 x2

y=f(x)

[f(x1)+f(x2)]/2

f[(x1+x2)/2]

Page 16: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

generations to determine the long-term behavior, it is important to compute the geometric average as this is the average that determines whether the population will grow or decline. Computing the arithmetic average overestimates the long-term growth parameter (and is meaningless). To gain a better understanding of how to determine long-term behavior, note that

(7)

The long-term growth is determined by the arithmetic average of the logarithms of the growth parameters . Note that

If you have had a course in statistics, you have likely heard about the Law of Large Numbers. The Law of Large Numbers can be used to say more about this stochastic model. Namely, it says that if has finite expectations, then

(8)

This allows us to predict the behavior of the stochastic model, similar to the deterministic model.

IN-CLASS ACTIVITY

Generate 200 iid U(0,1) random variables

Computer the arithmetic averages for :

Plot the arithmetic averages as a function of n

A Random Walk View of Growth in Temporally Varying Environments

We described population growth in a temporally varying environment by Equation (5)

If we take natural logarithms on both sides and use repeatedly, we find

- 16 -

Page 17: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

In this formulation, is a random walk. That is, it is a sum of independent and identically distributed random variables. The theory of random walk is very well developed and we can quote results to understand the behavior.

The result that is most relevant to us is that if the expected value of the increments is greater than 0, the random walk will go off to with probability 1; if the expected value of the increments is less than 0, the random walk will go off to with probability 1. If we apply this to our population growth model, we find that with probability 1,

Translating this into results for the population size , we find that with probability 1,

It is important to remember that . This is Jensen’s Inequality and implies that the arithmetic average of the growth parameters could be positive and the population could still go extinct since the average of the logarithm of the growth parameters counts.

Note that we did not say anything about the behavior of this model when . In this case, the process is called a one dimensional, symmetric random walk. Figure 7 shows a one-dimensional, symmetric random walk where at each time step, with probability 0.5 the random walker goes up one unit or down one unit. We highlighted a few paths. This is a case where the mean displacement is 0.

The figure was generated using the following MATLAB script:

%Random Walk RW.mclear%size=input('Time:');size=1000;time=0:1:size-1; %specifying the generation vectorrep=100;A=-3+2*unidrnd(2,rep,size);B=cumsum(A,2);plot(time, B,'-k.','MarkerSize',1)

- 17 -

Page 18: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

0 100 200 300 400 500 600 700 800 900 1000-80

-60

-40

-20

0

20

40

60

80

100Random Walk

Time

Figure 7: One hundred realizations of a symmetric random walk starting at the origin as a function of time

- 18 -

Page 19: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

Homework (HAND IN ON __________________________)

Make sure you save your work frequently. Each step will give explicit instructions on what to hand in. Most of the time, you will need to copy a table or graph together with relevant EXCEL spreadsheet cells into a WORD file.

Hand in Tasks 1 (page 9) and 2 (page 10)

Step 1

Simulate for , when is uniformly distributed over the interval . Compute both the arithmetic and the geometric averages of the growth parameters. (Use Equation (7) to compute the geometric mean.) Note that EXCEL has a function that computes averages: If numbers are stored in cells A1 to A6, for instance, then the average of these numbers can be computed using “=AVERAGE(A1:A6)” Set up the spreadsheet as follows:

Row 5 has the parameters R and a, and the initial population size .

C9: =D5D9: =C10/C9E9: =LN(D9)C10: =C9*(2*$C$5*RAND()+$B$5-$C$5)D10: =C11/C10E10: =LN(D10)

- 19 -

  A B C D E1234 R a N_05 1.05 0.5 1678 Time stochastic R_t ln R_t9 0 1 1.363059 0.309732

10 1 1.363059 0.816726 -0.2024511 2 1.113246 1.280248 0.24705312 3 1.425231 1.522973 0.42066413 4     14 5     15 6     16 7     17 8     

Page 20: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

To explain cell C10, note that we first need to find the distribution function of the uniform distribution on the interval , then invert the distribution function and use the Theorem on page 10. Assume now that X is uniformly distributed on

. The density function of this distribution is for

, and equal to 0 otherwise. Hence the distribution function is

For , . Hence,

We thus see that if Y is uniformly distributed on (0,1), then is uniformly distributed on . This is what we entered in cell C10.

(a) Set , , and . Compare the result to deterministic exponential growth with parameter . Produce a graph like the one in Figure 2 and copy the graph into a WORD file. If you hit the F9 key on your keyboard, you can look at different realizations.

(b) Change the parameters to and , and vary a between 0 and 0.5. Explain in words what you see.

(c) Change the parameters to and , and vary a between 0 and 0.5. Explain in words what you see. Compare your results in (b) and (c).

Step 2

To model discrete population sizes, you can, for instance, round down numbers to the nearest integer. EXCEL provides such a function: INT( ): If you enter into a cell “=INT(20.9),” EXCEL will respond with “20.” To begin your explorations, repeat Step 1 for a discrete population size. Explore one aspect of this model further, for instance, you could vary the initial population size for different growth parameters or vary the amount of stochasticity by changing the parameter a. What are the main differences? Are there

- 20 -

Page 21: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

cases where the discrete population size and the continuous population size models are similar? When are they different? Include relevant graphs into your WORD file to explain your observations.

Homework (HAND IN ON ___________________)

Step 3

(a) Use an EXCEL spreadsheet to simulate population growth in a randomly varying environment according to

where the growth parameters are independent and identically distributed according to a uniform distribution on with . Explain how you coded this up. (b) Choose values for a and b such that the population size grows without bounds and another set of values of a and b such that the population goes extinct. Provide graphs for each case

where you plot the population size as a function of time. (c) Recall . Plot

as a function of t for a=1.0 and b=2.0. In light of Equation (8), what do you expect

the graph to look like for large values of t? (d) Find for a=1.0 and b=2.0 and compare your answer with what you found in (c).

Step 4

Assume that a population grows in a randomly varying environment according to

where the growth parameters are independent and identically distributed according to a uniform distribution on with . Set and . (a) Find . (b) Find . (c) Set . Determine the critical value of R, denoted by , so that if , the population grows without bounds, whereas if , the population goes extinct. (Hint: Find an equation for . You will not be able to algebraically solve the equation. Resort to some numerical way of finding a value for .) (d) Use the EXCEL spreadsheet you developed in Step 3 to explore how easy it would have been to find the critical value using simulations alone. Report your findings.

Step 5

Writing Assignment:(1) Summarize the main points of this module in bullet points.

- 21 -

Page 22: Stochastic Processes - BioQUEST€¦  · Web viewThe theory of stochastic processes is quite well developed but is in general not as straightforward as the analysis of deterministic

Worksheet 1: Stochastic Processes

(2) “Focused freewriting” means you put your pen to paper for a fixed number of minutes and write nonstop for this period of time. Don’t worry about sentence structure, grammar, spelling, or appearance. If you get stuck, keep writing about what comes to your mind, even if it is just “I am stuck, I am stuck,…” Use focused freewriting for five minutes to reflect on what you found most surprising or puzzling in this module.

(3) Use your focused freewriting exercise to come up with a question about this module.

- 22 -