Fixer: Fixing General Vectors and Matrices in InterDyme ModelsΒΆ

Vector fixes are more complicated than macro fixes because they can apply to individual elements of a vector, to the sum of a group of elements, or to the sum of all elements in the vector. However, the format of the vector fixes is very similar to that of the macro variable fixes. Matrix fixes at present remain rather simple, with each fix being applicable to only one cell of a matrix. The preparation of the vector and matrix fixes is the work of the Fixer program. (Fixer sometimes is called VecFixer.)

G7, it should be noted, normally prepares vectors of exogenous variables; fixes apply to vectors of endogenous variables. However, the Fixer program also can be used to supply the values of exogenous variables. Also, when building a model, before all of the equations are finished, Fixer can be used to project the values of right hand side variables of some of the unfinished equations.

When and how are fixes applied as a model runs? Unlike the macro fixes, which automatically are applied when a macro regression equation is calculated, vector and matrix fixes are applied when and where the model builder specifies. At the point where the fixes for the vector “x” should be applied, the model builder must put into the program the line


The input to Fixer is a file prepared by the user in a text editor. It should have the extension .VFX . Fixer also reads the definitions of static groups of sectors and writes them into the GROUPS.BIN file which can be used both by the simulation program and by G7. To use the Fixer program, it is essential that the model’s VAM.CFG file should have a vector called “fix” with enough rows to allow one element for each fix. As Fixer reads the fixes from the input file, it stores the numerical values of the fixes into this “fix” vector within the vam file. It also creates a “fix index” file, which will have the extension .FIN and tells the simulation what to do with each fix. Finally, it produces a binary file with the definitions of groups, called GROUPS.BIN. If G7 already has produced a GROUPS.BIN file, then Fixer will read it and might add to it.

Fixer is started by the command Model | VexFixer on the G7 main menu. From the information on the form which this command creates, G7 prepares a configuration file, called FIXER.CFG, that is read by the Fixer program. This form specifies the root names of:

  • The text input file
  • The fix index file
  • The vam file used for base values for the index and growth rate fixes
  • The name of the output check file, which will show the sectors in each group and the values of each fix in each year. It is used only for manual checking of the program.

While it is up to the user to name files, it is good practice to give the same “root” name to files in the same simulation. A simulation that involves low defense expenditures, for example, could have a vam file called LOWDEF.VAM and a .VFX file called LOWDEF.VFX.

Vectors fixes may apply to a single element or to a group of elements. The concept of a “group”, also described in the G7 documentation, is central to the working of Fixer. A group basically is a set of integers, usually representing sectors in the model. Groups are useful because we often want to impose a fix on a group of elements in a vector. For example, we might want to control the total exports of the chemical manufacturing sectors. We then might create a group named “chem” which would contain the sector numbers of all sectors in question. The command for defining a group is “grp <groupname>”, where the group name can be a number or a name. The sectors included in the group are then specified on the next line. For example,

grp 1
7 10 12

creates a group called 1 of the sectors 7, 10, and 12. The “-” sign means consecutive inclusion. Thus

group zwanzig
1 - 20

consists of the first twenty integers. Parentheses mean exclusion. Thus

group duo
:zwanzig (2 - 19)

makes the group “duo” consist of the integers 1 and 20.

When a group is referenced after it has been defined, a colon must precede its name, as shown when “zwanzig” was used in the definition of “duo” above. Names of groups are case sensitive. Groups need not be kept in numerical order and can be defined anywhere in the input file, so long as the group is defined before it first is employed. If you try to redefine an existing group, the program will complain unless the new group has the same or less than the number of elements as in the old group. References to other groups can be used in new group definitions only if the groups referenced already have been defined.

The way that most fixes are applied to groups is that the value of the fix is calculated first, and then the elements of the group are scaled to the fix control total using right direction scaling. For certain types of variables, such as price indexes, wage indexes, or productivity indexes, scaling to such control totals is not sensible.

For growth fixes (gro, stp, dgro, dstp), index fixes (ind, dind), and follow fixes (fol), the -s option is available. It applies the same growth rate, index, or follow pattern to each element of the group separately. The “-s” comes after the fix type and before the vector name. For example:

# Foreign price fixes
group impprice

 # "fol -s" means that each sector in the group should follow
 # the variable forpi.
 fol -s fpi :impprice = forpi
  2013 0.0
  2040 0.0

In this example, the group impprice is defined to be a list of sectors that do not have exogenous foreign prices. They each should be indexed to move like the aggregate foreign price index forpi. The 0’s in the body of the fix have two purposes: they indicate that the fix is to take effect from 2013 to 2040 and that the indexes should move exactly like forpi, with no extra growth added or subtracted.

Interdyme provides a number of ways for a fix to work. In all of them, a time series is specified by the fix definition. The forms of the fixes differ in how they obtain and in how they apply this time series. The basic format of the input file for a vector fix is:

<command> <vectorname> <GroupOrSector>

followed on the next line by the year and value of the fix. The basic format of the input file for a matrix fix is:

<command> <matrixname> <row> <col>

Definitions of the legal commands and examples follow.


This overrides the result of the equations with the value of the time series given. Intermediate values are interpolated linearly. In the example below, the fix program would calculate and override the model predicitions using the fix series that starts in 1992, ends in 2000, and moves in a straight line between the two points:

ovr ex 10
1992  154.1
2000  182.3

overrides the value of the forecast of element 10 of the “ex” vector (probably exports) with the values shown for the years shown. Note that year either can be specified in 2-digit format (deprecated) or 4-digit format (preferred). As an example of a matrix fix,

ovr am 1 9
1990 0.23
1995 0.26
2000 0.28

would override the value of the A-matrix in the Vam file for the element in row one, column nine, from 1990 to 2000. As before, missing values are interpolated linearly.


This multiplies the equation forecast by a factor specified by the data series on the following line. For example,

mul im 44
1992  1.00
1995  1.05
2000  1.10

multiplies the forecast results for imports of sector 44 by the factors shown. Values of the multiplicative fix on imports between the years shown are interpolated linearly.


This performs a constant term adjustment. It adds or subtracts the value of the time series to the result of the equations. The time series is provided by the fix definition.

For example,

cta def :Alice
1992    0.0001
1995  200
2000  180

is a constant term adjustment for defense expenditures of all sectors in the Alice group. Intermediate values are interpolated.

This is a variety of the override fix that specifies the time series as an index. There must be data in the vam file for the item to be fixed up until at least the first year of the specified index series. The value for the item in that year then is moved by the index of the time series given by the fix lines.

For example,

ind pceio :zwanzig
1982  1.00  1.03  1.08  1.12  1.15
1997  1.21  1.29  1.31  1.34

will calculate the sum of the elements of the pceio vector included in the group “zwanzig” in 1982, will move that sum forward by the index of the series given, and will impose that total to control the those elements when the model is run.

The dind version of the fix can start in any year, and it indexes the series to the value of the expression in the starting year of the fix.

This is a type of override fix that specifies the time series by growth rates. For the growth rate fix to be legal, there must be data in the vam file up until at least the year before the first year of the growth rate fix. Missing values of the growth rates will be replaced by interpolated values.

For example,

gro out 10
1983  3.1
2000  3.4;

The dgro version of the growth rate fix can start in any year and always calculates the series in the present period based on the value in the previous period.

This is a step-growth fix. It is like gro except that a growth rate continues until a new one is provided. A value for the final period is necessary.

For example,

stp out 1
83  4.1
95  4.5
2000 5.0;

The dstp version is the dynamic version which can start in any year. It is just like dgro, except for the method of interpolation of the fix values.


The equation fix for vectors works in the same way as the version for macrovariables, with the exception that the name of the vector must be separated from the sector number by a space.

For example:

# Make the pce deflator for category 3 grow like the aggregate PCE deflator,
# based on the ratio in 1997, from 1998 to 2010.
eqn cprices 3 = cprices3{1997}/apc{1997} * cprices3
 1998 1
 2010 1

# Make corporate profits in sector 1 remain a constant share of total corporate
#   profits, equal to the share in 1997:
eqn cpr 1 = cpr1{1997}/vcpr{1997} * vcpr
 1998 1
 2010 1

The follow fix specifies that an element or group of a certain vector should follow the expression on the right, plus or minus a certain growth rate that can be specified in the body of the fix. It often is used to make imports of a certain commodity grow like domestic demand. For example, the following follow fix makes crude petroleum imports grow like domestic demand, plus 0.2 percent per year:

fol im 4 = dd4
1998 0.2
2030 0.2

The share fix takes the value of the body of the fix (“fixval”) and multiplies the right-hand expression by it before assigning the value to the left hand side variable or group. Like the follow fix, a typical use for this fix is to control the relation between imports and domestic demand. The example below specifies the share of domestic demand for imports of Radio, Television, and Video equipment:

shr im 42 = dd42
1998 0.90
2000 0.92
2030 1.00

When the the FIXER.CFG and input file as described above are ready, type “fixer” at the DOS prompt to invoke the Fixer program.

Please visit the Software pages of the Inforum web site for more details and to download the Fixer software:

Previous topic

MacFixer: Fixing Macro Variables in InterDyme Models

Next topic

IdBuild Macro-Equation Processor for InterDyme

This Page