A
new simulation capability has been introduced in Modeleasy+ 5.2. This capability
allows the user to specify bounds on a variable and how the variable should be
treated if a bound has been exceeded during the solution process. The BUILDMODEL
command now has an option, BOUNDED, which allows the user to specify that
one or more variables may be subject to bounds during the simulation of the
model. The bounds on the variables may be specified using the SIMOPTION command
with the BOUNDS keyword.
The
example below shows the use of the BUILDMODEL command specifying that the
variable W1 may be bounded during the simulation process.
:_buildmod klein1 :
bounded w1
More than
one variable may be specified by using either a list of names following the
BOUNDED keyword or a namelist containing the list of names.
The
actual simulation of the Klein1 model is shown below when no bounds have been
specified. Most of the output from the SIMULATE command has been surpressed for
the sake of clarity.
:_simulate
klein1 : print
*Linkule SIMULATE. Version 12/29/2000*
WARNING: No BOUND set on endogenous variables.
The
message appearing in the above example indicates that no bounds have been set
for W1 during the simulation. The actual and simulated results for W1 (SW1) are
shown in the table below.
:_tabit
w1 sw1
+------+------+--------+
| YEAR | W1 | SW1 |
+------+------+--------+
| 1925 | 35.4 | 35.279 |
| 1926 | 37.4 | 33.3 |
| 1927 | 37.9 | 30.603 |
| 1928 | 39.2 | 32.343 |
| 1929 | 41.3 | 37.723 |
| 1930 | 37.9 | 40.184 |
| 1931 | 34.5 | 39.122 |
| 1932 | 29 | 35.192 |
| 1933 | 28.5 | 32.452 |
| 1934 | 30.6 | 33.093 |
| 1935 | 33.2 | 34.532 |
+------+------+--------+
The
variable W1 may be bounded by using the SIMOPTION command as shown below where
the simulated values of the variable W1 are required to lie between 20 and 35.
:_simoption bounds : w1
20 35
The model
may be simulated again with the simulated value of W1 restricted to 35. This is
shown below where warning messages are issued when the simulated value of W1
exceeds the bound. Most of the output of the simulation has been supressed for
the sake of clarity.
:_simulate
klein1 : print
*Linkule SIMULATE. Version 12/29/2000*
Bounds set for 1 endogenous variable(s).
*Subroutine T4SIMS. Version 12/29/2000*
"DYNAMIC" simulation
TSRANGE: 1925 1 TO 1935 1
Actual number of simulation periods = 11 on a maximum of 24
*** WARNING : In iteration 1 of time period 1,
the variable W1 exceeded the specified bounds.
Its value has been set to the maximum allowed.
...
The
default action to be taken when one of the bounds is exceed is to replace the
simulated value by the bound value. This can be seen in the table below where
the actual value of W1 is tabulated with the simulated value, SW1.
:_tabit
w1 sw1
+------+------+--------+
| YEAR | W1 | SW1 |
+------+------+--------+
| 1925 | 35.4 | 35 |
| 1926 | 37.4 | 33.384 |
| 1927 | 37.9 | 30.704 |
| 1928 | 39.2 | 32.361 |
| 1929 | 41.3 | 35 |
| 1930 | 37.9 | 35 |
| 1931 | 34.5 | 35 |
| 1932 | 29 | 35 |
| 1933 | 28.5 | 35 |
| 1934 | 30.6 | 33.17 |
| 1935 | 33.2 | 30.522 |
+------+------+--------+
As can be
seen in the table above, when SW1 has exceed the upper bound of 35, its value
has been replaced with the upper bound. There is another option of SIMOPTION
which allows the value of the simulated variable to be replaced by the last
feasible value when a bound has been exceed. This is done by using the command
shown below.
:_simoption bounds
previous : w1 20 35
Redoing the simulation
above and tabulating the results produces the table shown below.
:_tabit
w1 sw1
+------+------+--------+
| YEAR | W1 | SW1 |
+------+------+--------+
| 1925 | 35.4 | 34.957 |
| 1926 | 37.4 | 33.394 |
| 1927 | 37.9 | 30.718 |
| 1928 | 39.2 | 32.364 |
| 1929 | 41.3 | 32.364 |
| 1930 | 37.9 | 32.364 |
| 1931 | 34.5 | 34.805 |
| 1932 | 29 | 34.153 |
| 1933 | 28.5 | 34.906 |
| 1934 | 30.6 | 33.056 |
| 1935 | 33.2 | 28.478 |
+------+------+--------+
As can be
seen in the above table, the simulated values obtained for W1 are different, as
expected.
The
ability of the user to control the values of variables during the simulation
process greatly enhances the capabilities of the solution process.