This page compiles notes and code related to techniques
for solving general equilibrium models of international trade
with monopolistic competition among heterogeneous firms.

Edward J. Balistreri and Thomas F. Rutherford

Fall 2010

Authors Description Links
"Structural Estimation and Solution of International
Trade Models with Heterogeneous Firms" (2011) Journal of
International Economics
83(2), 95-108.

This is an application of the Melitz (2003) theory of heterogeneous
firms in a large-scale trade-policy simulation model. We use a
decomposition technique (explained in the technical appendix).
Journal of International Economics
GAMS and Stata code
Technical Appendix
Rutherford Replication of Bernard, Redding, and Schott (2007) simulations using a
transparent decomposition technique in GAMS. This model is small
enough that we can solve the heterogeneous firms model as an
integrated system, but the application of the decomposition algorithm
indicates how larger (empirical) models might be solved. Rutherford
provides significant annotation throughout the code. .
GAMS code
"Trade and Welfare: Does industrial organization matter?" (2010)
Economics Letters 109(2), 85-87.

This paper uses a transparent simplified model to illustrate that the
equivalence result derived by Arkolakis et al. (2008) generally does
not hold in multiple sector models. The paper and code provide a
transparent application of the heterogeneous-firms theory as an
integrated Mixed Complementarity Problem.
Economics Letters
GAMS code

More on computing heterogeneous-firms trade models can be found on
our CGE handbook chapter page; and for more general applications of
decomposition techniques visit the
MPSGE home page.


Arkolakis, C., Demidova, S., Klenow, P.J., Rodríguez-Clare, A. (2008) "Endogenous variety and the gains from trade.," American Economic Review: Papers & Proceedings 98(2), 444-450.

Bernard, A.B., Redding, S., Schott, P.K. (2007) "Comparative advantage and heterogeneous firms," Review of Economic Studies 74(1), 31-66.

Melitz M.J. (2003) "The Impact of Trade on Intra-Industry Reallocations and Aggregate Industry Productivity," Econometrica 71(6), 1695-1725.