The law of comparative advantage describes how, under free trade, an agent will produce more of and consume less of a good for which they have a comparative advantage.
In an economic model, agents have a comparative advantage over others in producing a particular good if they can produce that good at a lower relative opportunity cost or autarky price, i.e. at a lower relative marginal cost prior to trade. Comparative advantage describes the economic reality of the work gains from trade for individuals, firms, or nations, which arise from differences in their factor endowments or technological progress. (One should not compare the monetary costs of production or even the resource costs (labor needed per unit of output) of production. Instead, one must compare the opportunity costs of producing goods across countries).
David Ricardo developed the classical theory of comparative advantage in 1817 to explain why countries engage in international trade even when one country's workers are more efficient at producing every single good than workers in other countries. He demonstrated that if two countries capable of producing two commodities engage in the free market, then each country will increase its overall consumption by exporting the good for which it has a comparative advantage while importing the other good, provided that there exist differences in labor productivity between both countries. Widely regarded as one of the most powerful yet counter-intuitive insights in economics, Ricardo's theory implies that comparative advantage rather than absolute advantage is responsible for much of international trade.
Adam Smith first alluded to the concept of absolute advantage as the basis for international trade in 1776, in The Wealth of Nations:
If a foreign country can supply us with a commodity cheaper than we ourselves can make it, better buy it off them with some part of the produce of our own industry employed in a way in which we have some advantage. The general industry of the country, being always in proportion to the capital which employs it, will not thereby be diminished [...] but only left to find out the way in which it can be employed with the greatest advantage.
Writing several decades after Smith in 1808, Robert Torrens articulated a preliminary definition of comparative advantage as the loss from the closing of trade:
[I]f I wish to know the extent of the advantage, which arises to England, from her giving France a hundred pounds of broadcloth, in exchange for a hundred pounds of lace, I take the quantity of lace which she has acquired by this transaction, and compare it with the quantity which she might, at the same expense of labour and capital, have acquired by manufacturing it at home. The lace that remains, beyond what the labour and capital employed on the cloth, might have fabricated at home, is the amount of the advantage which England derives from the exchange.
In 1817, David Ricardo published what has since become known as the theory of comparative advantage in his book On the Principles of Political Economy and Taxation.
In a famous example, Ricardo considers a world economy consisting of two countries, Portugal and England, each producing two goods of identical quality. In Portugal, the a priori more efficient country, it is possible to produce wine and cloth with less labor than it would take to produce the same quantities in England. However, the relative costs or ranking of cost of producing those two goods differ between the countries.
In this illustration, England could commit 100 hours of labor to produce one unit of cloth, or produce 5/6 units of wine. Meanwhile, in comparison, Portugal could commit 100 hours of labor to produce 10/9 units of cloth, or produce 10/8 units of wine. So, Portugal possesses an absolute advantage in producing cloth due to more produced per hour (since 10/9 > 1), but England has a comparative advantage in producing cloth due to lower opportunity cost.
In other words, if it is cheaper for a country to produce one good relative to a second, then they will have a comparative advantage and an incentive to produce more of that good which is relatively cheaper for them to produce than the other—assuming they have an advantageous opportunity to trade in the marketplace for the other more difficult to produce good. Similarly, most anyone should take the opportunity to offer in the marketplace a good which they have a relative advantage in producing.
In the absence of trade, England requires 220 hours of work to both produce and consume one unit each of cloth and wine while Portugal requires 170 hours of work to produce and consume the same quantities. England is more efficient at producing cloth than wine, and Portugal is more efficient at producing wine than cloth. So, if each country specializes in the good for which it has a comparative advantage, then the global production of both goods increases, for England can spend 220 labor hours to produce 2.2 units of cloth while Portugal can spend 170 hours to produce 2.125 units of wine. Moreover, if both countries specialize in the above manner and England trades a unit of its cloth for 5/6 to 9/8 units of Portugal's wine, then both countries can consume at least a unit each of cloth and wine, with 0 to 0.2 units of cloth and 0 to 0.125 units of wine remaining in each respective country to be consumed or exported. Consequently, both England and Portugal can consume more wine and cloth under free trade than in autarky.
The Ricardian model is a general equilibrium mathematical model of international trade. Although the idea of the Ricardian model was first presented in the Essay on Profits (a single-commodity version) and then in the Principles (a multi-commodity version) by David Ricardo, the first mathematical Ricardian model was published by William Whewell in 1833. The earliest test of the Ricardian model was performed by G.D.A MacDougall, which was published in Economic Journal of 1951 and 1952.  In the Ricardian model, trade patterns depend on productivity differences.
The following is a typical modern interpretation of the classical Ricardian model. In the interest of simplicity, it uses notation and definitions, such as opportunity cost, unavailable to Ricardo.
The world economy consists of two countries, Home and Foreign, which produce wine and cloth. Labor, the only factor of production, is mobile domestically but not internationally; there may be migration between sectors but not between countries. We denote the labor force in Home by , the amount of labor required to produce one unit of wine in Home by , and the amount of labor required to produce one unit of cloth in Home by . The total amount of wine and cloth produced in Home are and respectively. We denote the same variables for Foreign by appending a prime. For instance, is the amount of labor needed to produce a unit of wine in Foreign.
We don't know if Home can produce cloth using fewer hours of work than Foreign. That is, we don't know if . Similarly, we don't know if Home can produce wine using fewer hours of work. However, we assume Home is relatively more productive than Foreign in making in cloth vs. wine:
Equivalently, we may assume that Home has a comparative advantage in cloth in the sense that it has a lower opportunity cost for cloth in terms of wine than Foreign:
In the absence of trade, the relative price of cloth and wine in each country is determined solely by the relative labor cost of the goods. Hence the relative autarky price of cloth is in Home and in Foreign. With free trade, the price of cloth or wine in either country is the world price or.
Instead of considering the world demand (or supply) for cloth and wine, we are interested in the world relative demand (or relative supply) for cloth and wine, which we define as the ratio of the world demand (or supply) for cloth to the world demand (or supply) for wine. In general equilibrium, the world relative price will be determined uniquely by the intersection of world relative demand and world relative supply curves.
We assume that the relative demand curve reflects substitution effects and is decreasing with respect to relative price. The behavior of the relative supply curve, however, warrants closer study. Recalling our original assumption that Home has a comparative advantage in cloth, we consider five possibilities for the relative quantity of cloth supplied at a given price.
As long as the relative demand is finite, the relative price is always bounded by the inequality
In autarky, Home faces a production constraint of the form
from which it follows that Home's cloth consumption at the production possibilities frontier is
With free trade, Home produces cloth exclusively, an amount of which it exports in exchange for wine at the prevailing rate. Thus Home's overall consumption is now subject to the constraint
while its cloth consumption at the consumption possibilities frontier is given by
A symmetric argument holds for Foreign. Therefore, by trading and specializing in a good for which it has a comparative advantage, each country can expand its consumption possibilities. Consumers can choose from bundles of wine and cloth that they could not have produced themselves in closed economies.
There is another way to prove the theory of comparative advantage, which requires less assumption than the above-detailed proof, and in particular does not require for the hourly wages to be equal in both industries, nor requires any equilibrium between offer and demand on the market. Such a proof can be extended to situations with many goods and many countries, non constant returns and more than one factor of production.
Terms of trade is the rate at which one good could be traded for another. If both countries specialize in the good for which they have a comparative advantage then trade, the terms of trade for a good (that benefit both entities) will fall between each entities opportunity costs. In the example above one unit of cloth would trade for between units of wine and units of wine.
In 1930 Austrian-American economist Gottfried Haberler detached the doctrine of comparative advantage from Ricardo's labor theory of value and provided a modern opportunity cost formulation. Haberler's reformulation of comparative advantage revolutionized the theory of international trade and laid the conceptual groundwork of modern trade theories.
Haberler's innovation was to reformulate the theory of comparative advantage such that the value of good X is measured in terms of the forgone units of production of good Y rather than the labor units necessary to produce good X, as in the Ricardian formulation. Haberler implemented this opportunity-cost formulation of comparative advantage by introducing the concept of a production possibility curve into international trade theory.
Since 1817, economists have attempted to generalize the Ricardian model and derive the principle of comparative advantage in broader settings, most notably in the neoclassical specific factors Ricardo-Viner (which allows for the model to include more factors than just labour) and factor proportions Heckscher–Ohlin models. Subsequent developments in the new trade theory, motivated in part by the empirical shortcomings of the H–O model and its inability to explain intra-industry trade, have provided an explanation for aspects of trade that are not accounted for by comparative advantage. Nonetheless, economists like Alan Deardorff, Avinash Dixit, Gottfried Haberler, and Victor D. Norman have responded with weaker generalizations of the principle of comparative advantage, in which countries will only tend to export goods for which they have a comparative advantage.
In both the Ricardian and H–O models, the comparative advantage theory is formulated for a 2 countries/2 commodities case. It can be extended to a 2 countries/many commodities case, or a many countries/2 commodities case. Adding commodities in order to have a smooth continuum of goods is the major insight of the seminal paper by Dornbusch, Fisher, and Samuelson. In fact, inserting an increasing number of goods into the chain of comparative advantage makes the gaps between the ratios of the labor requirements negligible, in which case the three types of equilibria around any good in the original model collapse to the same outcome. It notably allows for transportation costs to be incorporated, although the framework remains restricted to two countries. But in the case with many countries (more than 3 countries) and many commodities (more than 3 commodities), the notion of comparative advantage requires a substantially more complex formulation.
Skeptics of comparative advantage have underlined that its theoretical implications hardly hold when applied to individual commodities or pairs of commodities in a world of multiple commodities. Deardorff argues that the insights of comparative advantage remain valid if the theory is restated in terms of averages across all commodities. His models provide multiple insights on the correlations between vectors of trade and vectors with relative-autarky-price measures of comparative advantage. "Deardorff's general law of comparative advantage" is a model incorporating multiple goods which takes into account tariffs, transportation costs, and other obstacles to trade.
Recently, Y. Shiozawa succeeded in constructing a theory of international value in the tradition of Ricardo's cost-of-production theory of value. This was based on a wide range of assumptions: Many countries; Many commodities; Several production techniques for a product in a country; Input trade (intermediate goods are freely traded); Durable capital goods with constant efficiency during a predetermined lifetime; No transportation cost (extendable to positive cost cases).
In a famous comment, McKenzie pointed that "A moment's consideration will convince one that Lancashire would be unlikely to produce cotton cloth if the cotton had to be grown in England." However, McKenzie and later researchers could not produce a general theory which includes traded input goods because of the mathematical difficulty. As John Chipman points it, McKenzie found that "introduction of trade in intermediate product necessitates a fundamental alteration in classical analysis." Durable capital goods such as machines and installations are inputs to the productions in the same title as part and ingredients.
In view of the new theory, no physical criterion exists. Deardorff examines 10 versions of definitions in two groups but could not give a general formula for the case with intermediate goods. The competitive patterns are determined by the traders trials to find cheapest products in a world. The search of cheapest product is achieved by world optimal procurement. Thus the new theory explains how the global supply chains are formed.
Comparative advantage is a theory about the benefits that specialization and trade would bring, rather than a strict prediction about actual behavior. (In practice, governments restrict international trade for a variety of reasons; under Ulysses S. Grant, the US postponed opening up to free trade until its industries were up to strength, following the example set earlier by Britain.) Nonetheless there is a large amount of empirical work testing the predictions of comparative advantage. The empirical works usually involve testing predictions of a particular model. For example, the Ricardian model predicts that technological differences in countries result in differences in labor productivity. The differences in labor productivity in turn determine the comparative advantages across different countries. Testing the Ricardian model for instance involves looking at the relationship between relative labor productivity and international trade patterns. A country that is relatively efficient in producing shoes tends to export shoes.
Assessing the validity of comparative advantage on a global scale with the examples of contemporary economies is analytically challenging because of the multiple factors driving globalization: indeed, investment, migration, and technological change play a role in addition to trade. Even if we could isolate the workings of open trade from other processes, establishing its causal impact also remains complicated: it would require a comparison with a counterfactual world without open trade. Considering the durability of different aspects of globalization, it is hard to assess the sole impact of open trade on a particular economy.
Daniel Bernhofen and John Brown have attempted to address this issue, by using a natural experiment of a sudden transition to open trade in a market economy. They focus on the case of Japan. The Japanese economy indeed developed over several centuries under autarky and a quasi-isolation from international trade but was, by the mid-19th century, a sophisticated market economy with a population of 30 million. Under Western military pressure, Japan opened its economy to foreign trade through a series of unequal treaties.
In 1859, the treaties limited tariffs to 5% and opened trade to Westerners. Considering that the transition from autarky, or self-sufficiency, to open trade was brutal, few changes to the fundamentals of the economy occurred in the first 20 years of trade. The general law of comparative advantage theorizes that an economy should, on average, export goods with low self-sufficiency prices and import goods with high self-sufficiency prices. Bernhofen and Brown found that by 1869, the price of Japan's main export, silk and derivatives, saw a 100% increase in real terms, while the prices of numerous imported goods declined of 30-75%. In the next decade, the ratio of imports to gross domestic product reached 4%.
Another important way of demonstrating the validity of comparative advantage has consisted in 'structural estimation' approaches. These approaches have built on the Ricardian formulation of two goods for two countries and subsequent models with many goods or many countries. The aim has been to reach a formulation accounting for both multiple goods and multiple countries, in order to reflect real-world conditions more accurately. Jonathan Eaton and Samuel Kortum underlined that a convincing model needed to incorporate the idea of a 'continuum of goods' developed by Dornbusch et al. for both goods and countries. They were able to do so by allowing for an arbitrary (integer) number i of countries, and dealing exclusively with unit labor requirements for each good (one for each point on the unit interval) in each country (of which there are i).
Two of the first tests of comparative advantage were by MacDougall (1951, 1952). A prediction of a two-country Ricardian comparative advantage model is that countries will export goods where output per worker (i.e. productivity) is higher. That is, we expect a positive relationship between output per worker and number of exports. MacDougall tested this relationship with data from the US and UK, and did indeed find a positive relationship. The statistical test of this positive relationship was replicated with new data by Stern (1962) and Balassa (1963).
Dosi et al. (1988) conduct a book-length empirical examination that suggests that international trade in manufactured goods is largely driven by differences in national technological competencies.
One critique of the textbook model of comparative advantage is that there are only two goods. The results of the model are robust to this assumption. Dornbusch et al. (1977) generalized the theory to allow for such a large number of goods as to form a smooth continuum. Based in part on these generalizations of the model, Davis (1995) provides a more recent view of the Ricardian approach to explain trade between countries with similar resources.
More recently, Golub and Hsieh (2000) presents modern statistical analysis of the relationship between relative productivity and trade patterns, which finds reasonably strong correlations, and Nunn (2007) finds that countries that have greater enforcement of contracts specialize in goods that require relationship-specific investments.
Taking a broader perspective, there has been work about the benefits of international trade. Zimring & Etkes (2014) finds that the Blockade of the Gaza Strip, which substantially restricted the availability of imports to Gaza, saw labor productivity fall by 20% in three years. Markusen et al. (1994) reports the effects of moving away from autarky to free trade during the Meiji Restoration, with the result that national income increased by up to 65% in 15 years.
Several arguments have been advanced against using comparative advantage as a justification for advocating free trade, and they have gained an audience among economists. James Brander and Barbara Spencer demonstrated how, in a strategic setting where a few firms compete for the world market, export subsidies and import restrictions can keep foreign firms from competing with national firms, increasing welfare in the country implementing these so-called strategic trade policies.
There are some economists who dispute the claims of the benefit of comparative advantage. James K. Galbraith has stated that "free trade has attained the status of a god" and that " ... none of the world's most successful trading regions, including Japan, Korea, Taiwan, and now mainland China, reached their current status by adopting neoliberal trading rules." He argues that comparative advantage relies on the assumption of constant returns, which he states is not generally the case. According to Galbraith, nations trapped into specializing in agriculture are condemned to perpetual poverty, as agriculture is dependent on land, a finite non-increasing natural resource.