$TITLE Experiment file for BASIC User version of R23

*################# 18. POLICY EXPERIMENTS ##################

$ontext

This is a standard method for running policy experiments.

The method works by running the policy experiments using a LOOP.
The LOOP is controlled by a SET called sim (for simulations).

It requires two sets of additional parameters. The first carries the
change needed for the policy experiment or simulation. The second
are needed to capture the results from the experiments. Further
explanations are given when the parameters are declared.

The final stage is to get GAMS to DISPLAY the result parameters.

$offtext

*## 18A. SETS AND PARAMETERS FOR POLICY EXPERIMENTS ####

* In this example SIM has five members, although more can be declared.
* By including "base" in the SET a defined comparator is produced

 SET

$ontext
 sim        simulations  /
 base           base experiment
 sim01          experiment

   /

 clos       closures  /
 clbase         experiment closure

 /

 elst       controls for elasticitt sensitivity LOOP /
 elatb          BASE elasticity values
 elstl          LOW  elasticity values 50% of BASE
 elath          HIGH  elasticity values 150% of BASE

 /
$offtext

 sim        simulations

 clos       closures

 elst       controls for elasticitt sensitivity LOOP

 res        set for table of results  /

 resADVA        Shift parameter for CES production functions for QVA
 resADX         Shift parameter for CES production functions for QX in r
 resCPI         Consumer price index - Region numeraires
 resEG          Expenditure by government
 resER          Exchange rate (domestic per world unit)
 resETAX        Export tax revenue
 resFTAX        Factor use tax revenue
 resFYTAX       Factor income tax revenue
 resGDP         Gross Domestic Product by Expenditure definition
 resGLOBESLACK  Slack variable for Globe
 resHTAX        Household income tax revenue
 resINVEST      Total investment expenditure
 resINVESTSH    Value share of investment in total final dom demand
 resITAX        Indirect tax revenue
 resKAPGOV      Government Savings
 resKAPWOR      Current account balance
 resKAPWORSYS   Slack variable for global system
 resMTAX        Ad valorem Import tariff revenue
 resPD          Consumer price for domestic supply of commodity c
 resPE          Domestic price of exports by commodity c
 resPM          Domestic price of competitive imports of commodity c
 resPQD         Consumer price of composite commodity c
 resPQS         Supply price of composite commodity c
 resPT          Price of imported transport services
 resPVA         Value added price for activity a in r
 resPX          Composite price of output by activity a
 resQCD         Household consumption by commodity c
 resQD          Domestic demand for commodity c
 resQE          Domestic output exported by commodity c
 resQGD         Government consumption demand
 resQINT        Agg quantity of intermediates used by activity a in r
 resQINVD       Investment demand by commodity c
 resQM          Imports of commodity c
 resQQ          Supply of composite commodity c
 resQVA         Quantity of aggregate value added for level 1 production
 resQX          Domestic production by activity a in r
 resSHH         Household savings
 resSTAX        Sales tax revenue
 resTOTSAV      Total savings
 resTS          Sales tax rate
 resTV          Value added tax rates
 resTX          Indirect tax rate
 resTYH         Direct tax rate on households
 resVFDOMD      Value of final domestic demand
 resVGDSH       Value share of Govt consump in total final dom demand
 resVTAX        Value added tax revenue
 resWALRAS      Slack variable for Walras's Law
 resYG          Government income
 resYH          Income to household h

    /

 resw       set for table of results  /

 reswKAPREG     Bilateral current account balance
 reswPER        Domestic price of exports of comm'y to regions and aggregates
 reswPMR        Domestic price of imports of comm'y from regions and aggregates
 reswPWE        World price of exports of commodity c from region r in dollars
 reswPWM        CIF price of competitive imports of commodity c from region w
 reswPWMFOB     FOB price of competitive imports of commodity c from region w
 reswQER        Exports of comm'y c to regions and aggregates
 reswQMR        Imports of comm'y c from regions and aggregates
 reswQT         Quantity of margin services for total imports from region w
 reswTE         Export taxes on exported comm'y c from r to w
 reswTM         Ad valorem Tariff rates on imported comm'y c from w by r
    /

 resf       set of factor based variables for results   /

 resfADFD       Shift parameter for factor and activity specific efficiency
 resfFD         Demand for factor f by activity a in r
 resfFS         Supply of factor f in r
 resfTF         Tax rate on factor use
 resfTYF        Direct tax rate on factor income
 resfUNEMP      Unemployed factors
 resfWF         Price of factor f in r
 resfYF         Income to factor f from domestic production
 resfYFDIST     Total Factor income for distn after depreciation and taxes
  /

 resa       set of aid based variables for results   /

 resAAID_B_IN   Bilateral aid received by g in r from w
 resAAID_B_OUT  Bilateral aid paid by g in r to w

  /

 resh       set of household based variables for results   /

 resHREMITIN    Remittances received by hhold h in r from w
 resHREMITOUT   Remittances paid by hhold h in r to w

  /

      ;

*~~~~~~ Sets for Parameters to carry shocks

SETS

 sh_tax        Tax shocks     /
 stmSIM       SHOCK Ad valorem Tariff rates on imported comm'y c from w by r
 steSIM       SHOCK  Export taxes on exported comm'y c from r to w

 stsSIM       SHOCK Sales tax rate
 stvSIM       SHOCK Value added tax rates
 stxSIM       SHOCK Indirect tax rate
 styhSIM      SHOCK Direct tax rate on households  tariff rate shock

 styfSIM      SHOCK Direct tax rate on factor income
 stfSIM       SHOCK Tax rate on factor use

 /

* Technology Shock parameters

 sh_tech       Technology shocks   /
 sadxSIM      SHOCK Shift parameter for CES production functions for QX in r
 sadvaSIM     SHOCK Shift parameter for CES production functions for QVA
 sadflndSIM   SHOCK to land stock flow parameter
 sadfsklSIM   SHOCK to skilled labour stock flow parameter
 sadfuskSIM   SHOCK to UNskilled labour stock flow parameter
 sadfcapSIM   SHOCK to capital stock flow parameter

  /
* Transfer shock parameters

 sh_tran      Transfer shocks   /

* Remiitance
 sremit       SHOCK Share of after tax income of h in r remitted to w
* Aid shock parameters
 said_b       SHOCK Share of bilateral GDP paid by g in r to w

  /

 ;

PARAMETERS

*~~~~~~ Parameters to carry model settings

 elastics(r,elst)     Model elasticities by region

* unemp_rate(r,f)      Unemployment rates by region and factor


*~~~~~~ Parameters to LOAD shocks

* Note these parameters will need values assigned for each member of SIM

* Tax shock parameters

 shock_tax(sim,r,sh_tax)      Shocks to tax rates by region

* Technology shock parameters

 shock_tech(sim,r,sh_tech)    Shocks to technology rates by region

* Transfer shock parameters

 shock_remit(sim,w,r)         Shocks to transfer rates by region
 shock_b_aid(sim,w,r)         Shocks to bilateral aid transfer rates by region
 shock_m_aid(sim,w,r)         Shocks to multilateral aid transfer rates by region

 shock_yfout(sim,w,f,r)       Shocks to Factor incomes f paid by r to w

 shock_hogov(sim,r,*)         Shocks to Transfers to hhold h from government

* Trade margins shock parameters

 shock_marg(sim,w,r)          Shock to trade margin coefficients

*~~~~~~~ Parameters to IMPLEMENT shocks

* Tax shock parameters

 tmSIM(w,r,sim)   SHOCK Ad valorem Tariff rates on imported comm'y c from w by r
 teSIM(w,r,sim)   SHOCK  Export taxes on exported comm'y c from r to w

 tsSIM(r,sim)     SHOCK Sales tax rate
 tvSIM(r,sim)     SHOCK Value added tax rates
 txSIM(r,sim)     SHOCK Indirect tax rate
 tyhSIM(r,sim)    SHOCK Direct tax rate on households  tariff rate shock

 tyfSIM(f,r,sim)  SHOCK Direct tax rate on factor income
 tfSIM(f,r,sim)   SHOCK Tax rate on factor use

* Technology Shock parameters

 adxSIM(r,sim)     SHOCK Shift parameter for CES production functions for QX in r
 advaSIM(r,sim)    SHOCK Shift parameter for CES production functions for QVA
 adfdSIM(f,r,sim)  SHOCK to factor stock flow parameters

* Transfer shock parameters

 remitoutshSIM(w,r,sim) SHOCK Share of after tax income of h in r remitted to w

 aid_b_outshSIM(w,r,sim) SHOCK bilateral aid Share of GDP paid by g in r to w
 aid_m_outshSIM(w,r,sim) SHOCK multilateral aid Share of GDP paid by g in r to w

 yfoutshSIM(w,f,r,sim)   SHOCKS share of Factor incomes f paid by r to w

 hogovconstSIM(r,sim)    SHOCKS to Transfers to hhold h from government

* Trade margins shock parameters

 margcorSIM(w,r,sim)     Shock to trade margin coefficients


*~~~~~~~~ Parameters to REPORT the results from the simulations
$ontext
 Parameters to contain the results from the simulations

 Results parameters are declared for all the model variables
 It is often easiest to do this and then control output according to the
 information required.

 Note these parameters will need values assigned for each member of SIM
 In all cases these parameters have one dimension, e.g., QCDRES captures
 the results for QCD, defined only over SIM, for each cycle of the LOOP.

 BUT parameters are not limited to one dimension.
 Multiple dimensions will be used in later models.
$offtext

 resLEV(r,res,clos,sim)  LEVELS results for scalar variables from simulations
 resPER(r,res,clos,sim)  PERCENTAGE change results for scalar variables from sims

 resWLEV(w,r,resw,clos,sim)  LEVELS results for scalar variables from simulations
 resWPER(w,r,resw,clos,sim)  PERCENTAGE change results for scalar variables from sims

 resFLEV(f,r,resf,clos,sim)  LEVELS results for factor variables from simulations
 resFPER(f,r,resf,clos,sim)  PERCENTAGE change results for factor vars from sims

 resALEV(w,g,r,resa,clos,sim)  LEVELS results for factor variables from simulations
 resAPER(w,g,r,resa,clos,sim)  PERCENTAGE change results for factor vars from sims

 resHLEV(w,h,r,resh,clos,sim)  LEVELS results for factor variables from simulations
 resHPER(w,h,r,resh,clos,sim)  PERCENTAGE change results for factor vars from sims


    ;

*## 18b. DEFINING THE POLICY EXPERIMENTS ####

* This experiment changes the scaling factor on the import tariffs
* Hence relative tariffs remain constant
* These statements assign values to pwmSIM(SIM).
* One assignment statement is needed for each member of SIM

$CALL "GDXXRW i=R23_data.xlsm o=data_in.gdx INDEX=LAYOUT!A4"

$GDXIN data_in.GDX

*~~~~~~ Experiment sets

$LOADdc sim clos elst

*~~~~~~ Parameters to carry model settings

*$LOADdc elastics
*$LOADdc unemp_rate

*~~~~~~ Parameters to carry shocks
* Tax shock parameters

$LOADdc shock_tax

* Technology shock parameters

$LOADdc shock_tech

* Transfer shock parameters

$LOAD shock_remit shock_b_aid shock_m_aid shock_yfout shock_hogov

* Trade margins shock parameters

$LOAD shock_marg

$GDXIN

Display shock_tax, shock_tech,
        shock_remit, shock_b_aid, shock_m_aid, shock_yfout, shock_hogov,
        shock_marg ;

*~~~~~~ Tax shock parameters

 tmSIM(w,r,sim)        = TM0(w,r) ;
 tmSIM(w,r,"sim01")    = TM0(w,r) * shock_tax("sim01",r,"stmSIM ") ;

 teSIM(w,r,sim)        = TE0(w,r) ;
 teSIM(w,r,"sim01")    = TE0(w,r) * shock_tax("sim01",r,"steSIM") ;

 tsSIM(r,sim)          = TS0(r) ;
 tsSIM(r,"sim01")      = TS0(r) * shock_tax("sim01",r,"stsSIM") ;

 tvSIM(r,sim)          = TV0(r) ;
 tvSIM(r,"sim01")      = TV0(r) * shock_tax("sim01",r,"stvSIM") ;

 txSIM(r,sim)          = TX0(r) ;
 txSIM(r,"sim01")      = TX0(r) * shock_tax("sim01",r,"stxSIM") ;

 tyhSIM(r,sim)         = TYH0(r) ;
 tyhSIM(r,"sim01")     = TYH0(r) * shock_tax("sim01",r,"styhSIM") ;

 tyfSIM(f,r,sim)       = TYF0(f,r) ;
 tyfSIM(f,r,"sim01")   = TYF0(f,r) * shock_tax("sim01",r,"styfSIM") ;

 tfSIM(f,r,sim)        = TF0(f,r) ;
 tfSIM(f,r,"sim01")    = TF0(f,r) * shock_tax("sim01",r,"stfSIM") ;


*~~~~~~ Technology shock parameters

 adxSIM(r,sim)               = ADX0(r) ;
 adxSIM(r,"sim01")           = ADX0(r) * shock_tech("sim01",r,"sadxSIM") ;

 advaSIM(r,sim)              = ADVA0(r) ;
 advaSIM(r,"sim01")          = ADVA0(r) * shock_tech("sim01",r,"sadvaSIM") ;

 adfdSIM(f,r,sim)            = ADFD0(f,r) ;
 adfdSIM("flnd ",r,"sim01")  = ADFD0("flnd ",r) * shock_tech("sim01",r,"sadflndSIM") ;
 adfdSIM("fskl ",r,"sim01")  = ADFD0("fskl ",r) * shock_tech("sim01",r,"sadfsklSIM") ;
 adfdSIM("fuskl",r,"sim01")  = ADFD0("fuskl",r) * shock_tech("sim01",r,"sadfuskSIM") ;
 adfdSIM("fcap ",r,"sim01")  = ADFD0("fcap ",r) * shock_tech("sim01",r,"sadfcapSIM") ;


*~~~~~~ Transfer shock parameters

 remitoutshSIM(w,r,sim)      = remitoutsh(w,"hous",r) ;
 remitoutshSIM(w,r,"sim01")  = remitoutsh(w,"hous",r) * shock_remit("sim01",w,r) ;

 aid_b_outshSIM(w,r,sim)     = aid_b_outsh(w,"govt",r) ;
 aid_b_outshSIM(w,r,"sim01") = aid_b_outsh(w,"govt",r) * shock_b_aid("sim01",w,r) ;

 aid_m_outshSIM(w,r,sim)     = aid_m_outsh(w,"govt",r) ;
 aid_m_outshSIM(w,r,"sim01") = aid_m_outsh(w,"govt",r) * shock_b_aid("sim01",w,r) ;

 yfoutshSIM(w,f,r,sim)       = yfoutsh(w,f,r) ;
 yfoutshSIM(w,f,r,"sim01")   = yfoutsh(w,f,r) * shock_yfout("sim01",w,f,r) ;

 hogovconstSIM(r,sim)        = hogovconst(r) ;
 hogovconstSIM(r,"sim01")    = hogovconst(r) * shock_hogov("sim01",r,"hous") ;

* Trade margins shock parameters

 margcorSIM(w,r,sim)         = margcor(w,r) ;
 margcorSIM(w,r,"sim01")     = margcor(w,r) * shock_marg("sim01",w,r) ;

 DISPLAY tmSIM, teSIM, tsSIM, tvSIM, txSIM, tyhSIM, tyfSIM, tfSIM,
         adxSIM, advaSIM, adfdSIM,
         remitoutshSIM, aid_b_outshSIM, aid_m_outshSIM,
         yfoutshSIM, hogovconstSIM, margcorSIM
 ;


* ------- 5. Running the experiments ---------------------------------------

* ------- 5a. elst loop begins --------------------------------------------

*LOOP(elst,

* First set .L values back to initial values for defining experiment closure

$INCLUDE r23_varinit2.inc

* Second, free all variables that are involved in any closure rule

$INCLUDE r23_reset.inc

* Third, select closure include files

*IF(clos = 1,

*############### 13. MODEL CLOSURE ######################################

$ontext

The core model uses a basic closure.

This design feature assumes that ALL closure changes are implemented
in the model experiment files

$offtext

*## FOREIGN EXCHANGE MARKET CLOSURE

* fix world numeraire in which foreign transactions are valued

 ERPI.FX                 = ERPI0 * numerchk ;

* Globe transactions are in the numeraire currency therefore fix GLOBEs ER

 ER.FX("glob")            = ERPI0 * numerchk;

* KAPWOR.FX("glob")        = KAPWOR0("glob") ;

* Globe's trade balance is zero by definition of tship and the fact that
* there is only one imported commodity

* In this MODEL either the exchange rate or the trade balance will typically
* be FIXED - there are possible exception.

* When ALL external balances for rgn are fixed, free all ER for rgn
* AND FIX KAPWORSYS
* When the external balances for a subset of rgn are fixed (and corresponding
* ER rtaes flexible), don't fix KAPWORSYS

* ER.FX(rgn)                = ER0(rgn) ;

* KAPWORSYS.FX             = 0.0 ;

 KAPWOR.FX(rgn)           = KAPWOR0(rgn) ;

*## INVESTMENT-SAVINGS CLOSURE
* IF aggregate investment is determined by aggregate savings
* i.e., the model is savings driven, then fixSHH

* Fix savings rates

* SHH.FX(r)           = SHH0(r) ;

* Fix investment volumes

* QINVD.FX(r)         = QINVD0(r) ;

* OR if the value of investment is fixed the

 INVEST.FX(r)       = INVEST0(r)*numerchk ;

* OR the shares of domestic final demand of investment is fixed

* INVESTSH.FX(r)     = INVESTSH0(r) ;

* Closure rule for Government savings is part of the Govt Closure Rules

*## GOVT CLOSURE RULES
* IF ALL tax rates are fixed
* AND Government consumption expenditure is fixed
* Then the equilibriating variable is Government Savings

* Tax rates

 TE.FX(w,r)   = TE0(w,r) ;
 TM.FX(w,r)   = TM0(w,r) ;
 TS.FX(r)     = TS0(r) ;
 TV.FX(r)     = TV0(r) ;
 TX.FX(r)     = TX0(r) ;
 TYF.FX(f,r)  = TYF0(f,r) ;
 TYH.FX(r)    = TYH0(r) ;
 TF.FX(f,r)   = TF0(f,r) ;

* GOVERNMENT EXPENDITURE
* Fix transfers
 HGADJ.FX(r)  = HGADJ0(r) ;

* FIX volume

* QGD.FX(r)   = QGD0(r) ;

* OR FIX nominal

* EG.FX(r)           = EG0(r) * numerchk ;

* OR FIX shares of final demand

* VGDSH.FX(r)         = VGDSH0(r) ;

* GOVERNMENT SAVINGS
* OR the internal balance / Govt savings can be fixed

 KAPGOV.FX(r)       = KAPGOV0(r) * numerchk ;

*## FACTOR MARKET CLOSURE

*# Basic Factor Market Closure
*$ontext

 FS.FX(f,r)                  = FS0(f,r) ;
 WF.LO(f,r)                  = -inf ;
 WF.UP(f,r)                  = +inf ;


*$ontext
* Unemployment
 WF.LO(f,r)$(NOT UEF(f,r))   = -inf ;
 WF.UP(f,r)$(NOT UEF(f,r))   = +inf ;
 WF.LO(f,r)$UEF(f,r)         = WF0(f,r) * numerchk ;
 WF.UP(f,r)$UEF(f,r)         = + INF ;

*$offtext

* # Technology Closures for Factor Market

* NB SHIFT factors are fixed indirectly through the adjustment variables

 ADX.FX(r)           = ADX0(r)      ;

 ADVA.FX(r)          = ADVA0(r)     ;

 ADFD.FX(f,r)        = ADFD0(f,r)  ;

*## MISCELLANEOUS FIXED VARIABLES

* To use CPI as the numeraire fix CPI


 CPI.FX(r)            = CPI0(r) * numerchk ;

* PD.FX(r)             = PD0(r) * numerchk ;

*## 18c. RUNNING THE POLICY EXPERIMENTS ####

* Starting the LOOP with SIM as the controlling SET
* The LOOP will run once for each member of SIM

LOOP(sim,

* Setting the experiments

*~~~~~~ Tax shock parameters

 TM.FX(w,r)    = tmSIM(w,r,sim) ;
 TE.FX(w,r)    = teSIM(w,r,sim) ;
 TS.FX(r)      = tsSIM(r,sim) ;
 TV.FX(r)      = tvSIM(r,sim) ;
 TX.FX(r)      = txSIM(r,sim) ;
 TYH.FX(r)     = tyhSIM(r,sim) ;
 TYF.FX(f,r)   = tyfSIM(f,r,sim) ;
 TF.FX(f,r)    = tfSIM(f,r,sim) ;

*~~~~~~ Technology shock parameters

 ADX.FX(r)    = adxSIM(r,sim) ;
 ADVA.FX(r)   = advaSIM(r,sim) ;
 ADFD.FX(f,r) = adfdSIM(f,r,sim) ;

*~~~~~~ Transfer shock parameters

 remitoutsh(w,"hous",r)  = remitoutshSIM(w,r,sim) ;

 aid_b_outsh(w,"govt",r) = aid_b_outshSIM(w,r,sim) ;
 aid_m_outsh(w,"govt",r) = aid_m_outshSIM(w,r,sim) ;

 yfoutsh(w,f,r)          = yfoutshSIM(w,f,r,sim) ;

 hogovconst(r)           = hogovconstSIM(r,sim) ;

*~~~~~~ Trade margins shock parameters

 margcor(w,r)            = margcorSIM(w,r,sim) ;

 Solve R23 Using MCP ;

*## 18d. WRITING THE POLICY EXPERIMENT RESULTS ####

* the results are written to tables of parameters here
* These statements assign values to each of results parameters
* For each cycle of the LOOP the RHS values will be written
* into the respective results parameter.

* Region specific results

 resLEV(r,"resADVA",clos,sim)       = ADVA.L(r) ;
 resLEV(r,"resADX",clos,sim)        = ADX.L(r) ;
 resLEV(r,"resCPI",clos,sim)        = CPI.L(r) ;
 resLEV(r,"resEG",clos,sim)         = EG.L(r) ;
 resLEV(r,"resER",clos,sim)         = ER.L(r) ;
 resLEV(r,"resETAX",clos,sim)       = ETAX.L(r) ;
 resLEV(r,"resFTAX",clos,sim)       = FTAX.L(r) ;
 resLEV(r,"resFYTAX",clos,sim)      = FYTAX.L(r) ;
 resLEV(r,"resGDP",clos,sim)        = GDP.L(r) ;
 resLEV(r,"resGLOBESLACK",clos,sim) = GLOBESLACK.L ;
 resLEV(r,"resHTAX",clos,sim)       = HTAX.L(r) ;
 resLEV(r,"resINVEST",clos,sim)     = INVEST.L(r) ;
 resLEV(r,"resINVESTSH",clos,sim)   = INVESTSH.L(r) ;
 resLEV(r,"resITAX",clos,sim)       = ITAX.L(r) ;
 resLEV(r,"resKAPGOV",clos,sim)     = KAPGOV.L(r) ;
 resLEV(r,"resKAPWOR",clos,sim)     = KAPWOR.L(r) ;
 resLEV(r,"resKAPWORSYS",clos,sim)  = KAPWORSYS.L ;
 resLEV(r,"resMTAX",clos,sim)       = MTAX.L(r) ;
 resLEV(r,"resPD",clos,sim)         = PD.L(r) ;
 resLEV(r,"resPE",clos,sim)         = PE.L(r) ;
 resLEV(r,"resPM",clos,sim)         = PM.L(r) ;
 resLEV(r,"resPQD",clos,sim)        = PQD.L(r) ;
 resLEV(r,"resPQS",clos,sim)        = PQS.L(r) ;
 resLEV(r,"resPT",clos,sim)         = PT.L(r) ;
 resLEV(r,"resPVA",clos,sim)        = PVA.L(r) ;
 resLEV(r,"resPX",clos,sim)         = PX.L(r) ;
 resLEV(r,"resQCD",clos,sim)        = QCD.L(r) ;
 resLEV(r,"resQD",clos,sim)         = QD.L(r) ;
 resLEV(r,"resQE",clos,sim)         = QE.L(r) ;
 resLEV(r,"resQGD",clos,sim)        = QGD.L(r) ;
 resLEV(r,"resQINT",clos,sim)       = QINT.L(r) ;
 resLEV(r,"resQINVD",clos,sim)      = QINVD.L(r)  ;
 resLEV(r,"resQM",clos,sim)         = QM.L(r) ;
 resLEV(r,"resQQ",clos,sim)         = QQ.L(r) ;
 resLEV(r,"resQVA",clos,sim)        = QVA.L(r) ;
 resLEV(r,"resQX",clos,sim)         = QX.L(r) ;
 resLEV(r,"resSHH",clos,sim)        = SHH.L(r) ;
 resLEV(r,"resSTAX",clos,sim)       = STAX.L(r) ;
 resLEV(r,"resTOTSAV",clos,sim)     = TOTSAV.L(r) ;
 resLEV(r,"resTS",clos,sim)         = TS.L(r) ;
 resLEV(r,"resTV",clos,sim)         = TV.L(r) ;
 resLEV(r,"resTX",clos,sim)         = TX.L(r) ;
 resLEV(r,"resTYH",clos,sim)        = TYH.L(r) ;
 resLEV(r,"resVFDOMD",clos,sim)     = VFDOMD.L(r) ;
 resLEV(r,"resVGDSH",clos,sim)      = VGDSH.L(r) ;
 resLEV(r,"resVTAX",clos,sim)       = VTAX.L(r) ;
 resLEV(r,"resYG",clos,sim)         = YG.L(r) ;
 resLEV(r,"resYH",clos,sim)         = YH.L(r) ;
 resLEV(r,"resWALRAS",clos,sim)     = WALRAS.L(r) ;

* Region (r) and partner (w) results

 resWLEV(w,r,"reswKAPREG",clos,sim) = KAPREG.L(w,r) ;
 resWLEV(w,r,"reswPER",clos,sim)    = PER.L(w,r) ;
 resWLEV(w,r,"reswPMR",clos,sim)    = PMR.L(w,r) ;
 resWLEV(w,r,"reswPWE",clos,sim)    = PWE.L(w,r) ;
 resWLEV(w,r,"reswPWM",clos,sim)    = PWM.L(w,r) ;
 resWLEV(w,r,"reswPWMFOB",clos,sim) = PWMFOB.L(w,r) ;
 resWLEV(w,r,"reswQER",clos,sim)    = QER.L(w,r) ;
 resWLEV(w,r,"reswQMR",clos,sim)    = QMR.L(w,r) ;
 resWLEV(w,r,"reswQT",clos,sim)     = QT.L(w,r) ;
 resWLEV(w,r,"reswTE",clos,sim)     = TE.L(w,r) ;
 resWLEV(w,r,"reswTM",clos,sim)     = TM.L(w,r) ;

* Factor results

 resFLEV(f,r,"resfADFD",clos,sim)   = ADFD.L(f,r) ;
 resFLEV(f,r,"resfFD",clos,sim)     = FD.L(f,r) ;
 resFLEV(f,r,"resfFS",clos,sim)     = FS.L(f,r) ;
 resFLEV(f,r,"resfTF",clos,sim)     = TF.L(f,r) ;
 resFLEV(f,r,"resfTYF",clos,sim)    = TYF.L(f,r) ;
 resFLEV(f,r,"resfUNEMP",clos,sim)  = UNEMP.L(f,r) ;
 resFLEV(f,r,"resfWF",clos,sim)     = WF.L(f,r) ;
 resFLEV(f,r,"resfYF",clos,sim)     = YF.L(f,r) ;
 resFLEV(f,r,"resfYFDIST",clos,sim) = YFDIST.L(f,r) ;

* Aid transaction results

 resALEV(w,g,r,"resaAID_B_IN",clos,sim)  = AID_B_IN.L(g,w,r) ;
 resALEV(w,g,r,"resaAID_B_OUT",clos,sim) = AID_B_OUT.L(w,g,r) ;

* Remittance transaction results

 resHLEV(w,h,r,"resHREMITIN ",clos,sim) = REMITIN.L(h,w,r) ;
 resHLEV(w,h,r,"resHREMITOUT",clos,sim) = REMITOUT.L(w,h,r) ;

*------ Percentage resChange Results ----------

* Region specific results

 resPER(r,"resADVA",clos,sim)$ADVA0(r)      = (ADVA.L(r)/ADVA0(r) - 1) * 100 ;
 resPER(r,"resADX",clos,sim)$ADX0(r)        = (ADX.L(r)/ADX0(r) - 1) * 100 ;
 resPER(r,"resCPI",clos,sim)$CPI0(r)        = (CPI.L(r)/CPI0(r) - 1) * 100 ;
 resPER(r,"resEG",clos,sim)$EG0(r)          = (EG.L(r)/EG0(r) - 1) * 100 ;
 resPER(r,"resER",clos,sim)$ER0(r)          = (ER.L(r)/ER0(r) - 1) * 100 ;
 resPER(r,"resETAX",clos,sim)$ETAX0(r)      = (ETAX.L(r)/ETAX0(r) - 1) * 100 ;
 resPER(r,"resFTAX",clos,sim)$FTAX0(r)      = (FTAX.L(r)/FTAX0(r) - 1) * 100 ;
 resPER(r,"resFYTAX",clos,sim)$FYTAX0(r)    = (FYTAX.L(r)/FYTAX0(r) - 1) * 100 ;
 resPER(r,"resGDP",clos,sim)$GDP0(r)        = (GDP.L(r)/GDP0(r) - 1) * 100 ;
 resPER(r,"resHTAX",clos,sim)$HTAX0(r)      = (HTAX.L(r)/HTAX0(r) - 1) * 100 ;
 resPER(r,"resINVEST",clos,sim)$INVEST0(r)  = (INVEST.L(r)/INVEST0(r) - 1) * 100 ;
 resPER(r,"resINVESTSH",clos,sim)$INVESTSH0(r)  = (INVESTSH.L(r)/INVESTSH0(r) - 1) * 100 ;
 resPER(r,"resITAX",clos,sim)$ITAX0(r)      = (ITAX.L(r)/ITAX0(r) - 1) * 100 ;
 resPER(r,"resKAPGOV",clos,sim)$KAPGOV0(r)  = (KAPGOV.L(r)/KAPGOV0(r) - 1) * 100 ;
 resPER(r,"resKAPWOR",clos,sim)$KAPWOR0(r)  = (KAPWOR.L(r)/KAPWOR0(r) - 1) * 100 ;
 resPER(r,"resMTAX",clos,sim)$MTAX0(r)      = (MTAX.L(r)/MTAX0(r) - 1) * 100 ;
 resPER(r,"resPD",clos,sim)$PD0(r)          = (PD.L(r)/PD0(r) - 1) * 100 ;
 resPER(r,"resPE",clos,sim)$PE0(r)          = (PE.L(r)/PE0(r) - 1) * 100 ;
 resPER(r,"resPM",clos,sim)$PM0(r)          = (PM.L(r)/PM0(r) - 1) * 100 ;
 resPER(r,"resPQD",clos,sim)$PQD0(r)        = (PQD.L(r)/PQD0(r) - 1) * 100 ;
 resPER(r,"resPQS",clos,sim)$PQS0(r)        = (PQS.L(r)/PQS0(r) - 1) * 100 ;
 resPER(r,"resPT",clos,sim)$PT0(r)          = (PT.L(r)/PT0(r) - 1) * 100 ;
 resPER(r,"resPVA",clos,sim)$PVA0(r)        = (PVA.L(r)/PVA0(r) - 1) * 100 ;
 resPER(r,"resPX",clos,sim)$PX0(r)          = (PX.L(r)/PX0(r) - 1) * 100 ;
 resPER(r,"resQCD",clos,sim)$QCD0(r)        = (QCD.L(r)/QCD0(r) - 1) * 100 ;
 resPER(r,"resQD",clos,sim)$QD0(r)          = (QD.L(r)/QD0(r) - 1) * 100 ;
 resPER(r,"resQE",clos,sim)$QE0(r)          = (QE.L(r)/QE0(r) - 1) * 100 ;
 resPER(r,"resQGD",clos,sim)$QGD0(r)        = (QGD.L(r)/QGD0(r) - 1) * 100 ;
 resPER(r,"resQINT",clos,sim)$QINT0(r)      = (QINT.L(r)/QINT0(r) - 1) * 100 ;
 resPER(r,"resQINVD",clos,sim)$QINVD0(r)    = (QINVD.L(r)/QINVD0(r) - 1) * 100  ;
 resPER(r,"resQM",clos,sim)$QM0(r)          = (QM.L(r)/QM0(r) - 1) * 100 ;
 resPER(r,"resQQ",clos,sim)$QQ0(r)          = (QQ.L(r)/QQ0(r) - 1) * 100 ;
 resPER(r,"resQVA",clos,sim)$QVA0(r)        = (QVA.L(r)/QVA0(r) - 1) * 100 ;
 resPER(r,"resQX",clos,sim)$QX0(r)          = (QX.L(r)/QX0(r) - 1) * 100 ;
 resPER(r,"resSHH",clos,sim)$SHH0(r)        = (SHH.L(r)/SHH0(r) - 1) * 100 ;
 resPER(r,"resSTAX",clos,sim)$STAX0(r)      = (STAX.L(r)/STAX0(r) - 1) * 100 ;
 resPER(r,"resTOTSAV",clos,sim)$TOTSAV0(r)  = (TOTSAV.L(r)/TOTSAV0(r) - 1) * 100 ;
 resPER(r,"resTS",clos,sim)$TS0(r)          = (TS.L(r)/TS0(r) - 1) * 100 ;
 resPER(r,"resTV",clos,sim)$TV0(r)          = (TV.L(r)/TV0(r) - 1) * 100 ;
 resPER(r,"resTX",clos,sim)$TX0(r)          = (TX.L(r)/TX0(r) - 1) * 100 ;
 resPER(r,"resTYH",clos,sim)$TYH0(r)        = (TYH.L(r)/TYH0(r) - 1) * 100 ;
 resPER(r,"resVFDOMD",clos,sim)$VFDOMD0(r)  = (VFDOMD.L(r)/VFDOMD0(r) - 1) * 100 ;
 resPER(r,"resVGDSH",clos,sim)$VGDSH0(r)    = (VGDSH.L(r)/VGDSH0(r) - 1) * 100 ;
 resPER(r,"resVTAX",clos,sim)$VTAX0(r)      = (VTAX.L(r)/VTAX0(r) - 1) * 100 ;
 resPER(r,"resYH",clos,sim)$YH0(r)          = (YH.L(r)/YH0(r) - 1) * 100 ;
 resPER(r,"resYG",clos,sim)$YG0(r)          = (YG.L(r)/YG0(r) - 1) * 100 ;
 resPER(r,"resWALRAS",clos,sim)$WALRAS0(r)  = (WALRAS.L(r)/WALRAS0(r) - 1) * 100 ;

* Region (r) and partner (w) results

 resWPER(w,r,"reswKAPREG",clos,sim)$KAPREG0(w,r)
                                = (KAPREG.L(w,r)/KAPREG0(w,r) - 1) * 100 ;
 resWPER(w,r,"reswPER",clos,sim)$PER0(w,r)   = (PER.L(w,r)/PER0(w,r) - 1) * 100 ;
 resWPER(w,r,"reswPMR",clos,sim)$PMR0(w,r)   = (PMR.L(w,r)/PMR0(w,r) - 1) * 100 ;
 resWPER(w,r,"reswPWE",clos,sim)$PWE0(w,r)   = (PWE.L(w,r)/PWE0(w,r) - 1) * 100 ;
 resWPER(w,r,"reswPWM",clos,sim)$PWM0(w,r)   = (PWM.L(w,r)/PWM0(w,r) - 1) * 100 ;
 resWPER(w,r,"reswPWMFOB",clos,sim)$PWMFOB0(w,r)
                          = (PWMFOB.L(w,r)/PWMFOB0(w,r) - 1) * 100 ;
 resWPER(w,r,"reswQER",clos,sim)$QER0(w,r)   = (QER.L(w,r)/QER0(w,r) - 1) * 100 ;
 resWPER(w,r,"reswQMR",clos,sim)$QMR0(w,r)   = (QMR.L(w,r)/QMR0(w,r) - 1) * 100 ;
 resWPER(w,r,"reswQT",clos,sim)$QT0(w,r)     = (QT.L(w,r)/QT0(w,r) - 1) * 100 ;
 resWPER(w,r,"reswTE",clos,sim)$TE0(w,r)     = (TE.L(w,r)/TE0(w,r) - 1) * 100 ;
 resWPER(w,r,"reswTM",clos,sim)$TM0(w,r)     = (TM.L(w,r)/TM0(w,r) - 1) * 100 ;

* Factor results

 resFPER(f,r,"resfADFD",clos,sim)$ADFD0(f,r)  = (ADFD.L(f,r)/ADFD0(f,r) - 1) * 100 ;
 resFPER(f,r,"resfFD",clos,sim)$FD0(f,r)      = (FD.L(f,r)/FD0(f,r) - 1) * 100 ;
 resFPER(f,r,"resfFS",clos,sim)$FS0(f,r)      = (FS.L(f,r)/FS0(f,r) - 1) * 100 ;
 resFPER(f,r,"resfTF",clos,sim)$TF0(f,r)      = (TF.L(f,r)/TF0(f,r) - 1) * 100 ;
 resFPER(f,r,"resfTYF",clos,sim)$TYF0(f,r)    = (TYF.L(f,r)/TYF0(f,r) - 1) * 100 ;
 resFPER(f,r,"resfUNEMP",clos,sim)$UNEMP0(f,r)
                          = (UNEMP.L(f,r)/UNEMP0(f,r) - 1) * 100 ;
 resFPER(f,r,"resfWF",clos,sim)$WF0(f,r)       = (WF.L(f,r)/WF0(f,r) - 1) * 100 ;
 resFPER(f,r,"resfYF",clos,sim)$YF0(f,r)       = (YF.L(f,r)/YF0(f,r) - 1) * 100 ;
 resFPER(f,r,"resfYFDIST",clos,sim)$YFDIST0(f,r)
                          = (YFDIST.L(f,r)/YFDIST0(f,r) - 1) * 100 ;

* Aid transaction results

 resAPER(w,g,r,"resaAID_B_IN",clos,sim)$AID_B_IN0(g,w,r)
                         = (AID_B_IN.L(g,w,r)/AID_B_IN0(g,w,r) - 1) * 100 ;
 resAPER(w,g,r,"resaAID_B_OUT",clos,sim)$AID_B_OUT0(w,g,r)
                         = (AID_B_OUT.L(w,g,r)/AID_B_OUT0(w,g,r) - 1) * 100 ;

* Remittance transaction results

 resHPER(w,h,r,"resHREMITIN",clos,sim)$REMITIN0(h,w,r)
                        = (REMITIN.L(h,w,r)/REMITIN0(h,w,r) - 1) * 100 ;
 resHPER(w,h,r,"resHREMITOUT",clos,sim)$REMITOUT0(w,h,r)
                        = (REMITOUT.L(w,h,r)/REMITOUT0(w,h,r) - 1) * 100 ;


* END of SIM LOOP
          ) ;

* END of ELST LOOP
*          ) ;

* Display statements for the result parameters

 DISPLAY resLEV, resPER, resFLEV, resFPER, resALEV, resAPER, resHLEV, resHPER ;

Execute_Unload 'results/res_expt.gdx',     resLEV
                                   resPER
                                   resFLEV
                                   resFPER
                                   resALEV
                                   resAPER
                                   resHLEV
                                   resHPER
   ;

*########################### THE END ########################
