The name is absent



Stata Technical Bulletin

23


Step 2: Model coding

The model equations have to be written in a form understandable by the simula command. simula uses two kinds of
files: the
model file and the exogenous variable file. The models must be saved in the a string variable named .model in the
model file. There are six kinds of statements recognized by simula: state equations (denoted by S), auxiliary equations (denoted
by A), rate equations (R), exogenous variable declarations (E), initial value assignments to the state variables (I), and parameter
value assignments (P).

The above symbols ( S, A, R, E, I, and P), placed as the first character of each line identifies the statement type. simula
parses the statements in a way requiring the following rules:

1. Line structure: each statement is composed of three parts:

a. a statement identifier (the capital letters S, A, R, E, I, or P);

b. the statement itself (equation, declaration, assignment); blanks inside are not allowed;

c. a statement label, which is optional and must be separated by a blank, at least, from the statement.

2. Comment lines: Any character different from S, A, R, E, I, and P in the statement identifier position, denotes a comment
line.

3. Line order: The model list can contain the statements in any order. The only exceptions are

a. when an auxiliary variable (e.g., aux2) depends on another auxiliary variable (e.g., auxl); in this case, the equation
for auxl must precede the aux2 equation.

b. initial values declaration must follow the related state equation.

4. All the statement kinds allow only one expression/declaration/assignment per line. For example, it’s not possible to write
the lines: “E rain temp”, “I X=IOO Y=50”, “P Kl=5 K2=7; they should be rewritten as “E rain”, “E temp”, “I X=100”,
etc.

5. Constant values: The S, A, R, I and P statements allow constant values. Arguments for the special functions are to be
parameters or auxiliary variable (ex: the delay time) and are not constant.

6. Special functions: Right now simula has three special functions: IDL (information delay), MDL (material delay), and SWTC
(switching a rate on/off). Functions can only be specified in the rate equations; arguments must be parameters or auxiliary
variables.

7. Blank lines: Between two statements it is possible to insert up to, but not more than, one blank line. This insertion could
be useful to make clear the reading of the model.

8. Parameters and initial values: It is not necessary to declare all the parameter and initial values in the .model variable, but
this is a good practice. Whether specified or not, it is possible to assign those values as an option in the simula command.
(Of course, all parameter and initial values need to be declared eventually so, if they are not declared in the model file,
they must be declared when the simula command is given.)

9. Statement syntax: The syntax for each type of statement is

S svar1=svar1+dt*(rvar1 ± rvar2 ± ...) label

a avar=exp label

R rvai—exp label

E evar label

I svar=# label

I svar=f(p^) label

P pname=# label

P pname=f(p^) it label



More intriguing information

1. Crime as a Social Cost of Poverty and Inequality: A Review Focusing on Developing Countries
2. Bargaining Power and Equilibrium Consumption
3. FUTURE TRADE RESEARCH AREAS THAT MATTER TO DEVELOPING COUNTRY POLICYMAKERS
4. The name is absent
5. Constructing the Phylomemetic Tree Case of Study: Indonesian Tradition-Inspired Buildings
6. Does Competition Increase Economic Efficiency in Swedish County Councils?
7. The English Examining Boards: Their route from independence to government outsourcing agencies
8. Environmental Regulation, Market Power and Price Discrimination in the Agricultural Chemical Industry
9. Deprivation Analysis in Declining Inner City Residential Areas: A Case Study From Izmir, Turkey.
10. FDI Implications of Recent European Court of Justice Decision on Corporation Tax Matters
11. The name is absent
12. Investment in Next Generation Networks and the Role of Regulation: A Real Option Approach
13. The name is absent
14. The Modified- Classroom ObservationScheduletoMeasureIntenticnaCommunication( M-COSMIC): EvaluationofReliabilityandValidity
15. Foreign direct investment in the Indian telecommunications sector
16. The name is absent
17. Legal Minimum Wages and the Wages of Formal and Informal Sector Workers in Costa Rica
18. Discourse Patterns in First Language Use at Hcme and Second Language Learning at School: an Ethnographic Approach
19. The name is absent
20. The name is absent