If Y = -X, Why Are the Results for Y Not the Negative of Those for X? Analysege: Software
Total Page:16
File Type:pdf, Size:1020Kb
If y = -x, why are the results for y not the negative of those for x?
0
Abstract
Here x and y are percentage change variables in a linear equation in a TAB file.
Modellers are often puzzled as to why simulation results for y are not the negative of those for x. For example, if you solve the underlying model accurately, if x increases by 10% you will find that y only decreases by about 9.09%. Below we explain why.
1 Think About the Underlying Levels Equation
It is helpful to think about what the underlying levels equation must be since accurate simulations via GEMPACK solve the underlying levels equations accurately.
As we show in section 1.1 below, the linear equation
y = –x comes from the levels equation
Y = 1/X
Or, more accurately, from an equation Y = C/X where C is any constant (for example, Y = 23/X).
Once you focus on the levels equation Y = 1/X, it is easy to see why an accurate result for y is not the negative of the result for x, as the numerical example in section 2 makes clear.
1.1 Linearising Y = 1/X
As usual, linearising an equation by hand is done by differentiation – see section 9.2 of the Release 8 version of GEMPACK document GPD-2.
When doing this, we use c_X to indicate the change in X and p_X to indicate the associated percentage change in X. Of course these are related via
p_X = 100*c_X/X
So let's linearise Y = 1/X. Differentiating both sides gives c_Y = [–1/X*X]*c_X = –[c_X/X] * [1/X] = –[c_X/X] * Y since Y = 1/X. Hence we see that c_Y/Y = –c_X/X
1 Multiplying both sides by 100 gives
100*c_Y/Y = –100*c_X/X and hence (remembering how p_X is related to c_X) we see that p_Y = –p_X as required.
Thus the linearised version of the levels equatino Y = 1/X is
y = –x in the usual notation where lowercase letters y and x denote percent changes in Y and X respectively.
1.1.1 Linearising Y = C/X
You might like to repeat the above for this equation where C is a constant. You will find that again the linearised equation is y = –x.
2 Numerical Example – 20% Increase in X
Consider the levels equation Y = 1/X and suppose that, initially, X and Y both start with the value 1. Consider a 20% exogenous increase in X. Then X will move from 1.0 to 1.2 and hence Y will move from 1 to 1/1.2=0.833333. Hence the resulting change c_Y in Y is – 0.1666667 and so the percentage change y in Y is –16.66667, which is not the same as –20.
2.1 2-Step Euler Calculation
It is instructive to follow through a 2-step Euler calculation as would be done by GEMPACK for the above example. The linear equation is y = -x and both X and Y start from the value 1.
In the first step, half of the shock is applied to X. X is to change from 1.0 to 1.2 over the whole simulation. So the change in X in the first step is just half of that – namely an increase of 10% (or 0.1) so X moves from 1.0 to 1.1 in this step. What happens to Y? It begins at 1.0 and the equation y = -x says that y (the percent change in Y) in this step will be equal to –10. So Y decreases by 10% which means that it goes from 1.0 to 0.9 in this step.
In the second step, X increases from 1.1 to 1.2, which is an increase of 100*0.1/1.1=9.0909%. Hence y (the percent change in Y) will be –9.0909. That means that Y decreases from 0.9 to
0.9*[1 – 9.0909/100] = 0.8181.
Hence, over the whole 2-step Euler calculation, X increases by 20% (exogenously) while Y decreases from 1.0 to 0.8181 which is a decrease of only 100*0.1819/1=18.19%. So you see that the 2-step Euler result for y is not the negative of that for x.
It is instructive to note that increasing X by 20% in a 2-step calculation does not increase X by 5% in the second step, but by slightly less than 5%. That is because a 5% increase followed by a 9.0909% increase compounds to exactly a 10% increase.
2 decreasing Y by 10% in the first step and then by 9.0909% in the second step does not result in an overall 19.0909% decrease in Y but slightly less, namely a decrease of 18.19%.
In section 2.3 below we show you a TAB file and associated Command file. You can run with these to reproduce the numerical results above.
2.2 Compounding is the Answer to the Puzzle
Summary. 1. Note that in the 2-step calculation above, the percent change y for Y in each step is the negative of the percent change x for X in each step (as you would expect). 2. The key to the puzzle is the compounding of results: the compound effect of –10% then –9.0909% (for y) is not the negative of the compounding effect of +10% and +9.0909% (for x).
Another way of looking at compounding of results is to consider fractional changes (the ratio of the change to the original value – these are one hundredth of the percentage change). [In the 2-step example above, the fractional change in x in the first step is f1=0.1 while, in the second step, it is f2=0.0909.]
In general, if f1 and f2 are positive fractional changes, the compound effect of +f1 and +f2 is f1+f2+f1*f2 since (1+f1)*(1+f2)=1+f1+f2+f1*f2. This is MORE than f1+f2. the compound effect of –f1 and –f2 is –[f1+f2–f1*f2] since (1–f1)*(1–f2)=1–f1–f2+f1*f2. The number here f1+f2–f1*f2 is LESS than f1+f2.
Note also that for a 1-step calculation, the y result will be the negative of the x result. [There is no opportunity for compounding to get into the act.]
2.3 TAB and Command File for this Example
Consider the TAB file RECIP.TAB and the associated Command file RECIP.CMF shown below. You might like to type in and save these files on your computer.
! RECIP.TAB ! Coefficient X_L # Levels value of X # ; Coefficient Y_L # Levels value of Y # ; Formula (initial) X_L = 1 ; Formula (initial) Y_L = 1 ; Variable x # percent change in X # ; Variable y # percent change in Y # ; Update X_L = x ; Update Y_L = y ; Write X_L to terminal ; Write Y_L to terminal ; Equation E_y y = -x ; Write (postsim) X_L to terminal ; Write (postsim) Y_L to terminal ;
! RECIP.CMF dws = yes ; ! writes to terminal at all steps auxiliary files = recip ; log file = yes ; exogenous x ;
3 rest endogenous ; method = euler ; steps = 2 ; shock x = 20 ; verbal description = test of y=-x ;
We suggest that you run this and look at the log file RECIP.LOG. The "dws = yes ;" statement in the Command file means that the values of X_L and Y_L are written in the LOG file at the start of each step (steps 1 and 2). The (postsim) writes show the post-simulation values of X_L and Y_L. Check from the log file that X_L = 1 1 and Y_L = 0.9 at the start of step 2 (that is, after step 1), and X_L = 1 2 and Y_L = 0.8181 in the postsim write (that is, after step 2).
Note that the Update statements are the formal connection between the levels values X_L,Y_L and the associated percent changes x,y respectively. You should interpret the update statement for Y_L as meaning
Updated Y_L = old Y_L * [1 + y/100]
This happens at each step. The calculation of the value of Y_L=0.8181 at the end of the second step shown in section 2.1 above is an example of this formula.
2.4 More Accurate Solve
You might like to solve the RECIP.TAB model more accurately. For example, change to "method = gragg ;" and "steps = 4 6 8 ;" in RECIP.CMF and run it. You will find that y = –16.6667 as expected from our calculation above in section 2.
3 Numerical Example – Two 10% Increases in X
Here consider two (exogenous) increases of 10% in X, one after the other. [This is NOT how GEMPACK does a 20% shock to X as you have seen above). But it is gives a little more intuition about the calculations above.
First note that two increases of 10% compounds to more than 20% (actually to 21%). {First X goes from 1 to 1.1. Then X goes from 1.1 to 1.1*[1 + 10/100] = 1.21.}
But two decreases of 10% compounds to less than –20% (actually to –19%). {First X goes from 1 to 0.9. Then X goes from 0.9 to 0.9*[1 – 10/100] = 0.81.} Note that, in the second "step", 10% of the smaller value (0.9 after the first "step") is less than 10% of the original value.
If you have not already installed AnalyseGE, please do so now, following the instructions in section Error: Reference source not found. Loading the Example Simulation Results
Start AnalyseGE running by double-clicking on its icon. Click on the Select/Change button and select the Solution file GTMSEUFG.SL4 (in the subdirectory GTAP1 of the directory in which AnlayseGE is installed). This Solution file contains the results of the GTAP application you will analyse in section ??.
4 If you are working with RunGTAP,1 you can load the results as follows.
Start RunGTAP running, change to Version ACORS3X3, go to the Solve page and Load experiment called TMSeufg. Then click on the Solve button.
When the simulation has finished (and you have clicked OK), click on View | Results using AnalyseGE under the View menu.2 This is also the simulation you will analyse in section ??.
AnalyseGE has 3 forms (or windows). The main one you will use is the TABmate form which will contain the TABLO Input file3 (usually called GTAP.TAB4) for the GTAP model. [AnalyseGE extracts this from the Solution file.] Much of the analysis can be done by selecting and clicking on equations in the TABLO Input file, as you will see below. The other two forms are the ViewHAR form (which will show the numerical results of various calculations) and the AnalyseGE form (which is the form shown each time AnalyseGE starts).
Go to the TABmate form (which is probably already the top one of the three forms associated with AnalyseGE).
AnalyseGE makes it easy to see the values of any variable or coefficient.
To see this, find the declaration of variable qo (for example, using the Search menu). Left- click anywhere in this declaration. Then right-click anywhere on the TABmate form.5 A menu will appear. Select the option Evaluate this Variable. A ViewHAR window will appear to show the values of all components of variable qo. For example, you can see the percentage change in the output of food in EU in this simulation. To get back to the TABmate window, select menu item Front | Bring TABmate to the front from ViewHAR’s main menu.6
To see the corresponding feature for Coefficients, go to the top of the TABmate form (click there) and then find the declaration of coefficient VDFA(i,j,r) . First left-click on this and then right-click and select the menu option Evaluate this Coefficient. Again the ViewHAR window will appear. As usual with ViewHAR, because this coefficient has 3 indices (i,j,r) you will probably see the values summed over the third index r in REG. You can manipulate the drop-down combo boxes in the top right-hand corner of the ViewHAR form to see, for example, the value at agents’ prices of domestic purchases of food by the Manufacturing (mnfcs) firms in Sub-Saharan Africa (SSA).
1 We assume in this document that you are using Version 3.10 (June 2001) or later of RunGTAP. 2 If the menu item Results using AnalyseGE is not visible (or is greyed out), this is because of a small bug in RunGTAP. You can either download a bug fix for RunGTAP from the GTAP web site or (probably easier), load the example simulation as described in the alternative point 1 in the text. 3 The TABLO Input file contains the equations of the model written in algebraic form [see Harrison and Pearson (1996).]. [It is similar to the .GMS file used with GAMS.] 4 AnalyseGE may call this something like AN1.TAB. This file is put into a temporary directory after AnalyseGE extracts it from the Solution file. 5 Your mouse has two (or possibly three) buttons. Left clicking uses the left-hand one, while right-clicking uses the right-hand one. In this document, we often just say "click" when we mean left-click. But we will not abbreviate "right-click". 6 That is, first click on Front in the main menu, then select option Bring TABmate to the front from the menu which appears.
5 You can also find the values of variables or coefficients from any equation or formula where they appear. To see this, return to the TABmate form, go to the top and then find the equation MKTCLTRD_NMRGVSHRDMOM(i,r)*qods(i,r) for each i in NMRGTRAD_COMM and each r in REG.
You can also enter expressions to be evaluated in the memo on the AnalyseGE form.
To see this, bring the AnalyseGE form to the front via menu item Front | Bring AnalyseGE to front . Then click on the Clear button to clear the memo. Now type
VDM(i,r)*qds(i,r) ; into this memo. [Don’t forget the final semi-colon ; .] Now click on the Evaluate button. Yet again the ViewHAR form will appear and show the values of this expression for each i in TRAD_COMM and each r in REG.
AnalyseGE has more sophisticated features.
For example, it is able to decompose the terms on the right-hand side of a formula or equation and show you the values of all terms. We will not illustrate this here since you will see plenty of examples in the analysis below.
If you click and then right-click on various statements in the TABmate form, you often find more sophisticated options than the simple “"Evaluate
]
Looking at the Values in the ViewHAR Form Each time you evaluate a variable, coefficient or expression, AnalyseGE adds two headers to the ViewHAR form being built up. The header you always see is the one containing the values. There is also a second header which contains the full expression evaluated. To see this, bring the ViewHAR form to the front and click on the Contents menu item. You will see headers with names E001, R001, E002, R002 and so on. These are in pairs: the Exxx header contains the expression and the Rxxx header contains the values. For example, if you double-click on the header E003 you will see the expression
(All,i,
6 First Application – Eliminating One Import Tariff In this section we show you how you can use AnalyseGE to analyse the results of the simulation you loaded into AnalyseGE in section 2. The simulation is as follows.
The data is a 3x3 aggregation of the version 4 preliminary data.7 The aggregation recognises three commodities food, manufactures (mnfcs) and services (svces) and three regions, Sub- Saharan Africa (SSA), European Union (EU) and Rest of the World (ROW). The simulation is one in which the import tariff on food from Sub-Saharan Africa to the European Union is completely eliminated. The shock is –11.5375 per cent to the power of this import tariff.8
Below we describe how AnalyseGE can be used to analyse some of the results of this application. We aim to give sufficient detail to enable you
Price Change at the EU Border The shock is a reduction by 11.5375 percent in tms(“food”,”SSA”,”EU”). The most obvious consequence of this shock is to reduce the price paid in the EU for imports of food from SSA. This is the model result for pms(“food”,”SSA”, “EU”).
The relevant equation is the one called MKTPRICES, which reads9
(All,i,TRAD_COMM)(All,r,REG)(All,s,REG)
“"food”",”"
7 The aggregation is the one known as ACORS3X3 in the current version of RunGTAP. 8 This application is the one analysed in the "Johansen Lab" on day 3 of recent GTAP Short Courses. The analysis in this paper follows similar steps. However the analysis in this paper is based on the accurate solution results (using Gragg 2,4,6 steps) whereas the Short Course analysis is based on the approximate Johansen solution. 9 pms(i,r,s) is the price of imported commodity i from source r in region s. pcif(i,r,s) is the CIF price of this. tms(i,r,s) is the power of the import tariff (that is, 1 plus the ad valorem rate) while tm(i,s) is the power of the import tariff on all imports of i into region s (irrespective of the source region). The variables pms, tm, tms and pcif actually represent the percentage changes in the corresponding levels quantities. The equation is a linearised equation. In order to solve the underlying levels of the model accurately, GEMPACK solves the associated linearised equations several times [see Harrison and Pearson (1996)]. This means that the linearised equations are NOT satisified exactly by the simulation results (as you will see). However they are usually satisfied approximately.
7 8 you canwe
9 10