Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computational Biology, Part 14 Recursion Relations Robert F. Murphy Copyright  1996, 1999, 2000, 2001. All rights reserved.

Similar presentations


Presentation on theme: "Computational Biology, Part 14 Recursion Relations Robert F. Murphy Copyright  1996, 1999, 2000, 2001. All rights reserved."— Presentation transcript:

1 Computational Biology, Part 14 Recursion Relations Robert F. Murphy Copyright  1996, 1999, 2000, 2001. All rights reserved.

2 Illustration from Population Dynamics (after Segel) Consider a species of insect that hatches in the spring, lays eggs in the fall and dies in the winter. Consider a species of insect that hatches in the spring, lays eggs in the fall and dies in the winter. Let N i be the number of insects in year i. Let N i be the number of insects in year i. It is safe to say that the number of insects in a generation will be a function of the number in the previous generation, that is, N i+1 = f(N i ). It is safe to say that the number of insects in a generation will be a function of the number in the previous generation, that is, N i+1 = f(N i ).

3 A recursion relation This type of equation, N i+1 = f(N i ), is called a recursion relation. Given N 0 and f we can determine all values of N. This type of equation, N i+1 = f(N i ), is called a recursion relation. Given N 0 and f we can determine all values of N. In the simplest case, consider the birthrate to be constant. Let R be the ratio of the birthrate in the next generation to the birthrate in the current generation. In the simplest case, consider the birthrate to be constant. Let R be the ratio of the birthrate in the next generation to the birthrate in the current generation.

4 The simplest case Then f(N i ) = RN i. Then f(N i ) = RN i. Quite naturally, the behavior of N i depends on R. Quite naturally, the behavior of N i depends on R.  R<1  N i  ?

5 The simplest case Then f(N i ) = RN i. Then f(N i ) = RN i. Quite naturally, the behavior of N i depends on R. Quite naturally, the behavior of N i depends on R.  R<1  N i  0  R=1  N i  ?

6 The simplest case Then f(N i ) = RN i. Then f(N i ) = RN i. Quite naturally, the behavior of N i depends on R. Quite naturally, the behavior of N i depends on R.  R<1  N i  0  R=1  N i  N 0  R>1  N i  ?

7 The simplest case Then f(N i ) = RN i. Then f(N i ) = RN i. Quite naturally, the behavior of N i depends on R. Quite naturally, the behavior of N i depends on R.  R<1  N i  0  R=1  N i  N 0  R>1  N i  

8 A better estimate Unlimited growth is unrealistic; eventually something (e.g., food supply) will limit growth. Unlimited growth is unrealistic; eventually something (e.g., food supply) will limit growth. Assume R changes with N i. Assume it decreases linearly as N i increases Assume R changes with N i. Assume it decreases linearly as N i increases  R(N i ) = r[1-N i /K] with r,K > 0 Then Then  N i+1 = rN i [1-N i /K]

9 Changing variables N i+1 = rN i [1-N i /K] implies that when N i =K, the birthrate is zero. When N i >K, the birthrate is negative. Since a negative birthrate is meaningless, we can only interpret results when N i K, the birthrate is negative. Since a negative birthrate is meaningless, we can only interpret results when N i <=K. To simplify, let x i =N i /K. Then To simplify, let x i =N i /K. Then  x i+1 = r x i (1-x i )

10 Interactive demonstration (Demonstration D6) (Demonstration D6)

11 Parameter line From our modeling, we conclude that the system shows qualitatively different behavior for different parameter (r) values. From our modeling, we conclude that the system shows qualitatively different behavior for different parameter (r) values. We can construct a parameter line to illustrate this. We can construct a parameter line to illustrate this. 0123r monotonic oscillatory unstable oscillatory

12 Parameter line We can construct this line by hand (by exploring the behavior of the system using the spreadsheet) or we can try to automate the construction of the line. We can construct this line by hand (by exploring the behavior of the system using the spreadsheet) or we can try to automate the construction of the line. To do so we can try to find the “final” or steady state value of the system for various values of r. To do so we can try to find the “final” or steady state value of the system for various values of r.

13 Finding steady states The spreadsheet we have looked at uses a row for each generation of insects. We don’t necessarily know how many generations are required to reach a steady state. One solution is to expand the sheet to include “many” cells and assume that if there is a steady state it will be reached. The spreadsheet we have looked at uses a row for each generation of insects. We don’t necessarily know how many generations are required to reach a steady state. One solution is to expand the sheet to include “many” cells and assume that if there is a steady state it will be reached.

14 Finding steady states using circular references Another solution is to use a single cell and a circular reference Another solution is to use a single cell and a circular reference In this case, how do we initialize the system (to something other than zero)? In this case, how do we initialize the system (to something other than zero)? We can use a flag to trigger initialization and an IF function to check the flag We can use a flag to trigger initialization and an IF function to check the flag

15 Initializing using a flag and an IF function We choose a cell (e.g., A2) to show whether we want the system to be initialized or allowed to iterate to a possible steady state We choose a cell (e.g., A2) to show whether we want the system to be initialized or allowed to iterate to a possible steady state We choose a cell (e.g., B2) to contain the initial value desired We choose a cell (e.g., B2) to contain the initial value desired

16 Initializing using a flag and an IF function We choose a cell (e.g., C2) to hold the value of the system and enter an IF function along with the system formula (e.g., x i+1 =(x i +3)/2). For example, We choose a cell (e.g., C2) to hold the value of the system and enter an IF function along with the system formula (e.g., x i+1 =(x i +3)/2). For example,IF(A2=0,B2,(C2+3)/2)

17 Initializing using a flag and an IF function To allow the system to be evaluated, set the flag to zero, then set it to something non-zero To allow the system to be evaluated, set the flag to zero, then set it to something non-zero Note that this must be done each time reevaluation is desired, i.e. to see the effect of changing the initial value Note that this must be done each time reevaluation is desired, i.e. to see the effect of changing the initial value

18 Interactive demonstration Modify Demonstration D6 to use a single row of cells to calculate the “final” value of x i for each value of r (use a flag to initialize) Modify Demonstration D6 to use a single row of cells to calculate the “final” value of x i for each value of r (use a flag to initialize) Modify further to use two rows to calculate the “final” values starting from two initial values (e.g., starting from generation 1 and from generation 2) Modify further to use two rows to calculate the “final” values starting from two initial values (e.g., starting from generation 1 and from generation 2)

19 Interactive demonstration Calculate the difference to see if “final” value is stable and show qualitative conclusion for each value of r Calculate the difference to see if “final” value is stable and show qualitative conclusion for each value of r

20 Steady-state solutions We conclude for certain values of r that the final value of x i seems to vary with r. What determines the final value? We conclude for certain values of r that the final value of x i seems to vary with r. What determines the final value? We can solve the recursion relation for a steady-state value. To do so, we look for values of x i for which x i+1 is the same, i.e., x i = x i+1 = x i r(1- x i ) We can solve the recursion relation for a steady-state value. To do so, we look for values of x i for which x i+1 is the same, i.e., x i = x i+1 = x i r(1- x i )

21 Steady-state solutions There are two solutions to the equation x i = x i r(1- x i ) There are two solutions to the equation x i = x i r(1- x i ) (1) ? (1) ?

22 Steady-state solutions There are two solutions to the equation x i = x i r(1- x i ) There are two solutions to the equation x i = x i r(1- x i ) (1) x i = 0 (1) x i = 0 and and (2) ? (2) ?

23 Steady-state solutions There are two solutions to the equation x i = x i r(1- x i ) There are two solutions to the equation x i = x i r(1- x i ) (1) x i = 0 (1) x i = 0 and and (2) x i = 1 - 1/r (2) x i = 1 - 1/r

24 Steady-state solutions Which solution is actually observed or if a steady state is ever reached depends (1) on the value of r and (2) on the initial value of x i (x 1 ) Which solution is actually observed or if a steady state is ever reached depends (1) on the value of r and (2) on the initial value of x i (x 1 ) For example, if x 1 = 0 we can never get to the other steady state 1 - 1/r For example, if x 1 = 0 we can never get to the other steady state 1 - 1/r

25 Steady-state solutions We can mathematically determine which solution will apply and whether it can be reached by analysis of the approach to the steady-state, which involves examining the derivative of x i in the neighborhood of the solutions (e.g., by a Taylor expansion) We can mathematically determine which solution will apply and whether it can be reached by analysis of the approach to the steady-state, which involves examining the derivative of x i in the neighborhood of the solutions (e.g., by a Taylor expansion)

26 Steady-state solutions Alternatively, we can numerically (computationally) determine which solution will apply by simulation as we have done. Alternatively, we can numerically (computationally) determine which solution will apply by simulation as we have done.

27 Interactive demonstration Compare the “final” values in the modified Demonstration D6 to 1- 1/r to see if the steady state has been reached. Compare the “final” values in the modified Demonstration D6 to 1- 1/r to see if the steady state has been reached.

28 Parameter line We can update our parameter line to include the steady state values (if any). We can update our parameter line to include the steady state values (if any). 0123r x=0 monotonic x=1-r -1 monotonic x=1-r -1 oscillatory unstable oscillatory

29 Transition values Our modeling also reveals transition values, values of the parameter that separate one type of behavior from another (e.g., r=1). Our modeling also reveals transition values, values of the parameter that separate one type of behavior from another (e.g., r=1).

30 Assigned Reading for Next Class Yeargers Yeargers  Section 2.4  pp. 284-286  Section 9.4 through end of Chapter 9


Download ppt "Computational Biology, Part 14 Recursion Relations Robert F. Murphy Copyright  1996, 1999, 2000, 2001. All rights reserved."

Similar presentations


Ads by Google