G7 Commands: VΒΆ

vam <bankname> [<location>]
This command has the same format as bank, and assigns a Vam file at the default location. The <location> must be a letter. If <location> is not given, then it is assumed to be ‘a’, which is the first slot. Up to 25 data banks of the various types may be assigned, in positions ‘a’ through ‘z’ except ‘w’.

The equivalent function can also be reached via the G7 menu by selecting Bank | Assign menu item and choosing Files of type “Vam Bank”.

Related Topics: Assigned Banks, bank, cbk, dfr, dvam, hbk, listbanks, pmfile, vf, vup

(vamcr)eate <vam configuration file> <vam file>
This command is used to create a Vam file from a Vam configuration file the command in G7. For example, to create the Vam file HIST.VAM from the configuration file VAM.CFG, the command is::
vamcreate vam.cfg hist

At this point, the newly created Vam file has zeroes for all of its data.

Related Topics: dvam

vammode [ a | s ]
The simulation files from Interdyme models usually consist of a logical pair. The Vam file contains the matrices and vectors, and the G7 bank contains all macro variables. If you use the Compare program to make tables and ask it to read data from a Vam file, then it will treat the Vam file – G bank pair as one logical entity. G7 on the other hand, can treat the two as one logical bank like Compare, or require that you load them as separate banks. The first option, which is the default, is ‘a’ (advanced mode), and the alternative option is ‘s’ (simple mode).
(vaxl)ab <in | out>
This controls the position of the vertical axes numbers, causing them be printed inside or outside of the axes. The default is “vaxl in”.
Related Topics: Drawing Graphs, graph, vaxtitle, vr
(vaxti)tle <text string>
This provides a vertically printed title for the y (left) axis. Use vaxti with no following text to remove the left axis title.
Related Topics: Drawing Graphs, graph, subtitle, title, vaxlab
vc <vector_name> = <expression>
The vc, (vector calculate) command evaluates the expression on the right and puts the results into the named vector. Only a few matrix and vector operations are implemented with vc. It can add or subtract any number of vectors and multiply a matrix times a vector. It cannot yet add or subtract matrices, and parentheses are not supported yet. However, scalar values (either constants or G7 bank variables) can be used to premultiply or postmultiply a vector or matrix. Also, a scalar value can appear alone on the right hand side of a vc equation, which indicates that the entire vector will be set equal to that scalar value. Between a matrix and a vector, an * means matrix-vector multiplication. Between two vectors, the * means element-by-element multiplication. Between a vector and a matrix, the / means multiplication by the transpose of the matrix or vector on the left. Between two vectors, the / means element-by-element division. The vc command is performed only over the interval defined by the current fdates command.

Example: If am and cm are matrices and out, pdm, qcu, and cprices are vectors, we could write

vc out = am*out + out    # matrix multiplication, vector addition
vc qcu = out*pdm         # element by element vector multiplication
vc out = qcu/pdm         # element by element vector division
vc cprices = pdm/cm      # This is actually pdm' * cm.

The <vector_name> must be a valid vector name in the Vam file, as must be all names in the expression.

Related Topics: linv, mcopy, minv, mmult, mtrans

vdata <series_name>
This command works just like data except that the introduced series goes to the default Vam file. Recall that if fd is a vector in the Vam file, fd23 will be the 23rd element of it. If am is a matrix, am12.14 is the element in row 12, column 14.
Related Topics: data, update, vf, vupdate
vf <name> = <expression>
vf <name>{<date1> [- <date2>]} = <expression>
vf <name> <operator> <expression>
This command is exactly like the f command except that the destination for the calculated series is the default Vam file. Therefore, the <name> must be a legal name, i.e., a vector defined in that Vam file, with a sector number within the range of elements for that vector. A range of dates also may be provided to specify the periods to carry out the calculations.

Example:

ba outemp a
vam hist b
dvam b
vf out1 = out1

This seemingly tautological example actually does something useful. It will look first in the workspace bank for a series named out1, and if it fails to find it, will look in the bank assigned in position ‘a’, which is OUTEMP.BNK. Let’s say it finds the series there. It will then copy this series over to the default Vam file, which is HIST.VAM. The right hand side <expression> is any valid G7 expression, and the operation is effective over the current fdates.

In addition to the assignment operator (i.e. “=”), the vf command can add <expression> to the left-hand series using the “+=” operator, or it can subtract <expression> from the left-hand series with the “-=” operator, or multiply with “*=” or divide with “/=”. These operators follow the syntax for the C++ programming language, though here they operate over a range of values.

Related Topics, dvam, f, vam, vdata, vupdate, vup

vmake [<startyr> [<endyr>] <target> <source> ...
vplus [<startyr> [<endyr>] <target> <source> ...
vminus [<startyr> [<endyr>] <target> <source> ...
The vmake command is used to make a vector out of other vectors, or a matrix out of vectors. The vplus and vminus variations are identical to vmake except that they add or subtract the source quantities to the target quantity. The <startyr> and <endyr> parameters are optional. If not given, then the process will work over the entire range of the Vam file. Each matrix, whether it is a target or a source, is represented by:

MatrixName( r|c, < lines>)

where ‘r’ or ‘c’ indicate row or column, and <lines> are the selected rows or columns. If the <lines> specification is omitted, then the default is all rows or columns. Each vector in the list is represented simply by its name. If the total number of lines in the sources is different from that of the target, then vmake uses the smaller number. The target may be a packed matrix, in which case the packed matrix file must have already been created, and the positions of the non-zero elements already determined. In this case, vmake will only store elements in the non-zero positions. Here are some examples:

The first example puts the matrices a, b and c in rows 1, 2 and 3 of A.

vmake A(r 1-5) a b c

The next example puts column 3 of A into the vector c.

vmake c A(c 3)

The final example puts fows of B starting from row 1 followed by the vector c into rows 2 to 100 of the matrix A.

vmake A(r 2-100) B(r) c
(vmatd)ata <r|c> <nv> <nyrs> <first> <last> [skip]
<year> <vec1> <vec2> ... <vecnv>

<vec> <year1> <year2> ... <yearnyrs>
[form]
The vmatdata command puts whole vectors into the default Vam file. It can be used to bring in data in a variety of formats commonly used by statistical agencies in releasing input-output tables. It can read a file which shows any one of the following:
  • one vector in columns for several years
  • one vector in rows for several years
  • several vectors in columns for one year
  • several vectors in rows for one year

The vmatdat command requires at least two lines and three if a format for reading is specified. The form of the first line is always the same, as is the form of the third line, if present. The second line has two different forms, one if several vectors are being read for one year and another if data for one vector is being read for several years.

In the above syntax, the arguments have the following meaning:

<r|c>:is ‘r’ or ‘c’ according to whether the vectors are rows or columns.
<nv>:is the number of vectors.
<nyrs>:is the number of years.
<first>:is the position in the vector in the Vam file of the first item in the data which follows.
<last>:is the position in the vector in the Vam file of the last item in the data which follows.
<skip>:is the number of spaces on each line which should be skipped before beginning to read data. If no value for <skip> is provided, then a form line (explained below) will be expected as the third line. If no spaces are to be skipped and no form line provided, then give skip a value of 0.
<year>:is the year of the vectors or the first year if nyrs > 1.
<vec1>:is the name of the first vector, vec2 is the name of the second vector, etc.
<form>:If no value for skip is given, then this form line must be provided. It should have the letter r in every position which is to be read in the following table. This device allows direct reading of tables that have columns of data separated by | or other symbols or which have subtotals which are not to be read.

A typical form line and a matching data line are:

form:                 rrrrrrrrrrrrrrrrrrrrr         rrrrr      rrrr

data:Agriculture     | 3450  3718  249   0  | 6780|  8102 |**| 1598

Columns which do not have an r are simply totally ignored. Consequently, they cannot be used to separate data fields. Thus, reading the following

rrrrrrrr    rrrr
  851       2971

would produce one number, 8512971, not two numbers, 851 and 2971.

The first version of the second line is used if there are several vectors for one year; the second is used when giving data for one vector in several years. In both cases, the item of which there is only one is specified first and then the items of which there are several.

Any line beginning with a # is skipped completely. For example, the lines

# Example of several vectors in columns for one year:
vmatdat c 6 1 1 57 3
1986   cons   gov   inv   stk   exp   imp
1        21     0     2    -3     6     7
...     ...   ...   ...   ...   ...   ...
57       38   401     0     0    17    15

would read the 6 columns of data into positions 1 through 57 of the named vectors (cons, gov, ...) for the year 1986. Positions 1 - 3 of each line, which contain the sector number for easy visual reference, are skipped.

Here is another example which reads the vectors as rows, as may often be the case when reading printed tables of primary inputs.

# Example of several vectors in rows for one year:
vmatdat  r 6 1 1 6  16
1986 labinc propinc deprec inter profit tax
#                  1     2     3     4     5     6
labor income    7303    21   368  1203  1302   820
proprietor inc  1215     9   100   107   303    92
depreciation     950     3    82   104   121    73
interest income  845     7    83    54    95    52
profits           50     3    25   217   337    38
indirect taxes   121     1    32   178   294    29

Note the use of the line beginning with a # to provide labels for the columns.

The second form of the second line is illustrated by the following example, which reads one vector, cons, for five years.

# Example of a single vector in columns for several years:
vmatdat c 1 5  1 57 2
cons 1985 1986 1987 1988 1989 1990
 1   31.8 37.2 32.5 38.7 41.2 43.1
...
57    1.2  1.7  1.8  2.0  2.1  2.2

Finally, here is an example which reads a single vector in columns for several years.

# Example of reading a single vector in columns for many years.
vmatdat r 1 28 1 8  12
demog 1989 1990 1991 1992 1993 1994 1995 1996 1997
#  Date  ncent south  west college  twoy  fs1   fs2   fs5   head1 head3
 89.000  0.243 0.345 0.208  0.220  0.469 0.243 0.323 0.106  0.274 0.350
 90.000  0.241 0.346 0.209  0.222  0.476 0.250 0.320 0.105  0.267 0.350
 91.000  0.240 0.347 0.211  0.224  0.482 0.247 0.320 0.105  0.263 0.348
 92.000  0.238 0.348 0.212  0.226  0.487 0.245 0.319 0.104  0.260 0.346

It must be emphasized that, precisely because it can read in free format, the vmatdat command cannot interpret blanks as zero entries. There must be a numerical value for all cells in the tables, especially the 0’s.

The flexibility of vmatdat often makes it possible to read in final demand columns or primary inputs as they appear in printed tables provided by statistical offices.

Related Topics: matin

vp <vector_name> [r|c] [field_width] [decimal_points]
vp <matrix_name><view><line> [field_width] [decimal_points]
The vp command writes the named matrix to the currently open save file. As you can see, this command has a format and options like those of the show command.

Example:

save am.dat
vp am y 2000  9  6
save off

Related Topics: pmpunch, punch, punchvec

(vr)ange <bottom> [top]
vr <bottom> [<line1>] [<line2>] ... [<line8>] <top>
vr off
The graph command normally sets the vertical range so the series extend from the bottom to the top of the graph. Sometimes, it is desirable to set the range independently. This is done with the vrange command. For example “vr 0 100” will make all subsequent graphs have 0 at the bottom and 100 at the top until the “vr off” command is encountered, restoring G7 to its normal mode. If the <top> is omitted, then only the bottom of the graph is set and the program finds the top so that the graph fits on the screen.

If one or more of the optional [line] entries are present, horizontal lines will be marked at those levels. The lighted pixels which mark these lines are located above the long marks on the horizontal axis, so they also serve as meaningful vertical lines.

Related Topics: Drawing Graphs, graph, hrange, line, vaxlab

vtitle <title>
This command allows you to record a title for the default Vam file. This title is displayed when using Compare.
vupdate
Related Topics: vdata
vup
This command works just like update except that the series goes into the default Vam file. For this to work, a Vam file must be assigned with vam, and it must be set to the default with dvam.
Related Topics: dvam, vam, vf

Previous topic

G7 Commands: U

Next topic

G7 Commands: W

This Page