Shock Statements for GEMPACK CGE Modeling

In the command file (*.cmf), we generally use shock statements using the shock syntax,

shock <variable-name> = ..... ;
shock <variable-name> <components-name> = ..... ;

Following the ‘=’ sign, there could be a list of values, a possible file name or various other ways of supplying a list of shock values needed to be applied to the shocked variable.

….ONLY VARIABLES WITH AT LEAST SOME COMPONENTS EXOGENOUS CAN HAVE SHOCK STATEMENTS….

Exogenous pop("IND");
shock pop(REG) = uniform 7;

Here both exogenous components of variable ‘pop’ are shocked by 7%. The keyword uniform means that all shocked components of this variable are given the same shock.

Shocking macro variables
To shock macro (ie scalar) variables, simply list the variables and shocks:

shock pfactwld = 10;
shock txs(REG) = -10;
shock tms(REG) = 8.56;

Shocking a single component of an array variable
to shock a single component of a vector or matrix variable, put the element(s) name between double quotes:

shock tms("IND") = 3;
shock avaall("capital", "IND", "AUS") = 3.4;

Shocking all exogenous components of an array variable with same value

shock tms(COMM,REG,REG) = uniform 3.5;

Shocking all exogenous components of an array variable with same value

shock tms("pdr",REG,REG) = uniform 4.44;

Reading non-uniform shocks from a file
A common situation is that ALL elements of a matrix or vector variable are exogenous, and ALL must be shocked – with non-uniform values. This may require a large number of shocks. A good way to do this is to read the shock from a header array (HAR) file with statements like:

shock tms = file shocks.har header "T1";

The ‘tms’ variable is completely exogenous and has dimensions COMM*REG*REG. Thus, the header T1 should have the same dimensions. Alternatively, we can use,

shock tms(COMM,REG,XSA) = file shocks.har header "T2";
Shock tms(COMM,REG,XSA) = select from flie shocks.har header "T3";

SOME EXAMPLES

All components exogenous and all components shocked:

shock avaall = file allshocks.HAR header "ALL3" ;

All components exogenous and some components shocked:

shock avaall(COMM,"dom",LKA) = file allshock.HAR header "DOM3" ;
or
shock avaall("COMM1","dom",LKA) = file allshock.HAR header "COMM1" ;

Some components exogenous and the same components are shocked:

exogenous avaall(COMM,"dom","LKA1");
shock avaall = file allshocks.HAR header "LKA1" ;
or
shock avaall(COMM,"dom","LKA1") = file allshocks.HAR header "LKA1" ;

Some components exogenous and a subset of the components are shocked:

exogenous avaall(COMM,"dom",IND) ;
shock avaall(MARG,"dom",IND) = select from file allshocks.HAR header "ALL1" ;
or
exogenous avaall(COMM,"dom",IND);
shock avaall("COMM1","dom",IND) = file allshocks.HAR header "ALL4" ;

When to use “Select from”

When shocks are read from a file, the general form of th statement is,

shock <variable><components> = file | select from <filename><header><slice> ;

If <component is omitted, ALL EXOGENOUS components of the variable are shocked.
The following explains how “select from” works,

  • when we specify “select from”, there must be exactly as. numbers on the file (or on the RHS) as there are components (exogenous or endogenous) in <variable>. Then shocks to the specified components of <variable> are selected from the corresponding components in the file.
  • when we do not specify “Select from” the amount of data on the file (or on the RHS) must be exactly the same as the number of components of <variable> being shocked in this statement.

Shocking a variable with NO COMPONENT exogenous

A possible statement on Command files for GEMSIM is,

statements to shock variable with non exogenous are ok = yes|NO ;

The default is “no” which means that a statement

shock <variable> = ..... ;

is only allowed if <variable> has at least one exogenous component.

However, in handling inequalities (such as quotas) via the methods described in Bach and Pearson (1996), it is sometimes convenient to put in such a statement even though it may happen that no components of the variable in question are exogenous. When using that methodology, you can put the statement

statements to shock variable with none exogenous are ok = yes ;

in our Command file to avoid having to comment out certain “shock” statements in those cases (not easy to predict in advance using this methodology) where no components of the variable are exogenous.