MacFixer: Fixing Macro Variables in InterDyme Models¶
Macro variable fixes apply to variables of type Tseries; these are defined using the Idbuild program described elsewhere. These fixes work like those of models built with the G7-Build combination, but they also have much in common with the vector fixes described in the next section. The program that handles the macro variable fixes is called MacFixer. The input to MacFixer is a file prepared by the user with a text editor. It should have the extension .MFX. Once this file has been created, the program MacFixer is run by selecting Model | MacFixer on the G7 main menu. The results of this program are written to a “macro fix bank”, which essentially is a G workspace bank (which can be read with G7). The root name (the part of the filename before the dot) of the macro fix G bank is passed to MacFixer through the form that the above G7 command opens. It also must be passed to the simulation program by the form that opens on the command Model | Run Dyme.
MacFixer requires a configuration file, called MACFIXER.CFG. It is created by G7 from the information provided on the form that is opened by the Model | MacFixer command. This form requires the name of the text input file, the root name of the G bank file used for base values for the index and growth-rate fixes (this normally would be the G bank created for use with the simulation program), the name of the G bank which will contain the values of the fixes, and the name of the output check file. This last file shows the values of each fix in each year, and serves as a check on the results in the binary file.
While it is up to the user to name files, it is good practice to give the same root name to files for the same simulation. A simulation that involves low defense expenditures, for example, could have a G bank file called LOWDEF.BNK and a .MFX file called LOWDEF.MFX.
There are several varieties of macrofixes that may be given, and they are described in the list below.
- skip
This is the simplest type of fix. It simply skips the equation and uses the values in the model G bank. For example:
skip invn$35
would skip the equation for the macro variable invn$35 and instead use the value already in the model G bank.
- ovr
This overrides the result of the equation with the value of the time series given. Values between given years are interpolated linearly. In the example below, the macro fix program would calculate and override a fix series that starts in 1992, ends in 2000, and moves in a straight line between the two points. For example,
ovr uincome$ 1992 154.1 2000 182.3
would override the value of the forecast of uincome$ with the values shown for the years shown. Note that the specified years either can be presented in 2-digit format (deprecated) or 4-digit format (preferred).
- mul
This multiplies the equation’s forecast by a factor specified by the data series on the following line. For example,
mul ulfi$ 1992 1.00 1995 1.05 2000 1.10
multiplies the forecast results for the macrovariable ulfi$ by the factors shown. Values of the multiplicative fix between the specified years shown are interpolated linearly.
- cta
This performs a constant term adjustment. That is, it adds or subtracts the value of the time series to the result of the equation. The time series is provided by the fix definition. For example,
cta nonagincome 1992 0.0001 1995 200 2000 180
is a constant term adjustment for nonagricultural income from 1992 to 2000. Intermediate values are interpolated.
For example,
ind wag01 1982 1.00 1.03 1.08 1.12 1.15 1997 1.21 1.29 1.31 1.34will move the value of wag01 in 1982 forward by the rate of change of the series given, and it will replace the calculated value of wag01 by this value when the model is run.
The dind version of the index fix is the “dynamic index fix”. This fix can start in any year and does not rely on historical data being present in the databank. Rather, the fix calculation is based on the value of expression during the model solution for the first year of the fix.
For example,
gro wag01 1993 3.1 2000 3.4The dgro version is the “dynamic growth rate fix”. This fix can start in any year and does not require data to be available in the databank for the starting year of the fix. The growth rate always is applied to the value of the variable in the previous period.
For example,
stp wag01 1993 4.1 1995 4.5 2000 5.0The dstp version is analogous to the dgro fix; the only differences is the way in which values of the fix are interpolated.
- rho <depvar> <rho_value> <rho_set_date>
This is a rho-adjustment fix where
- rho_value:
is the value of rho.
- rho_set_date:
is the year in which the rho adjustment error is to be calculated. If none is provided, it is set in the first year of the run.
This type of fix finds the error made by an equation in the last year for which there is historical data. In the next year, it multiplies this error by the given <rho_value> and adds the result to the value forecast by the equation. In the following year, it multiplies what was added in the first year again by <rho_value> and adds the result to the equation’s forecast, and so on.
For example:
rho invn$38 0.40 1995
tells the model to apply a rho adjustment to the variable invn$38, using the value 0.40 for rho and starting the rho adjustment in 1995.
A rho fix with a <rho_set_date> works like a skip fix in years before the <rho_set_date>. A variable can have a rho fix in conjunction with and a cta, mul, ind, or other type fix. The rho adjustment is applied before any other other fixes.
- <macroname>:
is the name of a macrovariable
- <expression>:
is a legitimate expression, as described below
- <year> <value>:
entries are in the same format as the data for other fixes, but these indicate the years for which the equation fix is to take effect. They also represent the time series for a special variable called “fixval”, which can be used within the equation expression. This “fixval” variable can be used wherever a vector element or macrovariable could be used.
This type of fix lets you dynamically introduce a new equation relationship into the model at run time. The advantage of this type of fix is that users of the model who are not programmers can introduce their own assumed relationships into the model without having to change the model program code. It also is helpful for prototyping a model, where you want to try different equation relationships quickly to see how they work before changing model code.
The equation fixes use the same expression syntax as used in the f command and other commands in G7. Most expressions that are legal in G7 are legal for an equation fix, but only a subset of functions are implemented. Legal functions are: @cum, @peak, @log, @exp, @sq, @sqrt, @pow, @fabs, @sin, @pct, @pos, @ifpos, @pct, @rand, and @round.
Lagged values of any order can be used, with the constraint that they must not refer to a date before the starting year of the model G bank (DYME.BNK). Macrovariables are read directly from memory. Lagged values of vector variables are read from the Vam file. Therefore, you can use a lagged value of any vector element as far back as the starting date of the Vam file, and you are not limited by whether or not that vector has been declared to store lagged values in memory in VAM.CFG.
Examples:
# Make the T bill rate equal to the average inflation plus some percent, # specified in "fixval". eqn rtb = 0.34*gnpinf + 0.33*gnpinf[1] + 0.33*gnpinf[2] + fixval 1998 1.0 2010 1.5; ...
For example, if we would like to specify that Medicaid transfer payments grow like real disposable income per capita plus 0.1 per cent, we could write:
fol trhpmi = di87/pt 1997 0.1 2010 0.1
When the MACFIXER.CFG file and the input file as described above are ready, type “macfixer” at the DOS prompt to invoke the program MacFixer. When the model is running, calls to the “modify” function will apply the fixes using the information in the macro fix G bank specified in the DYME.CFG file for that run. Note that to view the fixes in the macro fix databank, load the bank in G7 and specify the series name as the name of the macro variable, followed by a colon (‘:’), followed by a one-letter code signifying the type of fix. These codes are as follows: skip (‘k’), ovr (‘o’), cta (‘c’), ind (‘i’), gro (‘g’), stp (‘s’), and rho (‘r’). Therefore, to view a cta fix on the variable invn$38, issue the following command in G7
ty invn$38:c
Macro fixes provide an alternative way to supply values of exogenous variables. Exogenous variables, to review, should be put into the “hist” bank in the process of running IdBuild. If the variable appears in no .SAV file for a macro equation, then it must be included in the PSEUDO.SAV file. The standard way of providing the values of the exogenous variables then is through update or other commands in Vam. Another possibility for providing exogenous values is to have a special run of G7 with the “hist” or other bank as the workspace bank. Finally, one can provide the exogenous values as macrofixes. For example, if we want disinc to be an exogenous variable, then – however we are going to provide the values – we need the statement
f disinc = disinc
in the “PSEUDO.SAV” file. To use the macrofix method of assigning values, we need in the code of the model the statements
depend=disinc[t];
disinc[t] = disinc.modify(depend);
We then could provide the values with ovr, ind, gro, or stp commands to the MacroFix program, for example, by
gro disinc
1995 3.0
2000 3.5
2005 4.0;
This method has the advantage of keeping all of the fixes which constitute a scenario in one place. It also allows the use of the gro and stp fixes, which may be convenient. It has the disadvantage of adding an additional series to the banks which constitute the model and an additional statement within the model.
Please visit the Software pages of the Inforum web site for more details and to download the MacFixer software: inforumweb.inforumecon.com/software/software.html.