Stata Technical Bulletin
25
"* AUXILIARY equations |
— Environm. carrying capacity (n) |
" " |
"* e.g. related to the |
ecosystem grass production |
" |
"E temp |
Aver, annual temperature (C) |
" |
"E rain |
Aver, annual rainfall (mm) |
" |
"I X=IOOO |
Prey initial density |
" |
"I Y=IOO |
Predator initial density |
" |
"p κbx=o.oε |
Fractional birth rate of X |
" |
"P Kby=O.006 |
Birth coefficient for Y |
" |
"P Kmx=O-OOl |
Predation coefficient |
" |
"P Kmy=0.oε |
Fractional death rate for Y |
" |
"P Kl=80 |
Effect of the rain∕temp ratio |
" |
If we wished to insert a material delay on the predator birth rate, we create a new file (volmod2. det) inserting the MDL
function in the By rate equation. The declaration of the delay time (Devt) as P statement is optional; it is possible to declare or
modify it by an option of simula.
dictionary ■(
* file "volmod2.dct"
* example model for "simula" STATA command (17/1/92)
* This is a kind of a VOLTERRA model with MATERIAL DELAY
* Ref. J. Maynard Smith, 1974. Models in ecology. Cambridge University Press.
str70 _model "Model statements"
1
"* Prey Predator Volterra model with delay "
Same statements as above until we get to R By
"R By=MDL [Kby*Y*(X-Y),Devt] Birth rate of predator (n∕year) "
"* Note: MDL indicates a delay of Devt years of By contrib. to Y "
(Remaining statements the same)
"P Devt=O.5 Delay (years) for developm. time"
Step 3: Exogenous variable file creation
Exogenous variables required by the model must be saved in an exogenous variable file, also containing a time variable
named -time. Before saving this file it is necessary to sort it by _time because simula merges the exogenous variable file to
the model by the _time variable.
Example
The exogenous variable file created contains the rainfall and temperature values for ten years. We can assume that the
values came from a stochastic weather model; they are inserted in the following .dta file:
. describe
Contains data from d:\climate.dta
0bs: |
10 (max= |
= 14230) |
EXO-VARS for the Volterra model | ||
Vars: |
3 (max= |
= 99) | |||
1. _time |
float 7.9.0g |
Year | |||
2. temp |
float 7.9.0g |
Annual average temper. |
(C) | ||
3. rain |
float 7.9.0g |
Total annual rainfalls |
(mm) | ||
Sorted by: |
: _time | ||||
. list | |||||
. |
.time |
temp |
rain | ||
1. |
1991 |
18 |
ιεεo | ||
2. |
1992 |
17 |
1300 | ||
3. |
1993 |
ιε |
1800 | ||
4. |
1994 |
21 |
19εo | ||
ε. |
199S |
ιε |
1200 | ||
6. |
1996 |
22 |
1100 | ||
7. |
1997 |
19 |
ιεoo | ||
8. |
1998 |
20 |
1400 | ||
9. |
1999 |
ιε |
1700 | ||
10. |
2000 |
16 |
1600 |
Step 4: Use of the simula command
simula requires a model file already in memory; on request, it loads and merges the exogenous variables.
simula performs the numerical integration of the model equations by the Euler (rectangular) method. The command gives
the change with time of the system conditions (state variables) starting from the initial values and with the provided parameter
values.