Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The Ricardian Trade Model

This is one in a series of python jupyter notebooks on Trade models by Jonathan Conning

Notes: the plots and simulations below are written in python. This notebook can be run interactively on a jupyter server, on your own machine or on a cloud serve such as Google’s Colab. However, much of the code is in a separate ricardo.py module. You can also view this notebook in slideshow mode (Alt-R) if the proper extension is installed.

Source
import sys
from ipywidgets import interact, interact_manual, fixed
Source
sys.path.insert(0,"..")
from ricardo import *

Warm up: Budget lines and Indifference curves

You have I=$100 income. You can buy good X or good Y (for example good X might be food nutrition bars and good Y manufactured trinkets).

  • pxp_x -- Price of one unit of good X measured in $ per unit

  • pyp_y -- Price of one unit of good Y measured in $ per unit

  • pxpy\frac{p_x}{p_y} -- Relative price of good X measured in units of good Y per unit of X.

Interactive: Move the sliders to change prices and income values.

interact(budget,px=(0.3,3,0.1),py=(0.3,3,0.1),I=(50,150,10),show=fixed(True) );
Loading...

Ricardian model

Linear Production Technologies

Labor is the only input. Good XX and good YY are produced with linear production technologies:

QX=MPLXLXQ_X = MPL_X \cdot L_X
QY=MPLYLYQ_Y = MPL_Y \cdot L_Y

where MPLXMPL_X and MPLXMPL_X are the constant marginal product of labor productivity parameters in the XX and the YY sector, respectively.

The marginal product of good XX is measured in units of good XX per unit labor.

The labor resource constraint

The sum of labor demands in the two sectors cannot exceed the economy’s total labor supply Lˉ\bar L:

LX+LY=LˉL_X + L_Y = \bar L

Minimum labor requirements

We can invert the XX production function to find the minimum labor required to produce any quantity QXQ_X:

LX=1MPLXQXL_X = \frac{1}{MPL_X} Q_X

aLX=1MPLXa_{LX}=\frac{1}{MPL_X} is the constant unit labor requirement to produce each additional unit of QXQ_X.

The minimum labor required to produce any quantity QYQ_Y is

LY=1MPLYQYL_Y = \frac{1}{MPL_Y} Q_Y

aLY=1MPLYa_{LY}=\frac{1}{MPL_Y} is the constant unit labor requirement to produce each additional unit of QYQ_Y.

The Production Possibility Frontier (PPF)

Tells us what is feasible to produce given available technology and resource constraints.

The economy’s labor resource constraint

LX+LY=LˉL_X + L_Y = \bar L

can be rewritten (using our minimum labor requirement functions) to find:

1MPLXQX+1MPLYQY=Lˉ\frac{1}{MPL_X} Q_X + \frac{1}{MPL_Y} Q_Y = \bar L

Let’s re-arrange the PPF constraint further to obtain an expression that will be easy to plot:

QY=MPLYLˉMPLYMPLXQXQ_Y = MPL_Y \cdot \bar L - \frac{MPL_Y}{MPL_X} Q_X

Example: If MPLX=2MPL_X = 2, MPLY=1MPL_Y = 1 and Lˉ=200\bar L = 200 then the PPF curve is given by:

QY=20012QXQ_Y = 200 - \frac{1}{2} Q_X
rppf(mplx=2,mply=1,lbar=200)
<Figure size 504x504 with 1 Axes>

The PPF has:

  • YY intercept: MPLYLˉ=1200=200MPL_Y \cdot \bar L = 1 \cdot 200 = 200

  • XX intercept: MPLXLˉ=2200=400MPL_X \cdot \bar L = 2 \cdot 200 = 400

The negative slope shows that there is a tradeoff:

  • We need 1MPLX=1/2\frac{1}{MPL_X}=1/2 workers to produce one more unit of good X.

  • With full employment we can only get this labor by pulling them out of Y production.

  • Each worker there would have produced MPLY=1MPL_Y=1 units of Y, so withdrawing 1MPLX\frac{1}{MPL_X} workers will reduce Y output by

MPLYMPLX=21(units of Yunits of X)\frac{MPL_Y}{MPL_X} = \frac{2}{1} \left ( \frac{\text{units of Y}}{\text{units of X}} \right )

Hence (negative of) the slope tells us the opportunity cost of an extra unit of good X, measured in terms of units of good Y which must be given up.

Competitive Prices and Wages

Firms will earn profit and want to hire more workers so long as the marginal value product of labor exceeds the market wage. Competition between firms and workers moving across firms and sectors in search of the highest wage will drive profits to zero at which the following market equilibrium conditions must hold:

PXMPLX=w=PYMPLYP_X \cdot MPL_X = w = P_Y \cdot MPL_Y

All workers are paid the same wage which will be equal to their marginal value product, which is equalized across firms and sectors.

Real wages

The nominal wage ww is measured in dollars. From the zero profit condition we can determine real wages:

wPX=MPLX=2(units of good X per unit of labor)\frac{w}{P_X} = MPL_X = 2 \, \,\,\, \text{(units of good X per unit of labor)}
wPY=MPLY=1(units of good Y per unit of labor)\frac{w}{P_Y} = MPL_Y = 1 \, \,\,\, \text{(units of good Y per unit of labor)}

These are two ways to measure the purchasing power of this nominal wage in terms of good XX and good YY respectively.

In this competitive economy workers are paid a real wage equal to their marginal product (which in the Ricardian model is also equal to their average product). Workers are the only factor of production and firm profits are driven to zero so workers get all of the output in the economy.

Note: wPX\frac{w}{P_X} and wPY\frac{w}{P_Y} are not different wages for workers in each sector. They are just two different ways to measure the real purchasing power of a worker’s wage ww. There is only one wage in the economy and all workers earn the same wage no matter what sector or firm they work in!

It’s easy to determine real wages from just eyeballing the PPF graph, if you know the size of the labor force. In the plot real GDP measured in terms of good X is 400 units and since there are 100 workers each worker gets paid a real wage of 4 units of X. If real GDP is measured instead in terms of good Y real GDP is 200 units of Y and since there are 100 workers each worker gets paid a real wage of 2 units of Y.

rppf(mplx=2, mply=1,lbar=200)
<Figure size 504x504 with 1 Axes>

We could also define a real wage in terms of any arbitrary basket of goods. For example, let

PB=PX+PYP_B = P_X + P_Y

be the price of a basket with one unit of good XX and one of good YY. The wage ww can purchase wPB\frac{w}{P_B} such baskets.

Prices in the closed economy

To produce one unit of XX requires aLX=1MPLXa_{LX}=\frac{1}{MPL_X} units of labor. Each unit of labor costs ww. Hence the marginal cost of producing XX is

MCX=wMPLXMC_X = \frac{w}{MPL_X}

Cmpetitive firms maximize profits where PX=MCxP_X=MC_x and hence:

PX=wMPLXP_X = \frac{w}{MPL_X}

Similarly in sector YY, firms price at:

PY=wMPLYP_Y = \frac{w}{MPL_Y}

So the domestic (or closed economy) relative price of XX measured in terms of good YY is

PXPY=MPLYMPLX\frac{P_X}{P_Y} = \frac{MPL_Y}{MPL_X}

which is equal to the slope of the PPF. Relative prices reflect opportunity costs.

Note that in this Ricardian model with linear production technologies we have determined equilibrium relative prices without having to specify consumer preferences or demand! This will not be the case in more general models.

Interactive diagram

Visible/interactive if running a jupyter server.

interact(rppf, mplx=(0.25,4,0.25), mply=(0.25,4,0.25), lbar=(25, 200, 5),show=fixed(True), title=fixed('Home'));
Loading...

Home opens to Trade -- Gains to Trade

Suppose Home has these technologies and resources:

MPLX=1 units of X/workerMPLY=2 units of X/workerLˉ=100 workersMPL_X^* = 1 \text{ units of X/worker} \\ MPL_Y^* = 2 \text{ units of X/worker} \\ \bar L^* = 100 \text{ workers}

Then the opportunity cost of producing one unit of good X measured in terms of good Y at Home is:

PXPY=MPLYMPLX=12\frac{P_X}{P_Y}=\frac{MPL_Y}{MPL_X}= \frac{1}{2}

This is Home’s autarky relative price of producing good X

If the world relative price of good X is pxwpyw=1\frac{p_x^w}{p_y^w} = 1 units of Y then Home is a relatively low cost producer of good X (since 1/2 units of Y per X < 1 units of Y per X). Given Home’s technologies and these world prices Home has a comparative advantage in the production of good X

If it opens up to trade producers will find it profitable to continue to expand X production (at the expense of Y production) until the country becomes specialied in the production of X. At that point the country’s GDP will be MPLXLˉMPL_X \cdot \bar L units of good X which it can trade to the world at the world price of 1 unit of good Y per X. Hence the citizens of the Home country can consume along the consumption possibility frontier given by the world price line running through the specialization point (qx=MPLxLˉandqy=0)(q_x=MPL_x\cdot \bar L and q_y = 0)

The specialized economy is depicted below.

FMPLX = MPLY
FMPLY = MPLX *1.25
openrppf(mplx=FMPLX, mply=FMPLY, lbar=LBAR, pw=FMPLY/FMPLX)
<Figure size 504x504 with 1 Axes>

A two country model

Technologies and hence domestic relative prices are different in two countries.

At Home:

MPLX=2MPLY=1MPL_X = 2 \\ MPL_Y = 1

In Foreign:

MPLX=1MPLY=2MPL_X^* = 1 \\ MPL_Y^* = 2

The autarky relative price of X is

At HOME: MPLYMPLX=12\frac{MPL_Y}{MPL_X} = \frac{1}{2} units of good Y per X

In FOREIGN: MPLYMPLX=21\frac{MPL_Y^*}{MPL_X^*} = \frac{2}{1} units of good Y per X

Home has a comparative advantage at producing X as it is the lower cost producer.

tworppf(2, 1, 100, 1, 2, 100)
<Figure size 864x864 with 2 Axes>

At a world price of pxpy=34\frac{p_x^*}{p_y^*}=\frac{3}{4} units of good Y per X, Home will specialize at X production and Foreign at Y production, but trade will not balance.

Source
qx, qy, cx, cy = openeq(mplx=2, mply=1, lbar=100, pw=3/4)
print(f'qx = {qx}, qy = {qy}, cx = {cx}, cy = {cy}')
print(f'Home exports {qx-cx} units of good X and imports {cy-qy} units of good Y')
qx = 200, qy = 0, cx = 100.0, cy = 75.0
Home exports 100.0 units of good X and imports 75.0 units of good Y
rtwopane(mplx=2, mply=1, lbar=100, mplfx=1, mplfy=2, lbarf=100, p=1)
<Figure size 864x864 with 2 Axes>

World Equilibrium Prices

Broadly speaking, the world equilibrium price will be that price at which one country’s exports equal the other country’s imports. It should be pretty clear that it will lie somewhere between the closed-economy relative prices of each country. In the example above Home autarky relative price of good X was PxPy=12\frac{P_x}{P_y}=\frac{1}{2}, the foreign autarky relative price was PxPy=2\frac{P_x}{P_y}=2 and the world equilibrium price that balances trade is PxePye=1\frac{P_x^e}{P_y^e}=1.

Since we can determine the quantity of exports and imports in each country at any world price, we could try to find the equilibrium price by trial and error -- by increasing or decreasing the world relative price until trade balances. Let’s start with that idea:

interact(rtwopane, mplx=fixed(2), mply=fixed(1), lbar=fixed(100),  mplfx=(0.5,2,0.1), mplfy=(0.5,2,0.1), 
         lbarf=(50, 200, 10),p=(0.2,3,0.1));
Loading...
<Figure size 864x864 with 2 Axes>

To find a world equilibrium price consistent with balanced trade we only need to find where the market for one good clears. The worldeq function finds this relative price numerically as the price at which world excess demand for good X is to zero.

rworldprice(mplx=2, mply=1, lbar=100, mplfx=1, mplfy=2, lbarf=100)
0.9999999999999999

The worldeq finds the world equilibrium price.

interact_manual(rworldeq, mplx=(0.5,3,0.1), mply=(0.5,3,0.1), lbar=(50, 200, 10),  mplfx=(0.5,2,0.1), mplfy=(0.5,2,0.1), 
         lbarf=(50, 200, 10));
Loading...
pp = np.linspace(0.1, 4,100)
qxf, qyf, cxf, cyf  = openeq2(mplx=2, mply=0.5, lbar=90, pw=pp)
qx, qy, cx, cy  = openeq2(mplx=1, mply=2, lbar=100, pw=pp)
plt.xlim(0.1,200)
plt.plot(np.maximum(qxf-cxf, np.zeros(len(qxf))), pp)
plt.plot(np.maximum(cx-qx, np.zeros(len(qx))), pp);
<Figure size 504x504 with 1 Axes>