G7 Commands: P¶
- pch <name> <number>
The pch command is an older form of the ipch command and is used to generate equation results for SlimForp style models. As with ipch, first an equation file is opened with the punch command, then, after doing a reression, pch is used to write lines to the equation file in the format expected by SlimForp.
- pmatin <matrix_name> <packed_matrix_filename>
The pmatin command introduces data for packed matrices to a Vam file. A Vam file already must have been assigned and set as the default Vam file. A packed matrix has all zero elements removed, and the format is efficient for presenting the nonzero cells of the matrix. The packed matrix data resides outside of the Vam file itself, and the Vam file contains only a pointer to the filename.
In the above syntax, <matrix_name> is the name of a matrix in the VAM.CFG file; it must have the letter ‘p’ in the “lags” position. The <packed_matrix_filename> is name the DOS name of the packed matrix file (these files always have the .PMX extension, but the .PMX should be included in the name.) The format of the data which follows is:
<year> <row> <num_non-zero_elements> <col1> <element1> <col2> <element2> ...
For example:
pmatin bm bm.pmx 1985 1 5 # row 1 has 5 non-zero elements 1 0.656 7 0.352 11 0.038 23 0.019 27 0.218 3 2 # row 3 has 2 non-zero elements 7 0.098 51 0.923 ...
If the matrix is available for several years, the data for all years should be introduced with only one pmatin command, with each year’s data preceded by the number of the year. It is essential that the year numbers be in 4-digit format, i.e. use 1987 please, not 87. If a cell is non-zero in any year for which there is data, the packed matrix will have a place reserved for it in all years.
Related Topics: VAM.CFG File, matin, pmatin1, pmfile, pmpunch
- pmatin1 <matrix_name> <packed_matrix_filename>
An alternative way of introducing data into packed matrices is the pmatin1 command. The format is just like that of the pmatin command, except that the data should be arranged in rectangular rows and columns like the matin command. For example, if you wish to treat as a packed matrix a 3 x 3 matrix known as B in the Vam file, you can introduce it with the pmatin1 command as follows:
pmatin1 B B.pmx 1995 1 0 0 5 0 1 6 2 0 1996 1.5 0 0 6 0 2 7 3 1
Note that in the above example, only those cells that are zero in all years will be left out of the packed matrix. Cell (3,3) actually will be stored since it has a non-zero value in 1996. As with the pmatin command, you should put the data for all years you want to read in the same file, and use only one pmatin1 command per matrix.
- pmfile <matrix_name> <packed_matrix_filename>
The pmfile command associates a matrix name with a particular packed matrix file. This is useful when you need more than one version of a matrix. For example, one copy might hold coefficients, and the other copy hold flows. Or, suppose we wished to study the effects of changes in the A matrix and the A matrix was packed, then we would need two different .PMX files. If the original was called AM.PMX, then to create the alternative, say, AMALT.PMX, we would go to the DOS prompt via File | DOS and do:
copy am.pmx amalt.pmx copy hist.vam vamalt.vam
Then from G7’s command box do:
vam vamalt b dvam b pmfile am amalt.pmx
This pmfile command will both assign AMALT.PMX to be used whenever the am matrix is referred to, and put AMALT.PMX into AMALT.VAM as the name of the file to be used for the packed am matrix.
- pmmode { “simple”| “advanced” }
Note that the <packed_matrix_filename> setting is limited to 30 characters, including any path specification. Sometimes more than one vam bank is loaded in G7, where the vam banks include packed matrix files with the same name but that are stored in different locations. Sometimes it is not convenient to reset the link for each vam bank using the pmfile command, or perhaps inclusion of a full path specification would be needed to distinguish between the files but the full specification exceeds the limit of 30 characters. In such cases, it might be useful to specify a link to each packed matrix file relative to the placement of the corresponding vam bank. By default, G7 will assume that the packed matrix file is in the current working directory, or, if a relative path is specified, that the specification is relative to the current location. This behavior can be controlled with the pmmode command. The pmmode simple command corresponds to the default behavior. The “advanced” mode instructs G7 to attempt to find PMX files in the same location as the corresponding vam bank, or if a relative path is specified for the PMX file, the root location should be the location of the parent vam bank.
- pmpunch <filename> <matname> [decs]
The non-zero elements of the matrix <matname> are written into the named file as input for the pmatin command. The <decs> argument gives the number of decimal places. The years written are determined by the current values of fdates. This command especially is useful for converting a rectangular matrix in a Vam file into a packed matrix. One writes it out as an ASCII file with this command and then reads it in with the pmatin command.
- psras [-f] <matrix> [r <group_exp>] [c <group_exp>] <rowcon> <colcon> [year] <r | c> [cnt]
This “proportional scaling” routine is another form of the ras command.. However, in the case where some of the matrix cells are negative, the proportional scaling changes all elements in the same proportion.
The procedure can be seen most easily by writing down what the \(X\) vector is after scaling, call this \(X^*\). This is determined in proportional scaling by the following equation:
\[x^{*}_{i} = x_{i} + \frac{ |x_{i}| }{ \sum |x_{i}| }\left( c - \sum x_{i} \right)\]The intuition behind this scaling is that it preserves the proportion between the difference of the old and new valuesand the final scaled values. One of its strengths is that it is able to provide a result when for example, all the elements of \(X\) are negative, yet the control total is positive.
Related Topics: Ordinary RAS, ras, rdras
- punch <punchfile | “off”>
The punch command is used to open up equation files for writing using the ipch command. These files usually have the extension .EQN, and are used in Interdyme models to construct an Equation object, which contains regression parameters, values of rho, equation types and other information for multisectoral regression equations. To close the file, use “punch off”.
The punch command usally is given at the beginning of a large regression add file. It often is useful to use the fadd command, along with an argument file that contains sector numbers, titles, equation types, starting dates, and other information that changes with each sector. Within the body of the fadd, a (r)egress command will be given followed by an ipch command. This will estimate the regression, and put the equation results into the equation file.
Related Topics: Interdyme, fadd, ipch, pch, regress, vp, zip
Related Topics: vp
- pwd
The pwd command prints the path of the current working directory.
Related Topics: cd