The Vam Configuration File

Every Vam file begins from a Vam configuration file, often called VAM.CFG, which sets out the data content of the model in so far as the data is best thought of as vectors and matrices. This configuration file contains some vital information – namely, the starting date and ending dates for all data in the vam file – the range of years over which the model can be run or graphs and tables made. Then, for each vector or matrix in the model, there is a line containing :

  • its name,

  • its number of rows,

  • its number of columns,

  • if a vector, the number of lagged values with which a vector can be used in the model, or if a matrix, whether or not it is “packed” so that only non-zero elements are stored,

  • the file name of the titles for the rows of a vector or matrix, and if a matrix, followed by the file name of the titles for the columns of the matrix.

  • a ‘#’ followed by a comment usually explaining the economic nature of the variable and possibly the name of the file with historical data.

The format is free. Here is part of the VAM.CFG for the Mudan model of China:

#         Matrices and Vectors of the Mudan Model
#
1980 2020 # Starting and ending years
#
#Name |Number of  |Files of titles of|   Description
#     |row col lag|  rows   cols     |
#
# Matrices
am   33 33 0 sectors.ttl sectors.ttl # the input output matrix
bmcr 33 11 0 sectors.ttl hhrural.ttl # the bridge matrix for cr
bmcu 33 19 0 sectors.ttl hhurban.ttl # the bridge matrix for cu
bmv  33 40 p sectors.ttl bmv.ttl     # the bridge matrix for investment

# final demand vectors
hcr  11  1 0 hhrural.ttl             # Consumption of Rural Hh, Hh sectors
hcu  19  1 0 hhurban.ttl             # Consumption of Urban Hh, Hh sectors
...
out  33  1 3 sectors.ttl             # Output
...
#
# Vectors related to fixes
#
dump   33 1 0 sectors.ttl        # Discrepancy of Fixed Outputs
pdump  33 1 0 sectors.ttl        # Discrepancy in prices
fix   100 1 0 fix.ttl            # Fixes, to be filled in by Fixer

Note that the starting and ending dates do not control when a particular run of the model starts or stops, but rather they define the range of the Vam file. The model in the example cannot start earlier than 1980 or run past 2020, but it certainly does not need to run over the whole span on each simulation. In this example, the model will have a vector named “hcr” which will have 11 rows and 1 column, as indicated by the first two numbers on the line; only current year values of this vector are needed in computing the results of the model in the present year, so the number of lags used, the third number on the line, is 0. In the example above, only the “out” vector requires lagged values. Note the ‘p’ in this position of the “bmv” matrix. This ‘p’ marks a matrix that is to be “packed” so that only non-zero items are stored. (This presently is not the actual case in the Mudan model.) The next item on the line is the name of the file with the sector names to be used for the spreadsheet-like displays of the vector. Everything following the ‘#’ is a comment.

Names of vectors may contain up to 16 letters or numbers and may contain the underscore mark, “_”. They must not, however, end in a number. This restriction is necessary because sometimes it is necessary to use the sector number as a suffix to the vector name and to convert between the suffix and subscript forms of the name. For example, we must be able to recognize that pce[23] and pce23 are the same series. If we had a vector named g2, then g2[3] would convert to g23, and g23 would convert back to g[23], which is wrong. So no numbers at the end of vector names, please!

G7 is case sensitive; Q is not the same variable as q.

When using a Vam file, you may need a reminder of the names of the various vectors and matrices. You can use G7’s editor to look back to the VAM.CFG file or, if the names alone are sufficient reminder, you can use the listvecs command.

listvecs
lv [-sr] [<bank_location> [<wildcard>]]
lvc [-sr] [<bank_location> [<wildcard>]]
The listvecs or lv command works just like the lis command, but all vector and matrix names in the default vam file or specified bank are printed. The lnc command is the same but prints names in one column. Option ‘s’ sorts the series in alphabetical order, and ‘r’ reverses the order. By default, the command will operate on the default vam bank, but other bank locations may be specified. Use of wildcard is optional, and like in DOS, ‘*’ will match any number of characters. For any single character, however, you need to use ‘^’, instead of ‘?’ as in DOS.