Skip to content

Instantly share code, notes, and snippets.

@trialsolution
Last active August 29, 2015 14:02
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/23def8277a30f61c7f84 to your computer and use it in GitHub Desktop.
Save trialsolution/23def8277a30f61c7f84 to your computer and use it in GitHub Desktop.
Exercise to chapter five of Gilbert and Tower: Introduction to Numerical Simulation for Trade Theory and Policy
*
*
* This file is an extension of
* the long-run production problem, as described in Chapter 5 of
* Gilbert and Tower: Introduction to Numerical Simulation for Trade Theory and Policy.
*
* for download of the original model go to
* http://ideas.repec.org/c/uth/gt2013/2012-03.html
*
SET I Goods /1,2/;
SET J Factors /K,L/;
ALIAS (J, JJ);
PARAMETERS
GAMMA(I) Shift parameters in production
DELTA(J,I) Share parameters in production
RHO(I) Elasticity parameters in production
P(I) Output prices
FBAR(J) Endowments
QO(I) Initial output levels
RO(J) Initial factor prices
FO(J,I) Initial factor use levels
GDPO Initial gross domestic product;
* starting values and calibration
P(I)=1;
RO(J)=1;
QO(I)=100;
FO('L','1')=20;
FO('L','2')=80;
FO('K',I)=(QO(I)*P(I)-FO('L',I)*RO('L'))/RO('K');
FBAR(J)=SUM(I, FO(J,I));
GDPO=SUM(I, P(I)*QO(I));
RHO(I)=0.1;
DELTA(J,I)=(RO(J)/FO(J,I)**(RHO(I)-1))/(SUM(JJ, RO(JJ)/FO(JJ,I)**(RHO(I)-1)));
GAMMA(I)=QO(I)/(SUM(J, DELTA(J,I)*FO(J,I)**RHO(I)))**(1/RHO(I));
* Create names for variables
VARIABLES
Q(I) Output levels
R(J) Factor prices
F(J,I) Factor use levels
GDP Gross domestic product;
* Assign initial values to variables, and set lower bounds
Q.L(I)=QO(I);
R.L(J)=RO(J);
F.L(J,I)=FO(J,I);
GDP.L=GDPO;
Q.LO(I)=0;
R.LO(J)=0;
F.LO(J,I)=0;
* Create names for equations
EQUATIONS
PRODUCTION(I) Production functions
RESOURCE(J) Resource constraints
FDEMAND(J,I) Factor demand functions
INCOME Gross domestic product;
* Assign the expressions to the equation names
PRODUCTION(I)..Q(I)=E=GAMMA(I)*SUM(J, DELTA(J,I)*F(J,I)**RHO(I))**(1/RHO(I));
RESOURCE(J)..FBAR(J)=E=SUM(I, F(J,I));
FDEMAND(J,I)..R(J)=E=P(I)*Q(I)*SUM(JJ, DELTA(JJ,I)*F(JJ,I)**RHO(I))**(-1)*DELTA(J,I)*F(J,I)**(RHO(I)-1);
INCOME..GDP=E=SUM(I, P(I)*Q(I));
* Define the equations that make the model, and solve
MODEL HOS /ALL/;
SOLVE HOS USING NLP MAXIMIZING GDP;
*
* --- Exercises from page 44
*
*
* --- Ex. 2) Increase relative prices of goods
*
*
* --- What we see here is the Stolper-Samuelson theorem in action:
* "In the long run, when all factors are mobile, an increase
* in the relative price of a good will increase the real
* earnings of the factor used intensively in the production
* of that good and decrease the real earnings of the other
* factor"
*
*
* --- Increase price of good 1
* => optimal q changes, PPF tangent with new -(p2/p1)
* the tangent in fig. 5.2 will be more flat --> increased production of q1
* => In the Edgeworth box we move to a higher isoquant for q1 (and to a lower isoquant for q2 respectively)
* => Moving up on the efficiency locus of Fig. 5.1 results in a steeper slope, the factor price of labour (wage) decreases relative to capital prices
* => It means that the factor earnings of capital increase (because good 1 was the capital intensive product)
p("1") = 1.1;
SOLVE HOS USING NLP MAXIMIZING GDP;
*
* --- Increase the price of the labour intensive good
* [similar, 'symmetric' changes]
*
p(i) = 1;
p("2") = 1.1;
SOLVE HOS USING NLP MAXIMIZING GDP;
*
* --- exercise 2: Increase both prices by 10%
*
* Impact: same output mix, but higher GDP
p(i) = 1.1;
SOLVE HOS USING NLP MAXIMIZING GDP;
*
* --- Exercise 3: Change factor endowments
*
p(i) = 1;
fbar("K") = fbar("K") * 1.1;
SOLVE HOS USING NLP MAXIMIZING GDP;
fbar("K") = fbar("K") / 1.1;
fbar("L") = fbar("L") * 1.1;
SOLVE HOS USING NLP MAXIMIZING GDP;
*
* --- First of all, we can see the Rybczynski Theorem in action:
* "An increase in a factor endowment will increase the
* output of the industry using that factor intensively, and
* decrease the output of the other industry."
*
* --- On the other hand, the factor prices will be defined
* by the zero profit condition: p=c(w,r), where c(.) is the unit cost function
* and NOT by factor endowments. So factor prices are basically independent from
* factor endowments. They depend on the goods prices.
*
* --- We could therefore cite the factor price equalization theorem here:
* "Free trade that equalizes commodity prices between
* countries sharing the same technology must equate
* wages and rents in the two countries if each country
* actively produces both commodities."
* The proof includes that assuming same technologies in two trading countries
* the factor price will only depend on relative output prices and not endowments
*
* --- Note also that factor prices do actually affected by factor endowments
* in the specific factor model, when production factors are specific
* to the industries
*
*
* --- exercise 4: define gdp in an alternative way (not as output value)
*
parameter gdp_alternative;
* GDP as the minimized cost, as it should be equal to total output in the optimum
gdp_alternative = sum((i,j), r.l(j) * f.l(j,i));
display gdp_alternative;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment