Skip to content

Instantly share code, notes, and snippets.

@trialsolution
Created November 21, 2013 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trialsolution/7578734 to your computer and use it in GitHub Desktop.
Save trialsolution/7578734 to your computer and use it in GitHub Desktop.
Numerical example from Bach-Martin (2001): “Would the Right Tariff Aggregator for Policy Analysis Please Stand Up?” Journal of Policy Modeling 23 (6) page 630-632
********************************************************************************
$ontext
CAPRI project
GAMS file : REGAGG.GMS
@purpose :
@author : Mihaly Himics (mihaly.himics@ilr.uni-bonn.de)
@date : 21.11.13
@since :
@refDoc :
@seeAlso :
@calledBy :
Numerical example from
Bach, Christian F, and Will Martin. 2001.
"Would the Right Tariff Aggregator for Policy Analysis Please Stand Up?"
Journal of Policy Modeling 23 (6) (August): 621-635. doi:10.1016/S0161-8938(01)00077-1.
pages 630-632
$offtext
********************************************************************************
$offlisting
* all tariff lines are aggregated in one commodity category
set t "tariff lines" / t1*t6/;
set time / before, after/;
table p_tariffs(t, time)
before after
t1 10 10
t2 10 10
t3 10 10
t4 200 30
t5 200 30
t6 200 30
;
table p_imports(t, time) "expenditure on imports at world prices"
before
t1 100
t2 100
t3 100
t4 100
t5 100
t6 100
;
parameter
p_tariff_revenue(time) "tariff revenue"
p_price_null(t) "benchmark import prices (absolute values)"
p_utility(time)
;
parameter
p_beta_dom "share parameter on domestic good"
p_beta(t) "share paraemters on imported goods"
p_sigma "Substitution elasticity"
p_rho "Elasticity parameter"
;
variable
v_reldemand(t) "relative demand for imports"
v_impPrice(t) "import price"
v_compPrice "composite price"
v_domDem "relative demand for domestic good"
v_domPrice "relative price of domestic good"
v_unifT "uniform tariff"
v_trev "tariff revenue"
v_bot "balance of trade"
;
equations
* core model equations
price_index_ "composite price"
rel_demand_(t) "relative demand for imports"
rel_domDem_ "relative demand for domestic good"
* equations related to the uniform tariff calculations
uniform_tariff_(t) "relative prices defined by a uniform tariff"
tariff_revenue_ "tariff revenue function"
balance_of_trade_ "balance of trade"
;
parameter
p_expimp_w(t, time) "expenditure on imports at world prices"
p_expimp_w_tot(time) "expenditure on imports at world prices (total)"
p_expimp_d(t, time) "expenditure on imports at domestic prices"
p_expimp_d_tot(time) "expenditure on imports at domestic prices (total)"
p_expdom_d(time) "expenditure on domestic good at dom. prices (total)"
p_exp_d_tot(time) "total expenditure at domestic prices"
p_results(*, *, time) "reporting parameter"
;
*
* --- equation definitions
*
rel_demand_(t) ..
v_reldemand(t) =e= [v_compPrice / v_impPrice(t)] ** p_sigma;
price_index_ ..
v_compPrice =e= [ p_beta_dom * v_domPrice ** (1-p_sigma) + sum(t, p_beta(t) * v_impPrice(t) ** (1 - p_sigma)) ]
** (1 / (1 - p_sigma));
rel_domDem_ ..
v_domDem =e= (v_compPrice / v_domPrice) ** p_sigma;
uniform_tariff_(t) ..
v_impPrice(t) =e= (1 + v_unifT) / p_price_null(t);
tariff_revenue_ ..
v_trev =e= sum(t, v_reldemand(t) * p_imports(t, "before")
* (v_impPrice(t) * p_price_null(t) - 1) );
balance_of_trade_ ..
v_bot =e= v_compPrice * p_exp_d_tot("before") - v_trev;
model m_tline_cns /
rel_demand_
price_index_
rel_domDem_
/;
*
* --- parameterization
*
p_sigma = 2;
p_rho = (p_sigma - 1) / p_sigma;
*! All initial domestic prices are normalized to unity
* The change in tariffs will only change the relative prices
* The price of the domestic good will play the numeraire, so it will be kept at unity
* the domestic price variable does not even show up in the equations as it is kept at unity
p_price_null(t) = 1 + p_tariffs(t, "before") / 100;
display p_price_null;
* We use the calibrated share form of the CES aggregator => the beta coefficients are simply value shares
* In order to calculate the coeffs. we need to derive the expenditure shares
* initial expenditure on domestic good
p_expdom_d("before") = 2000;
* expenditure on imported goods
p_expimp_w(t, "before") = p_imports(t, "before");
p_expimp_w_tot("before") = sum(t, p_expimp_w(t, "before") );
p_expimp_d(t, "before") = p_imports(t, "before") * ( 1 + p_tariffs(t, "before") / 100 );
p_expimp_d_tot("before") = sum(t, p_expimp_d(t, "before"));
* total expenditure
p_exp_d_tot("before") = p_expdom_d("before") + p_expimp_d_tot("before");
p_beta_dom = p_expdom_d("before") / p_exp_d_tot("before");
p_beta(t) = p_expimp_d(t, "before") / p_exp_d_tot("before");
display "share parameters: ", p_beta_dom, p_beta;
scalar check_sum;
check_sum = sum(t, p_beta(t)) + p_beta_dom;
display "should be 1: ", check_sum;
p_tariff_revenue("before") = sum(t, p_tariffs(t, "before") / 100 * p_expimp_w(t, "before"));
*#########################################################################################################################
*
* --- calibration tests
*
* compensation approach => utility is fixed to unity and does not even show up in my equations
* relative prices in the benchmark
v_impPrice.fx(t) = 1;
v_domPrice.fx = 1;
solve m_tline_cns using CNS;
* test if utility remained unity
p_utility("before") = [ p_beta_dom * v_domDem.L ** p_rho + sum(t, p_beta(t) * v_reldemand.L(t) ** p_rho ) ] ** (1 / p_rho);
execute_unload "all_calibtest.gdx";
*##########################################################################################################################
*
* --- UNIFORM TARIFF CALCULATIONS (benchmark)
*
* A: uniform tariff with respect to the expenditure function part
model m_unif_exp /price_index_, uniform_tariff_/;
* fix the unit expenditure to one
v_compPrice.fx = 1;
v_impPrice.LO(t) = 0;
v_impPrice.UP(t) = inf;
solve m_unif_exp using CNS;
display "Uniform tariff equivalent -- Expenditure: ", v_unifT.L;
p_results("exp. aggregator", "full region", "before") = v_unifT.L;
* B: uniform tariff with respect to tariff revenues
model m_unif_tr /price_index_, uniform_tariff_, tariff_revenue_, rel_demand_/;
* free up price index
v_compPrice.LO = 0;
v_compPrice.UP = inf;
* fix tariff revenues
v_trev.fx = p_tariff_revenue("before");
solve m_unif_tr using CNS;
display "Uniform tariff equivalent -- Tariff Revenue: ", v_unifT.L;
p_results("tariff rev. aggregator", "full region", "before") = v_unifT.L;
* C: simple version of TRI
model m_unif_bot /price_index_, uniform_tariff_, tariff_revenue_, rel_demand_, balance_of_trade_/;
v_trev.LO = 0;
v_trev.UP = inf;
v_compPrice.LO = 0;
v_compPrice.UP = inf;
v_bot.fx = p_exp_d_tot("before") - p_tariff_revenue("before");
solve m_unif_bot using CNS;
display "Uniform tariff equivalent -- B.O.T.: ", v_unifT.L;
p_results("b.o.t. aggregator", "full region", "before") = v_unifT.L;
*##########################################################################################################################
*
* --- AFTER TARIFF CUTS
*
v_impPrice.FX(t) = (1 + p_tariffs(t, "after") / 100) / p_price_null (t) ;
* we not only fix utility but also the consumption of the domestic good
* implicitely we assume a fully price-inelastic domestic supply
v_domDem.fx = 1;
* the price of the domestic good will adjust so consumption will not decrease
v_domPrice.LO = 0;
v_domPrice.L = 1;
v_domPrice.UP = inf;
solve m_tline_cns using cns;
p_expimp_w(t, "after") = v_reldemand.L(t) * p_expimp_w(t, "before");
p_expimp_w_tot("after") = sum(t, p_expimp_w(t, "after"));
* expenditure on imports at dom. prices
p_expimp_d(t, "after") = p_expimp_d(t, "before") * v_impPrice.L(t) * v_reldemand.L(t);
p_expimp_d_tot("after") = sum(t, p_expimp_d(t, "after"));
display p_expimp_w, p_expimp_w_tot, p_expimp_d, p_expimp_d_tot;
* tariff revenues
p_tariff_revenue("after") = sum(t, p_tariffs(t, "after") / 100 * p_expimp_w(t, "after"));
display p_tariff_revenue;
* test if utility remained intact
p_utility("after") = [ p_beta_dom * v_domDem.L ** p_rho + sum(t, p_beta(t) * v_reldemand.L(t) ** p_rho ) ] ** (1 / p_rho);
display p_utility;
parameter p_bot(time) "balance of trade";
p_bot("before") = 2000 + 1230 - 630;
p_bot("after") = p_expdom_d("before") * v_domPrice.L * v_domDem.L + p_expimp_d_tot("after") - p_tariff_revenue("after");
display "the balane of trade has changed as well: ", p_bot;
p_results("Expenditure on imports, domestic p.", " ", time) = p_expimp_d_tot(time);
p_results("Tariff revenue", " ", time) = p_tariff_revenue(time);
p_results("Expenditure on imports, world p.", " ", time) = p_results("Expenditure on imports, domestic p.", " ", time)
- p_results("Tariff revenue", " ", time);
*##########################################################################################################################
*
* --- UNIFORM TARIFF CALCULATIONS (after tariff cuts)
*
* A: uniform tariff with respect to the expenditure function part
* fix the unit expenditure to one
v_compPrice.fx = v_compPrice.L;
v_domPrice.fx = v_domPrice.L;
v_impPrice.LO(t) = 0;
v_impPrice.UP(t) = inf;
solve m_unif_exp using CNS;
display "Uniform tariff equivalent -- Expenditure: ", v_unifT.L;
p_results("exp. aggregator", "full region", "after") = v_unifT.L;
* B: uniform tariff with respect to tariff revenues
* free up price index
v_compPrice.LO = 0;
v_compPrice.UP = inf;
* fix tariff revenues
v_trev.fx = p_tariff_revenue("after");
solve m_unif_tr using CNS;
display "Uniform tariff equivalent -- Tariff Revenue: ", v_unifT.L;
p_results("tariff rev. aggregator", "full region", "after") = v_unifT.L;
* C: simple version of TRI
v_trev.LO = 0;
v_trev.UP = inf;
v_compPrice.LO = 0;
v_compPrice.UP = inf;
v_domPrice.LO = 0;
v_domPrice.UP = inf;
v_bot.fx = p_bot("after");
model m_unif_bot2 /price_index_, uniform_tariff_, tariff_revenue_, rel_demand_, balance_of_trade_, rel_domDem_ /;
solve m_unif_bot2 using CNS;
display "Uniform tariff equivalent -- B.O.T.: ", v_unifT.L;
p_results("b.o.t. aggregator", "full region", "after") = v_unifT.L;
display p_results;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment