Results Do Add Exactly for Some Equations


This section is for experienced GEMPACK users. Others can ignore it.

Consider levels equations consisting of sums of levels variables on both sides. For example

D = E + F

D + E = F + SUM(s,SRC, G(s))

We call these adding-up levels equations.

Consider such a levels equation which is a consequence of the levels equations underlying the equations of the model (as in the TAB file). Suppose that you linearise this equation using change differentiation using linear variables in the model. Then, provided that you have loaded the pre-simulation values of the Coefficients, the results shown in AnalyseGE for the two sides of the linearised equation will be equal. We explain this below in the section headed "Why Does This Happen?" below. [You get the pre-simulation values of the Coefficients when you load the SLC file.]

Examples are equations adding values or quantities and market clearing equations. We give more examples later.

Note that, for these equations, the two sides equal each other irrespective of the solution method and number of steps taken, and irrespective of how accurate the solution is. We confirm this in the "proof" below.

Why Does This Happen?

1. Simple Equation

Consider the simple levels equation

D = E + F

We will prove the result in this case. Then, later, we will prove it for more complicated equations (see "2. More Complicated Equations" below).

1(a) Change Variable case. First suppose that there are change variables c_D, c_E and c_F in the model representing the changes in D, E and F respectively. Then the associated linearised equation is

C_D = c_E + c_F [1]

This linearised equation is satisfied for every step of a multi-step calculation (since the levels equation is a consequence of the levels equations in the model). Now, when GEMPACK calculates the change across several steps of a multi-step calculation, it simply adds the changes from the separate steps. [What else could it do?] Hence the linearised equation [1] above is satisfied by the multi-step results for variables c_D,c_E and c_F. Hence the equation [1] will also be satisfied after we extrapolate (since the extrapolated values are some pre-determined linear combination of the results from the separate multi-step calculations). This proves that

c_DSIM = c_ESIM + c_FSIM [1B]

where c-DSIM, c_ESIM and c_FSIM are the simulation results for the variables c_D, c_E and c_F respectively. This is the desired result in this change variable case.

1(b) Percent-Change Variable case. Secondly, suppose that there are percentage change variables p_D, p_E and p_F in the model representing the percentage changes in D, E and F respectively. Then, if you differentiate using change differentiation, the linearised equation is [1] above. But c_D = (D*p_D)/100 and similarly for c_E and c_F. Hence the linearised equation is

(D*p_D)/100 = (E*p_E)/100 + (F*p_F)/100 [2A]

or, multiplying both sides by 100,

D*p_D = E*p_E + F*p_F [2B]

If there were also change variables c_D, c_E and c_F in the model representing the changes in D, E and F respectively, we know that equation [1B] above would be satisfied. We also know (from the way in which GEMPACK reports results) that, for any levels variable or Coefficient V,

c_VSIM = (VORIG*p_VSIM)/100

where VORIG is the pre-simulation value of V, c_VSIM is the simulation result for the linear variable c_V representing the change in V and p_VSIM is the simulation result for the linear variable p_V representing the percentage change in V. Hence, from [1B] we know that

(DORIG*p_DSIM)/100 = (EORIG*p_ESIM)/100 + (FORIG*p_FSIM)/100 [2C]

or, multiplying both sides by 100,

DORIG*p_DSIM = EORIG*p_ESIM + FORIG*p_FSIM [2D]

Note that DORIG, EORIG and FORIG are the pre-simulation values of coefficients D, E and F respectively, and p_DSIM, p_ESIM and p_FSIM are the simulation results reported for variables p_D, p_E and p_F respectively. When you evaluate the two sides of linearised equation [2] in AnalyseGE, you get the two sides of [2C] or [2D], as claimed. [When you look at equation [2] in AnalyseGE, AnalyseGE sets the Coefficients equal to their pre-simulation values, as taken from the SLC file loaded, and AnalyseGE set the linear Variables equal to their simulation results, as taken from the Solution file loaded.]

This proves what we have claimed for the linearised equations [2A] and [2B] above.

1(c) Mixed Case. Now suppose that some we have in the model percentage-change linear variablers corresponding to some of the levels variables and change linear variables corresponding to the other levels variables. For example, suppose that the linearised equation is

D*p_D = E*p_E + 100*c_F [3]

Then it is easy to see from the arguments above that this linearised equation [3] is satisfied when you substitute in the pre-simulation values of D and E and the simulation results p_D, p_E and c_F for the variables.

2. More Complicated Adding-up Levels Equations

There are many different examples, including

D + E = F + SUM(s,SRC, G(s)) [4]

D + SUM(I,IND, V1(i)) = F + SUM(c,COM,SUM(s,SRC, H(s,c))) [5]

and so on. It is easy that the arguments in the simple case 1 above apply equally well to these more complicated equations.

Notice that the arguments above work irrespective of how many steps are taken and whether or not extrapolation is used. So they apply to all solutions produced by GEMPACK, whether or not they are accurate solutions, and whatever solution method is used.

What Does Change Differentiation Mean?

By change differentiation, we mean that you linearise by replacing every quantity V in the levels equation by its change c_V. If the linear variable in the model associated with V is a percentage-change variable p_V, then replace c_V by (V*p_V)/100.

For example, the linearised versions of [4] and [5] above obtained in this way are

D*p_D + E*p_E = 100*c_F + SUM(s,SRC, G(s)*p_G(s)) [4L]

D*p_D + SUM(I,IND, c_V1(i)) = 100*c_F +

SUM(c,COM,SUM(s,SRC, H(s,c)*p_H(s,c))) [5L]

if the linear variables associated with D, E, F, G(s), V1(I) and H(s,c) are p_D, p_E (percentage changes), c_F (change variable), p_G(s) [percent change], c_V1(i) [change] and p_H(s,c) [percent change].

Notice that the arguments above work irrespective of how many steps are taken and whether or not extrapolation is used. So they apply to all solutions produced by GEMPACK, whether or not they are accurate solutions, and whatever solution method is used.

Checking This in AnalyseGE

To check this for any suitable linearised equation in the TAB file, decompose the equation and select Whole equation as the "Part to Decompose" choice. You can select either "Complete" or "Intelligent" as the "Type of Decomposition". When we say "add up exactly" we mean allowing for the usual rounding errors which occur when you add up lost of numbers on a computer.

Note that the arguments above

· do not require the adding-up levels equation to be explicitly in the model. It is sufficient that the levels can be deduced from levels equations in the model.

· do not require the linearised equation obtained by change differentiation to be in the TAB file. [If it is not, you could enter the two sides separately into the memo on the AnalyseGE form and evaluate them.]

· do require that the linear variables in the linearised equation are explicitly in the model (so that the simulation results for them are directly available from the Solution file).

Some of the examples below will help to clarify these points.

Examples

ORANIG contains likely looking several examples. These include

· the equation adding up the value of GDP from the income side:

Equation E_w0gdpinc

V0GDPINC*w0gdpinc = V1PRIM_I*w1prim_i + 100*delV0tax_csi;

This is a simple and straightforward example. There are 2 percentage-change variables w0gdpinc and w1prim_I, and the change variable delV0tax_csi. You can check that this equation adds up exactly if you load any ORANIG solution into AnalyseGE and decompose all of this equation using the intelligent or complete decomposition.

· the equation adding up taxes

E_delV0tax_csi delV0tax_csi = delV1tax_csi + delV2tax_csi

+ delV3tax_cs + delV4tax_c + delV5tax_cs

+ delV0tar_c + delV1PTX_i + 0.01*V1OCT_I*w1oct_i;

This is a simple and straightforward example. All the linear variables are change variables except for the percentage-change variable w1oct_i.

GTAP contains a few examples. These include

· the market clearing equation for domestic commodities

Equation MKTCLDOM

(all,i,TRAD_COMM)(all,r,REG) qds(i,r)

= sum(j,PROD_COMM, SHRDFM(i,j,r) * qfd(i,j,r))

+ SHRDPM(i,r) * qpd(i,r)

+ SHRDGM(i,r) * qgd(i,r) ;

Here all variables are percentage-change variables. The SHRxxx Coefficients are shares. The levels equation underlying this says that QDS_L(I,r) is the sum of QFD_L(I,j,r) across firms together with QPD_L(i.r) and QGD_L(i,r) [private and government demand for commodity i in region r]. If you apply change differentiation to this and introduce the percentage change variables qds, qfd, qpd and qgd, you get something like (omitting the (i,r) subscripts)

QDS_L*qds = SUM(j,PROD_COMM,QFD_L*qfd) + QPD_L*qpd+QGD_L*qgd

By the arguments above, this equation is satisfied exactly in AnalyseGE. That is, in the notation used in equations [2C] and [2D] earlier,

QDS_LORIG*qdsSIM = SUM(j,PROD_COMM,QFD_LORIG*qfdSIM)+

QPD_LORIG*qpdSIM + QGD_LORIG*qgdSIM

If you then divide both sides by QDS_LORIG you get the share form of MKTCLDOM shown above. [In the TAB file, the shares SHRDPM and so on are calculated as dollar value shares. But the prices in these dollar values are common. So the pre-simulation values of these shares are equal to the pre-simulation values of the quantity shares QPD_LORIG/QDS_LORIG and so on. You can check that this equation adds up exactly if you load any ORANIG solution into AnalyseGE and decompose all of this equation using the intelligent or complete decomposition.

· the market clearing equation for margins commodities:

Equation MKTCLTRD_MARG

# eq'n assures market clearing for margins commodities (HT 1) #

(all,m,MARG_COMM)(all,r,REG)

qo(m,r) = SHRDM(m,r) * qds(m,r)

+ SHRST(m,r) * qst(m,r)

+ sum(s,REG, SHRXMD(m,r,s) * qxs(m,r,s))

+ tradslack(m,r) ;

This is similar to the MKTCLDOM example above.

Non-examples

ORANIG contains examples which look as if they should work. However, on closer inspection, you will be able to see that they don't add up exactly. The examples include

· the equation adding up values of other cost tickets:

Equation E_w1oct_i

ID01[V1OCT_I]*w1oct_i = sum{i,IND, V1OCT(i)*[x1oct(i)+p1oct(i)]};

This looks like a suitable example. However the change differentiation technique described above would have V1OCT(i)*p_V1OCT(i) on the RHS. This has p_V1OCT(i) instead of x1oct(i)+p1oct(i). You may think that these two will give the same values when evaluated in AnalyseGE. They will be in the first step of a multi-step calculation, but not over two or more steps (if both the price and quantity change). [Indeed, if you solve the model accurately, the simulation result p_V1OCTSIM(j) for variable p_V1OCT(i) will be equal to x1octSIM(i)+p1octSIM(i)+x1octSIM(i)*p1octSIM(i)/100.]

Note that, if there were a variable p_V1OCT(i), which represents the percentage change in V1OCT(i), explicitly in the model then the similar looking linearised equation

ID01[V1OCT_I]*w1oct_i = sum{i,IND, V1OCT(i)*p_V1OCT(i)};

would be satisfied. [This is subtle, isn't it? At first we thought that the original equation should be satisfied exactly. It was only when we looked at numerical examples that we realised that it wasn't. This explains why we say that this Help topic is only for experienced users.]

GTAP also contains examples that you might think should be satisfied exactly, but which are not for various subtle reasons. These include

· the equation adding up the value of GDP on the income side:

Equation VGDP_r # change in value of GDP (HT 70) #

(all,r,REG)

GDP(r) * vgdp(r)

= sum(i, TRAD_COMM, VGA(i,r) * [qg(i,r) + pg(i,r)])

+ sum(i, TRAD_COMM, VPA(i,r) * [qp(i,r) + pp(i,r)])

+ REGINV(r) * [qcgds(r) + pcgds(r)]

+ sum(i,TRAD_COMM, sum(s,REG, VXWD(i,r,s) * [qxs(i,r,s) + pfob(i,r,s)]))

+ sum(m,MARG_COMM, VST(m,r) * [qst(m,r) + pm(m,r)])

- sum(i,TRAD_COMM, sum(s,REG, VIWS(i,s,r)* [qxs(i,s,r) + pcif(i,s,r)]));

This would add up if the "quantity+price" terms were replaced by an explicit linear variable representing the percentage-change in the corresponding dollar values. [There is no such linear variable in the standard GTAP.TAB. As in the E_w1oct_I ORANIG equation above, qg+pg is the percentage-change in the dollar value VGA in one step, but not in a multi-step calculation.]

· the equation calculating the GDP price index:

Equation PGDP_r # GDP price index (HT 71) #

(all,r,REG)

GDP(r) * pgdp(r)

= sum(i, TRAD_COMM, VGA(i,r) * pg(i,r))

+ sum(i, TRAD_COMM, VPA(i,r) * pp(i,r))

+ REGINV(r) * pcgds(r)

+ sum(i, TRAD_COMM, sum(s,REG, VXWD(i,r,s) * pfob(i,r,s)))

+ sum(m, MARG_COMM, VST(m,r) * pm(m,r))

- sum(i, TRAD_COMM, sum(s,REG, VIWS(i,s,r)* pcif(i,s,r))) ;

This does not add up exactly because there is no levels variable corresponding to the Divisia price index pgdp. [That is, this linear equation does not come from any levels equation, let alone an "adding-up" levels equation.] Also the Coefficients GDP, VGA and so on are not related to the pre-simulation values of these prices, rather to the pre-simulation dollar values or quantities.



URL of this topic: www.copsmodels.com/webhelp/analysege/hc_somedoadd.htm

Link to full GEMPACK Manual

Link to GEMPACK homepage