trade
Reference ManualDisclaimer: The views expressed herein are entirely those of
the authors and should not be purported to reflect those of the Federal
Trade Commission. The trade
package has been released into
the public domain without warranty of any kind, expressed or implied. We
thank Ronald Drennan, Robert Majure, Russell Pittman, Gloria Sheu,
Nathan Miller, Randy Chugh, Marc Remer, Alexander Raskovich, William
Drake, Thomas Jeitschko, Greg Werden, Luke Froeb, Nicholas Hill, and
Conor Ryan. Address: Bureau of Economics #202, Federal Trade Commission,
600 Pennsylvania Ave. NW, Washington, DC 20530. email: [email protected]
trade
is a suite of tools that may be used in assessing
the implications of tariffs. The package contains functions that can
calibrate the underlying parameters of a number of different supply and
demand models as well as simulate the effects of tariffs in different
strategic environments. The output generated by these tools includes
interesting features such as predicted price increases, welfare measures
and demand elasticities.
There are four features of trade
that make it
particularly useful for practitioners. First, trade
collects a number of useful models onto a common platform, making it
easy for practitioners to compare and contrast the results from
different models.
Second, trade
is open source software that runs on the
R open source platform. Practically speaking, this
means that practitioners not only have the flexibility to run this
software wherever and whenever they wish, but they can also modify and
extend the software as they see fit. We hope that having this collection
of tools on a common, open source platform will facilitate discussion
and collaboration among practitioners.
Third, trade
includes a web interface built using
shiny
. While this interface does not give users access to
the full array of functionality in trade
, it is simple to
use and may provide first-time users, particularly those who are
unfamiliar with R, a gentler introduction to
trade
. The interface may be invoked using the
ct_shiny
function in the competitiontoolbox
package.
Finally, the functions included in trade
typically
require relatively little information to generate a prediction.
The limited information needed for the economic models used in
trade
comes at some cost. First, the output of these models
is sensitive to the supplied inputs. For instance, when employing the
Bertrand model, inaccurate margins, shares and prices can yield
inaccurate estimates of demand and cost parameters which can in turn
yield incorrect predictions of a tariff’s effects. Calibrating model
parameters with an array of plausible inputs will yield a range of
outputs and illustrate the sensitivity of each model to those inputs.
One way to control for inaccurate inputs is to calibrate model
parameters with different plausible inputs to see how the model output
changes. Users can then report a range of plausible outputs in their
analysis.
Moreover, none of the parameters calibrated by trade
may
be used in frequentist statistical hypothesis testing. In other words,
while the economic models in trade
may be used to generate
reliable estimates of the effects of a new tariff regime, statistical
tests cannot be used to determine the accuracy of these estimates.
Accomplishing this requires additional data and is beyond the current
scope of trade
.
This document provides an introduction to the economic theory upon
which the trade
package’s functions are built. Please use
the help
function for assistance invoking any of the
functions, classes, or methods included in trade
.
Alternatively, please refer to the vignette and manpages of
trade
’s sister package antitrust
from which
much of trade
was generated.
Much of trade
‘s functionality is built around the
Bertrand pricing game.1 This version of the game assumes that firms
producing multiple differentiated products with distinct, constant,
marginal costs simultaneously set their products’ prices to maximize
their profits. In this model, prices are strategic complements
in the sense that increasing the price of one product causes some
customers to switch to other products, raising the quantities sold and
therefore the profit-maximizing prices of these other products.
Ultimately, it is the magnitude of these lost sales that, at the margin,
dissuades firms from raising their prices further.
Tariffs are modeled by effectively assuming that the marginal costs
of certain products produced by foreign firms increase by the amount of
the tariff. Because all products included in trade
models
are assumed to be substitutes, this marginal cost increase causes
foreign firms to raise the price of their products, which in turn causes
some customers to either switch to other products in the market or to
forgo purchasing any product in the market entirely.
The Bertrand model predicts that tariffs will harm customers and foreign firms, but benefit domestic firms and raise government revenues. The magnitude of these effects, however, will depend on demand specification as well as the set of inputs used.2
Currently, this version of the Bertrand model does not allow firms to add or reposition products, or allow firms to engage in some forms of price discrimination.
The primary trade
function responsible for modeling
tariffs in a Bertrand game is bertrand_tariff
.
Suppose that there are K firms in a market, and that each of the k ∈ K firms produces nk products, some of which may be produced domestically and some of which may be produced abroad.3 Further, suppose that the government imposes an ad valorem tariff ti on a subset of products produced abroad. Note that we assume that the tariff is calculated as a proportion of consumer price, so that the price received by the firm is 1 − ti the price faced by consumers.
Let $n=\sum\limits_{k\in K}n_k$ denote the number of products sold by all K firms. The Bertrand model assumes that firms simultaneously set their products’ prices in order to maximize their profits. This model also assumes that all firms can perfectly observe each others’ prices, quantities, costs, and product characteristics.
This version of the Bertrand model also assumes that each product is produced using its own distinct constant marginal cost technology ci, for all i ∈ n. As we will see, this assumption is necessary when information is limited.
Firm k ∈ K chooses the prices {pi}i = 1nk of its products so as to maximize profits. Mathematically, firm k solves:
where ti equals 0 if the product is not subject to a tariff. qi, the quantity sold of product i, is assumed to be a twice differentiable function of all product prices.
Differentiating profits with respect to each pi yields the following first order conditions (FOCs):
which may be rewritten as
where $r_i\equiv\frac{p_iq_i}{\sum\limits_{j=1}^np_jq_j}$ is product i’s revenue share, $\hat{c}_i\equiv \frac{c_i}{(1-t_i)}$ is product i’s effective marginal cost, $m_i\equiv\frac{p_i-\hat{c}_i}{p_i}$ is product i’s gross margin, and $\epsilon_{ij}\equiv\frac{\partial q_i}{\partial p_j}\frac{p_j}{q_i}$ is the elasticity of product i with respect to the price of product j.
The FOCs for all products may be stacked and then represented using the following matrix notation:
where r and m are n-length vectors of revenue shares and margins, $E = \left(\begin{smallmatrix} \epsilon_{11}&\ldots&\epsilon_{1n}\\\vdots &\ddots&\vdots\\\epsilon_{n1}&\ldots&\epsilon_{nn} \end{smallmatrix}\right)$ is a n × n matrix of own- and cross-price elasticities, and $\Omega=\left(\begin{smallmatrix} \omega_{11}(1-t_1)&\ldots&\omega_{1n}(1-t_1)\\\vdots &\ddots&\vdots\\\omega_{n1}(1-t_n)&\ldots&\omega_{nn}(1-t_n)\end{smallmatrix}\right)$ is an n × n matrix whose i, jth element equals ωij, the share of product j’s profits owned by the firm setting product i’s price, multiplied by 1 − ti, product i’s tariff rate. In many cases, product i and j are wholly owned by a single firm, in which cases ωij equals 1 if i and j are owned by the same firm and 0 otherwise. ‘diag’ returns the diagonal of a square matrix and ‘∘’ is the Hadamard (entry-wise) product operator.
The solution to system @ref(eq:FOC) yields equilibrium prices conditional on the ownership structure Ω and tariffs ti, ∀i ∈ n. A change in tariff policy is modeled as the solution to system @ref(eq:FOC) where Ω and ĉi, ∀i ∈ n are updated to reflect the change in tariffs.
The Bertrand model described above assumes that products are produced with constant marginal costs and no quotas. Here, we extend this model to allow for quotas.4
Firm k ∈ K chooses the prices {pi}i = 1nk of its products so as to maximize profits, subject to quotas $\{\overline{q}_i\}_{i=1}^{n_k}$. Mathematically, firm k solves:
In general, either the capacity constraint for product i will bind and the firm will be forced to produce less of i than it would find optimal, or the capacity constraint will not bind, and the firm will produce the optimal amount implied by the FOCs. In the former, it can be shown that ∂pi ≤ 0 and $q_i - \overline{q}_i=0$, while in the latter ∂pi = 0 and $q_i - \overline{q}_i \le 0$. Mathematically, these cases can be written as
The FOCs for the quota-constrained Bertrand game (equation ) suffer from an additional complication: the function introduces a kink that can make it difficult for the non-linear equation solver to find equilibrium prices. Froeb, Tschantz, and Crooke (2003) suggests replacing equation @ref(eq:FOCC) with
which has the same roots as equation @ref(eq:FOCC), but is smoother. The method for all classes based on the capacity-constrained Bertrand Model use this smoothed system to solve for equilibrium prices when the constraint is binding.
For the Logit, CES, and AIDS demand specifications allowed under this implementation of the Bertrand model, the calibration strategy is the same. First, we assume that quantities/shares and (with the exception of LA-AIDS) prices are observed for all products in the market, and that margins for some products are observed. Our decision to treat quantities, prices, and margins as primitives comes directly from equation @ref(eq:FOC).
In addition to quantities, prices, some margins and capacities, we assume that users observe diversion ratios. Diversion ratios come in two forms: quantity diversion and revenue diversion. The quantity diversion from product i to product j, dijq, is defined as the percentage of all of i’s lost unit sales that switch to j due to a price increase in product i, while the revenue diversion from product i to product j, dijr, is defined as the percentage of all of i’s lost revenue that switches to j due to a price increase in product i. Mathematically, quantity and revenue diversion may be represented as
Note that dijq, dijr
are restricted to be between -1 and 1, and are positive if products
i and j are substitutes and negative if
they are complements. Additionally, conditional on customers switching
from product i, they must
switch to another product (i.e. ∑jdij ≤ 0).
For all the models included in trade
, we assume that i and j are not complements (dij ≥ 0)
and for some demand models (i.e. AIDS) we will assume that ∑jdij = 0.
Although diversion ratios are not present in equation @ref(eq:FOC), these definitions indicate that diversion ratios may be helpful in recovering the matrix of own- and cross-price elasticities E. Indeed, for a number of the demand systems described below, diversions will be used for just this purpose.
We further assume that all of this information represents the outcome of the unique current equilibrium for firms in the market playing the static Bertrand pricing game described above. We then substitute observed margins, shares and prices into equation @ref(eq:FOC), which is now solely a function of demand parameters, and then solve for the coefficient(s) on prices. Once the price coefficients have been estimated, we use observed prices and the demand equations to estimate the intercepts.
Often, there are more FOCs than unknown price coefficients. For instance, under Logit demand, only the price parameter α and the share of the outside good s0 needs to be estimated and up to n FOCs with which to estimate it. This means that at a minimum, users need only supply enough margin information to complete a single product’s FOC. If that product happens to be owned by a single-product firm, then only one margin is necessary. On the other hand, if the product happens to be owned by a multi-product firm, then at a minimum, all the margins for products owned by that firm must be supplied.
The (Marshallian) demand specifications used in trade
can be grouped into two categories: demand systems that are derived from
a representative consumer’s expenditure function and demand systems that
are derived from a representative consumer’s indirect utility function.
The LA-AIDS demand system fall into the former category, while the Logit
and CES fall into the latter category. Below, we briefly discuss these
demand systems as well as the assumptions and/or data needed to recover
estimates of the demand parameters.
We conclude this section with a discussion of how calibrated demand parameters and the FOCs can be used to calibrate product-specific constant marginal costs.
The Bertrand model with the linear approximate Almost Ideal Demand
System (LA-AIDS) may be implemented using the
bertrand_tariff
function with ‘demand’ equal to “aids.”
The LA-AIDS without income effects assumes that the demand for each product i ∈ n in the market is given by
which may be written in matrix notation as
where r, p are vectors of product revenue shares and prices, α is a vector of product-specific demand intercepts and B is a matrix of slopes.7
The LA-AIDS model yields the following own- and cross-price elasticities:
where ϵ is the market elasticity of demand.
The LA-AIDS model assumes that B is symmetric, satisfies homogeneity of degree zero in prices, and that diversion is known. The LA-AIDS model, however, assumes that revenue diversion, rather than quantity diversion is observed.8 Under these two assumptions, there are $\frac{n(n+3)}{2}$ unknown demand parameters ($\frac{n(n-1)}{2}$ diagonal elements in B, n diagonal elements, and n intercepts) and up to n(n + 1) equations (n(n − 1) diversion equations, n FOCs and n demand equations), in which case the system is over-identified.9
Unlike the Logit and CES models described above, none of the LA-AIDS model’s equations are a function of the share of the outside good. Instead, these equations are a function of the market elasticity of demand ϵ. Roughly speaking, ϵ controls the extent to which consumers substitute to products outside the n products included in the simulation given a small change in market-wide product prices. Here, we assume that ϵ is a parameter whose value is not a function of product prices.10
The calcSlopes
method, called by the aids
function to calibrate the AIDS parameters, uses a minimum distance
algorithm to find the ϵ (if
not supplied using the ‘mktElast’ argument) and a single diagonal
element of B that best satisfy
i) all the FOCs for which there is sufficient information and ii) the
diversion equations $d_{ij}=-\frac{\beta_{ji}}{\beta_{ii}}$, and
iii) the market elasticity (if supplied using the ‘mktElast’ argument).
The βii’s
are recovered from the fact that ∑jdij = 0;
customers must switch to a product included in the model.
Another distinguishing feature of the LA-AIDS model is that it does
not require any information on product prices in order to simulate
tariff price effects. The LA-AIDS accomplishes this by using the
supplied margin and revenue information to estimate B, but not α. There are, however, a few
drawbacks to not using pricing information. First, while tariff-specific
price changes may be calculated, pre- and post-tariff price
levels cannot. Second, welfare measures like compensating
variation cannot be calculated. Prices are an optional input to
aids
and pcaids
, and when they are supplied
both price levels and welfare measures may be calculated.
Another model included in trade
is the Cournot quantity
game. This version of the game assumes that multi-plant firms with
distinct, increasing marginal costs producing multiple products
simultaneously set plant output for each product to maximize their
profits.11 All firms producing a particular product
are assumed to be undifferentiated. In this model, quantities are
strategic substitutes in the sense that decreasing the quantity
of one product causes some customers to switch to competing
manufacturers, raising their quantities and profits. Ultimately, it is
the magnitude of these lost sales that, at the margin, dissuades firms
from reducing their output further .
Similar to the Bertrand model, tariffs are modeled by effectively
assuming that the marginal costs of certain products produced by foreign
firms increase by the amount of the tariff. Because all plants included
in trade
models are assumed to be producing substitutes,
this marginal cost increase causes foreign firms to restrict plant
output, which in turn raises product price.
Because all firms are manufacturing an identical version of the product, this version of the Cournot model allows firms under the new tariff regime to start or stop producing other products. This model does not allow for firms to engage in some forms of price discrimination.12
Suppose that there are K firms in a market, each producing a subset Jk of J products. Further, suppose that that each of the k ∈ K firms manufactures its Jk products at nk plants. Let n = ∑k ∈ Knk denote the total number of plants producing any of the J products. The Cournot model assumes that firms simultaneously set the amount of each product produced at each plant in order to maximize their profits. This model also assumes that all firms can perfectly observe each others’ quantities, and costs, as well as the demand for each product. Further, suppose that the government imposes an ad valorem tariff ti on a subset of products produced at plants located abroad. Note that we assume that the tariff is calculated as a proportion of consumer price, so that the price received by the firm is 1 − ti the price faced by consumers.
Functions in trade
’s Cournot model also adopt the
additional assumption that each firm’s plant has its own distinct
marginal cost technology.
Firm k ∈ K chooses product output at each plant $\{q_j^r\}_{\substack{j\in j_k,\\ r\in n_k}}$ so as to maximize profits. Mathematically, firm k solves:
subject to
where pj, the price sold of product j, is assumed to be a twice differentiable function of all firm quantities with $\frac{\partial p_j}{\partial q_j^r}< 0$ for all plants r and products j. Likewise, additively separable plant variable costs cr assumed to be twice differentiable with $\frac{\partial c^r}{\partial q_j^r}> 0$ . Finally, tjr is the tariff imposed on plant r producing product j.
Differentiating profits with respect to each qjr yields the following first order conditions (FOCs):
The Cournot model can yield different equilibrium quantity and price
predictions depending on 1) the curvature of plant variable costs and 2)
the curvature of demand. trade
allows users to explore the
consequences of different cost and demand assumptions.
Currently, cournot
contains two different ways to
specify plant costs. First, users can set the ‘cost’ option equal to a
n-length character vector
whose values are either equal to “linear” for linear marginal costs
($\frac{\partial c^r}{\partial q_j^r}=
0.5\gamma_r\sum_{j\in n_r}q_j^r$) or “constant” for constant
marginal costs ($\frac{\partial c^r}{\partial
q_j^r}= \gamma_r$) . When the ‘cost’ option is employed,
cournot
’s calcSlopes
method uses observed
costs (implied by predicted margins and prices) and prices to calibrate
plant-level cost parameters γr.
Alternatively, users can specify both plant-level marginal and
variable costs. Marginal costs may be specified by setting the
‘mcfunPre’ argument equal to a length n list of functions that each take
as an input the vector of product quantities produced at a plant and
then return the marginal cost associated with producing that level of
output at that plant. Likewise, the ‘vcfunPre’ argument can be similarly
used to specify plant-level variable costs. Note that when marginal
costs and variable costs are specified in this manner,
cournot
makes no attempt to calibrate any parameters on the
cost side.
Currently, cournot
allows users to specify that product
demand is either linear (pj = bj + aj∑k ∈ nqjk)
or log-linear (ln (pj) = bj + ajln (∑k ∈ nqjk)).
Users can specify product demand by setting cournot
‘s
’demand’ argument equal to a j-length character vector equal to
either “linear” for linear demand or “log” for log-linear demand.
trade
’s version of the Bertrand pricing
game extends Werden and Froeb (1994) and Anderson, Palma, and Kreider (2001a) to accommodate tariffs under
Bertrand price competition.↩︎
Specifically, the curvature of the demand curve greatly influences the results.↩︎
Throughout, we abuse the notation slightly by treating variables like K as both the set of firms as well as the number of firms.↩︎
This section is based on the model described in Froeb, Tschantz, and Crooke (2003).↩︎
The outside good is a nuisance parameter because it is only needed to obtain estimates of the other demand and cost parameters and is not used to solve for equilibrium prices.↩︎
Formally, each consumer chooses the product i ∈ I that yields the maximum utility Ui = ln (δiqi) + αln (q0) + ϵi, subject to the budget constraint y = piqi + q0. Here, qi is the amount of product i consumed by a consumer, δi is a measure of product i’s quality, q0 is the amount of the numeraire, y is consumer income, and ϵi are random variables independently and identically distributed according to the Type I Extreme Value distribution.↩︎
LA-AIDS differs from AIDS in that LA-AIDS substitutes the AIDS price index with Stone’s price index. Since this version of LA-AIDS is without income effects, Stone’s price index is only used to derive the own- and cross-price elasticities.↩︎
If the ‘diversion’ argument to
bertrand_tariff
is missing, bertrand_tariff
assumes diversion according to revenue share.↩︎
In fact, it turns out that only one element of B must be estimated.To see why, note that under symmetry, $\beta_{jj}=\frac{d_{ij}}{d_{ji}}\beta_{ii}$. Hence, if βii is known, then the preceding equation indicates that all the βjjs may be recovered. From here, the definition of diversion may be used to recover all the βijs.↩︎
This assumption implies that customers substitute to products outside of the simulation in response to price increases by all products in the simulation at the same rate before and after the change in tariffs.↩︎
trade
’s version of the Cournot quantity
game extends (Anderson, Palma, and Kreider 2001b)
to accommodate tariffs under Cournot quantity competition.↩︎
In particular, this version of the Bertrand model does not accommodate non-linear pricing, such as is used in 2nd or 3rd degree price discrimination.↩︎