Reading large numbers of shocks from a SHK or HAR file


The Shocks page makes it easy to apply individual shocks, but it is not intended that your list of shock statements be very long. You have two techniques to ease the burden.

Technique A: Define your own subsets...using the CMFSTART file.

For example, your shock memo might contain

Shock tms(FOOD_COMM,SSA_REG,NSSA_REG) = select from file TMS.SHK;

or

Shock tms(FOOD_COMM,SSA_REG,NSSA_REG) = target% 5 from file TMS.SHK;

Above, FOOD_COMM is a subset of REG, and SSA_REG and NSSA_REG are subsets of REG. The shocks statements above apply whole blocks of shocks simultaneously. The file TMS.SHK contains the shocks to powers of tariffs needed to eliminate the tariffs. So, the first shock statement abolishes tariffs on food going from SSA to the other, NSSA, regions. The second statement sets the same tariffs to 5%.

Technique B: Create your own shock files

To impose your own special structure of shock values, create your own shock file (suffix SHK in the version folder). For example, your shock memo might contain:

Shock tms(FOOD_COMM,SSA_REG,NSSA_REG) = select from file MyOwnTMS.SHK;

You would construct the file, MyOwnTMS.SHK, following the format of TMS.SHK (blank lines

and text following the ! character may be omitted).

The original file TMS.SHK was created by the program SHOCKS.TAB. If you have GEMPACK, you could adapt this to create and run (outside RunGTAP) your own version, MySHOCKS.TAB, which would create your file MyOwnTMS.SHK.

To learn more about GEMPACK shock statements, consult the GEMPACK manual at http://www.copsmodels.com/gpmanual.htm#gpd3.5.5. The following is a very brief summary:

Two independent choices when using shock files

Do you want to use HAR or SHK (GEMPACK text) files to store shock values?

SHK (GEMPACK text) files can be created with Excel, a text editor, or a TABLO program. The disadvantage is that each SHK file can only hold one array of numbers. You can open SHK files (as GEMPACK text) from ViewHAR. Your shock statement will resemble:

Shock tms(Food,REG,REG) = select from file TMS.SHK;

To create HAR files, use a TABLO program or ViewHAR. The advantage is that a HAR file may hold several arrays of numbers on different headers, and is more convenient to view. Your shock statement will resemble:

Shock tms(Food,REG,REG) = select from file MyShock.Har header H031;

Do you want GEMPACK to select just some of the numbers on file?

Suppose you want to shock every element of some variable. Then you can use shock statements like:

Shock tms = file TMS.SHK

Shock tms = file MyShock.Har header H031;

Suppose you have 3 regions and 3 goods, so that tms has 27 elements, GEMPACK will expect to find 27 numbers on the file.

However, a common situation is that the file holds shock values for all elements of the shocked variables, but you only want to use some of these. Suppose you have 3 regions and 3 goods. You might use shock statements like:

Shock tms(Food,REG,REG) = select from file MyShock.Har header H031;

Again GEMPACK will expect to find 27 numbers on the file, but only those 9 matching the Food element will be used.

If you wrote

Shock tms(Food,REG,REG) = file MyShock.Har header H031;

GEMPACK will expect to find just 9 numbers on the file (shocks to the Food element). But this variation is not used very frequently.

Note that the two shock statements:

Shock tms(TRAD_COMM,REG,REG) = select from file TMS.SHK;

Shock tms = file TMS.SHK;

have the same effect, since tms is dimensioned TRAD_COMM*REG*REG. In each case all 27 elements are shocked.

Mark Horridge recommends:

Normally, store shocks on a HAR file and use the select from syntax.

See also:

Shocks

Shocks to tax rates

Loading SHF files of Shocks

Saving SHF files of Shocks



URL of this topic: www.copsmodels.com/webhelp/rungtap/hc_toomanyshocks.htm

Link to full GEMPACK Manual

Link to GEMPACK homepage