The name is absent



24


Stata Technical Bulletin


STB-8


where            svar state variable name

avar      auxiliary variable name

rvar      rate variable name

evar      exogenous variable name

pname   parameter name

f (p)       function of parameters or other parameters, already declared

in the model code list

#         numeric constant

dt time step for the equation integration; it is inserted only to
identify a state equation but, really, any character set differing by
‘+’ or ‘*’ is allowed.

exp any algebraic expression containing #, pname, evar, avar, and svar.
In the expression, all the Stata functions can be used. For example,
it is possible to use the random generator function uniform()

label a descriptor of the statement (optional)

10) Special functions: simula recognizes some special functions that, indicated in the rate equations, perform some specific
tasks. These can be indicated only in the rate equations: moreover, each rate equation allows only one function. The syntax
of the functions is

R rvar=fcn expp, arg, arg,...]

where fcn is one of the special functions, exp is an algebraic expression and arg are the arguments needed by the function
itself. The available functions are, right now:

IDL information delay function. The syntax is “R rvar=IDL Xxpp d dly] ”, where dly is the delay time. The effect on rvar is
rvart = exp(t — dly) if t > dly and rvart = 0 otherwise.

MDL material delay function; this function has the same effect of a further level inserted in the flux, but not available to the user.
The syntax is “R
rvar=MDL Xxxp d dly] ”, where dly is the delay time. The effect on rvar is rvart = rvart + exp(t — dly)
if t > dly
and rvart = 0 otherwise. dly is expressed in time units. It must be a parameter or an auxiliary variable
name (not a constant or expression).

SWTC switch to rate on/off. The syntax is “R rvαz=SWTC[xxp,cvαr,von,vojf]”; sets the rate to zero if a control variable
cvar is below a low threshold value von or reaches an upper threshold voff. The results are rvar = 0 if cvar < von ;
rvar = exp if cvar > von and cvar < voff; and rvar = 0 if cvar ≥ voff. SWTC can be used to perform the tasks:

Represent a state variable with a physical limit and with the inflow rate independent from the level: von is set to 0
and
voff to the maximum level capacity; cvar is the level itself.

Represent a process starting and/or stopping at some defined times: the control variable is _time; von and voff are the
starting and ending times.

Give a pulse of material at a specific time only (von = voff).

Simulate processes conditionally associated to other variables.

11) Simulation set-up: Time step, time span and time of start are defined by the command and not in the program.

Example of model coding

The .dct file containing a Volterra example model (without delay):

dictionary ■(

* file "volmodi.det"

* example model for "simula" STATA command (4/11/91)

* This is a kind of a VOLTERRA model - without delay

* Ref. J. Maynard Smith, 1974. Models in ecology. Cambridge University Press.

str70 _model "Model statements"

1

"* Prey Predator Volterra model

"* STATE equations -----------

"S X=X+dt*(Bx-Dx)

"S Y=Y+dt*(-Dy+By)

- without delay

"

"

"

"

Prey population (n)
Predator population

(n)

"*

RATE equations ------------

"

"R

Bx=Kbx*(Cc-X)

Birth rate of prey

(n∕year)

"

"R

Dx=Kmx*X*Y

Death rate of prey

(n∕year)

"

"R

Dy=Kmy*Y

Death rate of predator (n∕year)

"

"R

By=Kby*Y*(X-Y)

Birth rate of predator (n∕year)

"



More intriguing information

1. The Functions of Postpartum Depression
2. The Economic Value of Basin Protection to Improve the Quality and Reliability of Potable Water Supply: Some Evidence from Ecuador
3. The name is absent
4. Detecting Multiple Breaks in Financial Market Volatility Dynamics
5. The name is absent
6. The name is absent
7. Income Taxation when Markets are Incomplete
8. Disentangling the Sources of Pro-social Behavior in the Workplace: A Field Experiment
9. PRIORITIES IN THE CHANGING WORLD OF AGRICULTURE
10. A Note on Costly Sequential Search and Oligopoly Pricing (new title: Truly Costly Sequential Search and Oligopolistic Pricing,)
11. Weather Forecasting for Weather Derivatives
12. Business Cycle Dynamics of a New Keynesian Overlapping Generations Model with Progressive Income Taxation
13. The mental map of Dutch entrepreneurs. Changes in the subjective rating of locations in the Netherlands, 1983-1993-2003
14. Backpropagation Artificial Neural Network To Detect Hyperthermic Seizures In Rats
15. The Structure Performance Hypothesis and The Efficient Structure Performance Hypothesis-Revisited: The Case of Agribusiness Commodity and Food Products Truck Carriers in the South
16. Language discrimination by human newborns and by cotton-top tamarin monkeys
17. Running head: CHILDREN'S ATTRIBUTIONS OF BELIEFS
18. SOME ISSUES IN LAND TENURE, OWNERSHIP AND CONTROL IN DISPERSED VS. CONCENTRATED AGRICULTURE
19. ESTIMATION OF EFFICIENT REGRESSION MODELS FOR APPLIED AGRICULTURAL ECONOMICS RESEARCH
20. Novelty and Reinforcement Learning in the Value System of Developmental Robots