Input of Time Series into Vam Files

There are a number of ways of loading data into Vam files. This help page shows ways to introduce a single time series for one element of a vector or matrix. Following pages show how to introduce whole vectors or matrices. Many of these tools are designed to read data from ASCII files. Additional capabilities are offered for reading data from Excel spreadsheets.

vdata <series_name>

This command works just like data except that the series introduced 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.

(vup)date

This command works just like update except that the introduced series goes into the default Vam file.

Loading the Vam File from G7 banks

It also is possible to introduce data from G7 banks into the Vam file. Just as the f command will form a variable and store it in G7’s workspace, the vf command will load a single series into a vector or matrix element in the default Vam file. A significant difference is that the vectors and matrices in the Vam file must be specified in advance, though without data, while new series may be introduced to the workspace at any time. The format is

vf <name> = <expression>
vf <name[{<date1> [- <date2>]}] > = <expression>
vf <name> <operator> <expression>

Examples:

vf out1 = out1
vf out1{2000} = out1
vf out1{2000-2010} = out1

This seemingly tautological example actually does something useful. It will look in G7’s workspace bank for out1 and if it fails to find it, it will look in the bank assigned as ‘a’. Let us suppose that it finds out1 there. It then will copy this series to the default Vam file. Specifically, the series will be copied to element 1 of the out vector in the default Vam file. The right side of the vf command can be any valid G7 expression, including the various @ functions, such as @log, @exp, @pos, @ifpos, and @csum. To specify that a variable on the right should come from the bank assigned as b, put “b.” in front of the variable name. The vf command works over the range of dates specified by the fdates command. The command can be carried out over an alternative set of periods by specifying the dates within brackets after the left-hand-side variable name is specified.

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.

fdates <fdate1> <fdate2>

This command specifies dates that will be used as the range of action of the f, vf, vc, index, ctrl, and other commands, and also of the @cum() function. The default values of the fdates are the beginning and ending dates of the Vam file, respectively.

Example:

fdates 1980 1999