| Title: | Tools for Antitrust Practitioners |
|---|---|
| Description: | A collection of tools for antitrust practitioners, including the ability to calibrate different consumer demand systems and simulate the effects of mergers under different competitive regimes. |
| Authors: | Charles Taragin [aut, cre], Michael Sandfort [aut], Shlok Goyal [ctb] |
| Maintainer: | Charles Taragin <[email protected]> |
| License: | CC0 |
| Version: | 0.99.43.9000 |
| Built: | 2026-11-10 05:46:18 UTC |
| Source: | https://github.com/luciu5/antitrust |
A collection of tools for antitrust practitioners, including the ability to calibrate different consumer demand systems and simulate the effects of mergers under different competitive regimes.
Choose a complete model with supportedModels.
Use calibrate for observed-market calibration or
specify when structural parameters are supplied, then
counterfactual and simulate for a scenario.
Start with vignette("Workflow", package = "antitrust") for a
merger workflow, then vignette("Models", package = "antitrust")
for economic assumptions. Package authors can use
vignette("Architecture", package = "antitrust") for fitted objects,
dispatch, and extension boundaries.
Direct model constructors remain available as compatibility and convenience
interfaces. cmcr.bertrand and cmcr.cournot
provide screening measures when a complete market fit is unavailable.
| Package: | antitrust |
| Type: | Package |
| Title: | Tools for Antitrust Practitioners |
| Version: | 0.99.43.9000 |
| Date: | 2026-11-01 |
| Authors@R: | c(person("Charles", "Taragin", email = "[email protected]", role = c("aut", "cre")), person("Michael", "Sandfort", role = c("aut")), person("Shlok", "Goyal", role = c("ctb")) ) |
| Maintainer: | Charles Taragin <[email protected]> |
| Author: | Charles Taragin [aut, cre], Michael Sandfort [aut], Shlok Goyal [ctb] |
| Imports: | methods, BB, numDeriv, nleqslv, SQUAREM |
| Suggests: | MASS, ggplot2, knitr, bookdown, rmarkdown, competitiontoolbox, testthat |
| VignetteBuilder: | knitr |
| Encoding: | UTF-8 |
| Description: | A collection of tools for antitrust practitioners, including the ability to calibrate different consumer demand systems and simulate the effects of mergers under different competitive regimes. |
| URL: | https://github.com/luciu5/antitrust |
| License: | CC0 |
| LazyLoad: | yes |
| Collate: | 'AntitrustClasses.R' 'BertrandClasses.R' 'BertrandRUMClasses.R' 'AuctionClasses.R' 'BargainingClasses.R' 'CournotClasses.R' 'OwnershipMethods.R' 'SummaryMethods.R' 'ShowMethods.R' 'AuctionCapMethods.R' 'PricesMethods.R' 'CostMethods.R' 'MarginsMethods.R' 'ParamsMethods.R' 'PriceDeltaMethods.R' 'PSMethods.R' 'OutputMethods.R' 'PlotMethods.R' 'HypoMonMethods.R' 'HHIMethods.R' 'UPPMethods.R' 'DiversionMethods.R' 'ElastMethods.R' 'CMCRMethods.R' 'CVMethods.R' 'DiagnosticsMethods.R' 'AIDSFunctions.R' 'AggregateGamesMethods.R' 'Antitrust_Shiny.R' 'AntitrustPackage.R' 'Auction2ndCapFunctions.R' 'Auction2ndLogitFunctions.R' 'BLPCalibration.R' 'BLPIntegration.R' 'BLPMeanval.R' 'BargainingCESFunctions.R' 'BargainingLogitFunctions.R' 'BertrandFunctions.R' 'CESFunctions.R' 'CMCRBertrandFunctions.R' 'CMCRCournotFunctions.R' 'Counterfactual.R' 'CounterfactualPath.R' 'CounterfactualPromotion.R' 'MarketAdvance.R' 'CournotFunctions.R' 'HHIFunctions.R' 'LinearFunctions.R' 'LogitCournotClasses.R' 'LogitFunctions.R' 'ModelArchitecture.R' 'ModelRegistry.R' 'ModelTranslations.R' 'MonComClasses.R' 'MonComFunctions.R' 'MonComMethods.R' 'Retention.R' 'SimFunctions.R' 'StructuralFitMethods.R' 'SyntheticMarket.R' 'SyntheticMarketAdapter.R' 'SyntheticMarketClass.R' 'SyntheticMarketDesign.R' 'antitrust-deprecated.R' 'realize_market.R' |
| Config/roxygen2/version: | 8.0.0 |
| Config/testthat/edition: | 3 |
| Config/antitrust/qa-canonical-r: | 4.6.1 |
| RoxygenNote: | 7.3.2 |
| Repository: | https://luciu5.r-universe.dev |
| Date/Publication: | 2026-11-10 04:48:48 UTC |
| RemoteUrl: | https://github.com/luciu5/antitrust |
| RemoteRef: | HEAD |
| RemoteSha: | f9712fcd5c08cbfb70aa2736139f08be91e85421 |
Index of help topics:
add_step Append a sequential counterfactual step
advance_market Advance a solved market without estimating or
solving it
AIDS-Functions (Nested) AIDS Calibration and Merger Simulation
Antitrust-Class "Antitrust" Classes
antitrust-package Tools for Antitrust Practitioners
AntitrustFit-class A calibrated structural model
Auction-Classes Class "Auction"
Auction2ndCap-Functions
(Capacity Constrained) 2nd Price Auction Model
Auction2ndLogit-Functions
2nd Score Procurement Auction Model with
(Nested) Logit Demand
AuctionCap-Methods Auction Cap Methods
Bargaining-Classes "Bargaining" Classes
BargainingCES-Functions
Nash Bargaining Model with CES Demand
BargainingLogit-Functions
Nash Bargaining Model with Logit Demand
Bertrand-Functions Bertrand Calibration and Merger Simulation With
Logit, CES and AIDS Demand
BertrandOther-Classes "Bertrand" Classes
BertrandRUM-Classes "Bertrand RUM" Classes
calcBLPintegration Select BLP Integration Points and Weights
calcMeanval Calculate BLP Mean Utilities via Contraction
Mapping
calibrate Calibrate a structural antitrust model
CES-Functions (Nested) Constant Elasticity of Substitution
Demand Calibration and Merger Simulation
CMCR-Methods Methods For Calculating Compensating Marginal
Cost Reductions
CMCRBertrand-Functions
Compensating Marginal Cost Reductions and
Upwards Pricing Pressure (Bertrand)
CMCRCournot-Functions Compensating Marginal Cost Reductions and
Upwards Pricing Pressure (Cournot)
combine_counterfactuals
Combine non-conflicting counterfactual changes
into one simultaneous step
compound_cost_shocks Compound structural marginal-cost shocks
Cost-Methods Methods for Calculating marginal and Variable
Costs
counterfactual Define a post-calibration economic
counterfactual
Counterfactual-class An ordered sequence of counterfactual steps
CounterfactualPath-class
The realized sequence of states from a
multi-step Counterfactual
CounterfactualStep-class
A single simultaneous set of counterfactual
changes
Cournot-classes "Cournot" Classes
Cournot-Functions Multi-product Cournot/Stackelberg Calibration
and Merger Simulation With Linear or Log-Linear
Demand
CV-Methods Methods For Calculating Compensating Variation
(CV)
defineMarketTools-methods
Methods For Implementing The Hypothetical
Monopolist Test
Diagnostics-Methods Methods for Calculating Diagnostics
Diversion-Methods Methods For Calculating Diversion
Elast-Methods Methods For Calculating Own and Cross-Price
Elasticities
entrant Define a new single-product entrant firm
Entrant-class A new single-product entrant firm
fake_market Generate a reproducible synthetic antitrust
market design
final_result The final solved legacy S4 result of a
CounterfactualPath
HHI-Functions Herfindahl-Hirschman Index
HHI-Methods Methods For Calculating the
Herfindahl-Hirschman Index
initialize_baseline_state
Initialize a fitted model's observed baseline
state
initialize_cost_state Initialize persistent structural cost state
Linear-Functions Linear and Log-Linear Demand Calibration and
Merger Simulation
Logit-Functions (Nested) Logit Demand Calibration and Merger
Simulation)
Margins-Methods Methods for Calculating Margins
MarginsAG-Methods Methods for Calculating Prices and Margins
Using Aggregative Games
market_design Return synthetic market design metadata
model_spec Describe a demand/conduct model combination
model_transition Look up a registered structural model
transition
MonCom-classes Monopolistic-competition classes
MonCom-Functions Monopolistic-competition calibration
Output-Methods Output Methods
Ownership-methods Methods for Manipulating Ownership Matrices
Params-Methods Methods for Calculating Demand Parameters
Plot-Methods Methods For Calculating Upwards Pricing
Pressure Index (Bertrand)
PriceDelta-Methods Methods For Calculating Price Delta
Prices-Methods "Calculating Prices" Methods
print.SyntheticMarket Print a synthetic market
profileBLP Profile the BLP calibration objective over
random-coefficient scale
PS-methods Producer Surplus Methods
realize_market Realize a synthetic market under a
model-specific specification
realize_market.SyntheticMarket
Realize a SyntheticMarket under multi-product
Bertrand Logit
respecify Respecify a fitted antitrust model
result_at The legacy S4 result at a given step of a
CounterfactualPath
setRetention Product revenue retention
Show-Methods Show Method
show,AntitrustFit-method
Print a calibrated structural model
Sim-Functions Merger Simulation With User-Supplied Demand
Parameters
simulate Simulate a counterfactual from a calibrated
structural model
simulate_markets Generate deterministic synthetic-market
replications
simulate_steps Resolve a sequence of counterfactual steps for
a fitted structural model
specify Construct a fitted structural model from
supplied parameters
StructuralFit-class A shared structural fit contract
summary-methods Summary Methods
summary,AntitrustFit-method
Summarize a calibrated structural model
supportedModels List demand/conduct combinations supported by
antitrust
synthetic_market Generate a model-consistent synthetic antitrust
market
SyntheticMarket A model-independent synthetic market design
update.AntitrustFit Recalibrate a fitted antitrust model
UPP-Methods Methods For Calculating Upwards Pricing
Pressure Index (Bertrand)
validate_counterfactual
Validate a counterfactual against a fitted
model
vertical.barg Vertical bargaining moved to the vertical
package
Charles Taragin [aut, cre], Michael Sandfort [aut], Shlok Goyal [ctb] Maintainer: Charles Taragin <[email protected]>
Useful links:
fit <- calibrate("logit", "bertrand", prices = c(2, 2.2, 2.5), shares = c(.35, .25, .20), margins = c(.40, .35, .30), ownerPre = c("A", "B", "C"), insideSize = 100) result <- simulate(fit, counterfactual(ownership = c("A", "A", "C"))) result@pricePostfit <- calibrate("logit", "bertrand", prices = c(2, 2.2, 2.5), shares = c(.35, .25, .20), margins = c(.40, .35, .30), ownerPre = c("A", "B", "C"), insideSize = 100) result <- simulate(fit, counterfactual(ownership = c("A", "A", "C"))) result@pricePost
'add_step()' appends one new, simultaneous 'CounterfactualStep' to a 'Counterfactual'. The appended step is solved starting from the equilibrium produced by the immediately preceding step (or, for the first appended step, the fitted baseline); it never replaces or recalibrates prior steps.
add_step(object, ...) ## S4 method for signature 'Counterfactual' add_step( object, ownership = NULL, costs = NULL, exit = NULL, capacity = NULL, tariff = NULL, quota = NULL, bargaining = NULL, leader = NULL, products = NULL, quality = NULL, entry = NULL, core = NULL, ... )add_step(object, ...) ## S4 method for signature 'Counterfactual' add_step( object, ownership = NULL, costs = NULL, exit = NULL, capacity = NULL, tariff = NULL, quota = NULL, bargaining = NULL, leader = NULL, products = NULL, quality = NULL, entry = NULL, core = NULL, ... )
object |
A 'Counterfactual' object. |
... |
Reserved; model specification fields are rejected. |
ownership |
Post-counterfactual ownership. |
costs |
Post-counterfactual marginal-cost changes. Constant-cost Bertrand-family models apply these to their retained structural cost primitives; second-score Logit uses its legacy additive cost-level convention. |
exit |
Products to remove, or a logical active-product vector. |
capacity |
Post-counterfactual capacities. |
tariff |
A tariff change, unsupported by antitrust models. |
quota |
A quota change, unsupported by antitrust models. |
bargaining |
Post-counterfactual bargaining parameters. |
leader |
Post-counterfactual leader indicators for Stackelberg models. |
products |
Post-counterfactual product structure for Stackelberg models. |
quality |
A named numeric vector of proportional changes to product attractiveness, keyed by product label. Logit applies an additive 'log1p(quality)' utility shift; CES applies a multiplicative change. |
entry |
An 'Entrant' object, or a list of 'Entrant' objects. |
core |
Core-firm IDs for downstream native coordination games; unsupported by ordinary antitrust fits. |
A 'Counterfactual' object with the new step appended.
Copies the solved post-state into the pre-state, preserving physical costs, demand parameters, retention, and the active-product map. Optional entry and quality primitives are then applied using the same transitions as antitrust counterfactuals. Ownership, cost shocks, exit, and policy changes belong to the subsequent simulation and are rejected here.
advance_market(model, step = NULL) ## S4 method for signature 'Antitrust' advance_market(model, step = NULL)advance_market(model, step = NULL) ## S4 method for signature 'Antitrust' advance_market(model, step = NULL)
model |
A solved legacy antitrust model. |
step |
An optional 'CounterfactualStep' containing only 'entry' and 'quality' changes. Entry support follows the concrete model registry. |
This is an extension point for packages that own additional policy state. It never recalibrates or solves an equilibrium. Constant costs are rebased at the solved effective cost and retention, with zero pending cost shock. The standard Logit second-score auction also advances its cost-relative score index, preserving win probabilities. Quantity-dependent cost-function models and other second-score descendants require their own method.
The advanced model, with any supplied environment changes applied.
Calibrates consumer demand using (nested) AIDS and then simulates the price effect of a merger between two firms under the assumption that all firms in the market are playing a differentiated products Bertrand game.
Below let k denote the number of products produced by all firms.
aids( shares, margins, prices, diversions, ownerPre, ownerPost, mktElast = NA_real_, insideSize = NA_real_, mcDelta = rep(0, length(shares)), subset = rep(TRUE, length(shares)), parmStart = rep(NA_real_, 2), priceStart = runif(length(shares)), isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(shares), sep = ""), ... ) pcaids( shares, knownElast, mktElast = -1, prices, diversions, ownerPre, ownerPost, knownElastIndex = 1, insideSize = NA_real_, mcDelta = rep(0, length(shares)), subset = rep(TRUE, length(shares)), priceStart = runif(length(shares)), isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(shares), sep = ""), ... ) pcaids.nests( shares, margins, knownElast, mktElast = -1, prices, ownerPre, ownerPost, nests = rep(1, length(shares)), knownElastIndex = 1, insideSize = NA_real_, mcDelta = rep(0, length(shares)), subset = rep(TRUE, length(shares)), priceStart = runif(length(shares)), isMax = FALSE, nestsParmStart, control.slopes, control.equ, labels = paste("Prod", 1:length(shares), sep = ""), ... )aids( shares, margins, prices, diversions, ownerPre, ownerPost, mktElast = NA_real_, insideSize = NA_real_, mcDelta = rep(0, length(shares)), subset = rep(TRUE, length(shares)), parmStart = rep(NA_real_, 2), priceStart = runif(length(shares)), isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(shares), sep = ""), ... ) pcaids( shares, knownElast, mktElast = -1, prices, diversions, ownerPre, ownerPost, knownElastIndex = 1, insideSize = NA_real_, mcDelta = rep(0, length(shares)), subset = rep(TRUE, length(shares)), priceStart = runif(length(shares)), isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(shares), sep = ""), ... ) pcaids.nests( shares, margins, knownElast, mktElast = -1, prices, ownerPre, ownerPost, nests = rep(1, length(shares)), knownElastIndex = 1, insideSize = NA_real_, mcDelta = rep(0, length(shares)), subset = rep(TRUE, length(shares)), priceStart = runif(length(shares)), isMax = FALSE, nestsParmStart, control.slopes, control.equ, labels = paste("Prod", 1:length(shares), sep = ""), ... )
shares |
A length k vector of product revenue shares. All shares must be between 0 and 1. |
margins |
A length k vector of product margins. All margins must be either be between 0 and 1, or NA. |
prices |
A length k vector product prices. Default is missing, in which case demand intercepts are not calibrated. |
diversions |
A k x k matrix of diversion ratios with diagonal elements equal to -1. Default is missing, in which case diversion according to revenue share is assumed. |
ownerPre |
EITHER a vector of length k whose values indicate which firm produced a product before the merger OR a k x k matrix of pre-merger ownership shares. |
ownerPost |
EITHER a vector of length k whose values indicate which firm produced a product after the merger OR a k x k matrix of post-merger ownership shares. |
mktElast |
A negative number equal to the industry pre-merger
price elasticity. Default is NA for |
insideSize |
Total expenditure (revenues) on products included in the simulation. |
mcDelta |
A vector of length k where each element equals the proportional change in a product's marginal costs due to the merger. Default is 0, which assumes that the merger does not affect any products' marginal cost. |
subset |
A vector of length k where each element equals TRUE if the product indexed by that element should be included in the post-merger simulation and FALSE if it should be excluded.Default is a length k vector of TRUE. |
parmStart |
|
priceStart |
A vector of length k who elements equal to an initial guess of the proportional change in price caused by the merger. The default is to draw k random elements from a [0,1] uniform distribution. |
isMax |
If TRUE, checks to see whether computed price equilibrium locally maximizes firm profits and returns a warning if not. Default is FALSE. |
control.slopes |
A list of |
control.equ |
A list of |
labels |
A k-length vector of labels. |
... |
Additional options to feed to the |
knownElast |
A negative number equal to the pre-merger own-price elasticity for any of the k products. |
knownElastIndex |
An integer equal to the position of the ‘knownElast’ product in the ‘shares’ vector. Default is 1, which assumes that the own-price elasticity of the first product is known. |
nests |
A length k vector identifying which nest a product belongs to. Default is that all products belong to a single nest. |
nestsParmStart |
A vector of starting values used to solve for price coefficient and nest parameters. If missing then the random draws with the appropriate restrictions are employed. |
Using product market revenue shares and all of the
product product margins from at least two firms, aids is able to
recover the slopes in a proportionally calibrated Almost Ideal Demand System (AIDS)
without income effects. aids then uses these slopes to simulate the
price effects of a merger between
two firms under the assumption that all firms in the market are
playing a differentiated Bertrand pricing game.
If prices are also supplied, aids is able to recover the
intercepts from the AIDS demand system. Intercepts are helpful because
they can be used to simulate pre- and post-merger price levels as well as price
changes. Whatsmore, the intercepts are necessary in order to
calculate compensating variation.
aids assumes that diversion between the products
in the market occurs according to revenue share. This assumption may be relaxed
by setting ‘diversions’ equal to a k x k matrix of diversion
ratios. The diagonal of this matrix must equal -1, the off-diagonal
elements must be between 0 and 1, and the rows must sum to 1.
pcaids is almost identical to aids, but instead of
assuming that at least two margins are known, pcaids assumes
that the own-price elasticity of any single
product, and the industry-wide own-price elasticity, are
known. Demand intercepts cannot be recovered using pcaids.
pcaids.nests extends pcaids by allowing products
to be grouped into nests. Although products within the same nest still
have the independence of irrelevant alternatives (IIA) property,
products in different nests do not. Note that the ‘diversions’
argument is absent from pcaids.nests.
pcaids.nests assumes that the share diversion between nests is symmetric
(i.e for 2 nests A and B, the diversion from A to B is the same as B to
A). Therefore, if there are nests, , then the model
must estimate distinct nesting parameters. To accomplish
this, pcaids.nests uses margin information to produce estimates of
the nesting parameters. It is important to note that the number of
supplied margins must be at least as great as the number of nesting
parameters in order for PCAIDS to work.
The nesting parameters are constrained to be between 0 and 1. Therefore, one way to test the validity of the nesting structure is to check whether the nesting parameters are between 0 and 1. The value of the nesting parameters may be obtained from calling either the ‘summary’ or ‘getNestsParms’ functions.
aids returns an instance of class
AIDS, a child class of Linear.
pcaids returns an instance of class
PCAIDS, while pcaids.nests returns an
instance of PCAIDSNests. Both are
children of the AIDS class.
Charles Taragin [email protected]
Epstein, Roy and Rubinfeld, Daniel (2004). “Merger Simulation with Brand-Level Margin Data: Extending PCAIDS with Nests.” The B.E. Journal of Economic Analysis and Policy, advances.4(1), pp. 2.
Epstein, Roy and Rubinfeld, Daniel (2004). “Effects of Mergers Involving Differentiated Products.”
linear for a demand system based on quantities
rather than revenue shares.
## The direct constructors remain available for distinct AIDS calibrations. shares <- c(.2, .3, .5) margins <- c(.33, .36, .44) pre <- c("A", "B", "C") post <- c("A", "A", "C") aids_fit <- aids(shares, margins, prices = c(2.9, 3.4, 2.2), ownerPre = pre, ownerPost = post) pcaids_fit <- pcaids(shares, knownElast = -3, mktElast = -1, ownerPre = pre, ownerPost = post) nested_fit <- pcaids.nests(shares, margins = margins, knownElast = -3, mktElast = -1, nests = c("H", "L", "L"), ownerPre = pre, ownerPost = post) c(aids = class(aids_fit)[1], pcaids = class(pcaids_fit)[1], nested = class(nested_fit)[1])## The direct constructors remain available for distinct AIDS calibrations. shares <- c(.2, .3, .5) margins <- c(.33, .36, .44) pre <- c("A", "B", "C") post <- c("A", "A", "C") aids_fit <- aids(shares, margins, prices = c(2.9, 3.4, 2.2), ownerPre = pre, ownerPost = post) pcaids_fit <- pcaids(shares, knownElast = -3, mktElast = -1, ownerPre = pre, ownerPost = post) nested_fit <- pcaids.nests(shares, margins = margins, knownElast = -3, mktElast = -1, nests = c("H", "L", "L"), ownerPre = pre, ownerPost = post) c(aids = class(aids_fit)[1], pcaids = class(pcaids_fit)[1], nested = class(nested_fit)[1])
The “Antitrust” class is a building block used to create other classes in this package. As such, it is most likely to be useful for developers who wish to code their own calibration/simulation routines.
Let k denote the number of products produced by all firms below.
pricePreA length k vector of simulated pre-merger prices.
pricePostA length k vector of simulated post-merger prices.
outputA length 1 logical vector equal to TRUE if merger simulates the effect in an output market, and FALSE if the merger simulates the effect in an input market. Default is TRUE.
ownerPreA k x k matrix of pre-merger ownership shares.
ownerPostA k x k matrix of post-merger ownership shares.
labelsA length k vector of labels.
control.slopesA list of optim control parameters passed to the calibration routine optimizer (typically the calcSlopes method).
control.equA list of BBsolve control parameters passed to the non-linear equation solver (typically the calcPrices method).
Objects can be created by calls of the form new("Antitrust", ...).
The “matrixOrList”,“matrixOrVector” and “characterOrList” classes are virtual classes used for validity checking in the ‘ownerPre’ and ‘ownerPost’ slots of “Antitrust” and the ‘slopes’ slot in “Bertrand”.
Charles Taragin [email protected]
showClass("Antitrust") # get a detailed description of the classshowClass("Antitrust") # get a detailed description of the class
'AntitrustFit' is a lightweight wrapper around an existing antitrust S4 model. It records the normalized model identity and calibration metadata while leaving simulation results as the package's existing S4 classes.
specAn antitrust_model_spec object.
modelThe calibrated existing S4 model state.
parametersStructural parameters recovered by calibration.
observedThe observed pre-merger inputs.
diagnosticsCalibration warnings, messages, and dispatch metadata.
The “Auction2ndCap” class contains all the information needed to calibrate a 2nd price auction with capacity constraints
The “Auction2ndLogit” class contains all the information needed to calibrate a Logit demand system and perform a merger simulation analysis under the assumption that firms are setting offers in a 2nd-score auction.
The “Auction2ndLogitNests” class contains all the information needed to calibrate a Nested Logit demand system and perform a merger simulation analysis under the assumption that firms are setting offers in a 2nd-score auction.
The “Auction2ndLogitALM” class contains all the information needed to calibrate a Logit demand system with unobserved outside share and perform a merger simulation analysis under the assumption that firms are setting offers in a 2nd-score auction.
Below, let k denote the number of firms.
The “Auction2ndCES” class contains all the information needed to calibrate a CES demand system and perform a merger simulation analysis under the assumption that firms are setting offers in a 2nd-score auction.
The “Auction2ndCESALM” class contains all the information needed to calibrate a CES demand system with unobserved outside share and perform a merger simulation analysis under the assumption that firms are setting offers in a 2nd-score auction.
)
capacitiesA length k vector of firm capacities.
marginsA length k vector of product margins, some of which may equal NA.
pricesA length k vector of product prices.
reserveA length 1 vector equal to observed buyer's reserve price. May equal NA.
shareInsideA length 1 vector equal to the probability that a buyer does not select the outside option. May equal NA.
sellerCostCDFA length 1 character vector equal to the name of the function that calculates the Cumulative Distribution (CDF) of SellerCosts.
sellerCostCDFLowerTailA length 1 logical vector equal to TRUE if the probabilities are P[X <= x], otherwise, P[X > x].
sellerCostPDFA function returning the Probability Density of Seller Costs.
sellerCostBoundsThe bounds on the seller's CDF.
sellerCostParmsThe parameters of the seller's CDF.
buyerValuationBuyer's self-supply cost.
reservePreBuyer's optimal pre-merger reservation price.
reservePostBuyer's optimal post-merger reservation price.
mcDeltaA length k vector equal to the proportional change in a firm's capacity following the merger.
parmsStartA vector of starting values.
Auction2ndCap: Objects can be created by using the constructor function auction2nd.cap.
Auction2ndLogit: Objects can be created by using the constructor function auction2nd.logit.
Auction2ndLogitNests: Objects can be created by using the constructor function auction2nd.logit.nests.
Auction2ndLogitALM: Objects can be created by using the constructor function auction2nd.logit.alm.
Auction2ndCES: Objects can be created by using the constructor function auction2nd.ces.
Auction2ndCESALM: Objects can be created by using the constructor function auction2nd.ces.alm.
Auction2ndCap: Class Antitrust, directly.
Auction2ndLogit: Class Logit, directly.
Class Bertrand, by class Logit, distance 2.
Class Antitrust, by class Bertrand, distance 3.
Auction2ndLogitALM: Class Auction2ndLogit, directly.
Class Logit, distance 2.
Class Bertrand, by class Logit, distance 3.
Class Antitrust, by class Bertrand, distance 4.
Charles Taragin [email protected]
showClass("Auction2ndCap") # get a detailed description of the class showClass("Auction2ndLogit") # get a detailed description of the class showClass("Auction2ndLogitALM") # get a detailed description of the classshowClass("Auction2ndCap") # get a detailed description of the class showClass("Auction2ndLogit") # get a detailed description of the class showClass("Auction2ndLogitALM") # get a detailed description of the class
Calibrates the parameters of bidder cost distributions and then simulates the price effect of a merger between two firms under the assumption that firms are competing in a (Capacity Constrained) 2nd price auction.
Let k denote the number of firms bidding in the auction below.
auction2nd.cap( capacities, margins, prices, reserve = NA, shareInside = NA, sellerCostCDF = c("punif", "pexp", "pweibull", "pgumbel", "pfrechet"), ownerPre, ownerPost, mcDelta = rep(0, length(capacities)), constrain.reserve = TRUE, parmsStart, control.slopes, labels = as.character(ownerPre), ... )auction2nd.cap( capacities, margins, prices, reserve = NA, shareInside = NA, sellerCostCDF = c("punif", "pexp", "pweibull", "pgumbel", "pfrechet"), ownerPre, ownerPost, mcDelta = rep(0, length(capacities)), constrain.reserve = TRUE, parmsStart, control.slopes, labels = as.character(ownerPre), ... )
capacities |
A length k vector of firm capacities OR capacity shares. |
margins |
A length k vector of product margins. All margins must be either be between 0 and 1, or NA. |
prices |
A length k vector product prices. Prices may be NA. |
reserve |
A length 1 vector equal to the buyer's reserve price. Default is NA. |
shareInside |
A length 1 vector equal to the probability that the buyer does not select the outside option. Default is NA. |
sellerCostCDF |
A length 1 character vector indicating which probability distribution will be used to model bidder cost draws. Possible options are "punif", "pexp", "pweibull", "pgumbel", "pfrechet". Default is "punif". |
ownerPre |
A length k factor whose values indicate which firms are present in the market pre-merger. |
ownerPost |
A length k factor whose values indicate which firms are present in the market post-merger. |
mcDelta |
A vector of length k where each element equals the proportional change in a firm's capacity due to the merger. Default is 0, which assumes that the merger does not affect any products' capacity. |
constrain.reserve |
If TRUE, the buyer's post-merger optimal reserve price is assumed to equal the buyer's pre-merger optimal reserve price. If FALSE, the buyer re-calculates her optimal reserve price post-merger. |
parmsStart |
A vector of starting values for calibrated parameters. See below for more details. |
control.slopes |
A list of |
labels |
A k-length vector of labels. Default is "Firm", where ‘#’ is a number between 1 and the length of ‘capacities’. |
... |
Additional options to feed to either |
auction2nd.cap examines how a merger affects equilbrium bidding
behavior when a single buyer is running a 2nd price procurement
auction with bidders whose marginal cost of supplying a homogenous product is
private information. This version of the model assumes that
bidders are differentiated by their capacities in the sense that firms
with greater capacity are more likely to have lower costs than firms
with smaller capacities.
Using firm prices, shares, and margins, as well as information
on the auction reserve price as well as the proportion of buyers who
choose not to purchase from any bidder, auction2nd.cap
calibrates the parameters of the common distribution from which
bidder's costs are drawn (and, if
not supplied, the implied reserve price) and then uses these calibrated
parameters to calibrate the value to the buyer of selecting the
outside option. Once these parameters have been calibrated,
auction2nd.cap computes the buyer's optimal pre-merger reservation
price, and if ‘constrain.reserve’ is FALSE, computes the buyer's
optimal post-merger reservation price (setting ‘constrain.reserve’ to
TRUE sets the buyer's post-merger optimal reserve equal to the buyer's
pre-merger optimal reserve). The pre- and post-merger expected price, conditional on a particular bidder winning, are then calculated.
Currently, the common distribution from which costs may be drawn is
restricted to be either: Uniform ("punif"), Exponential ("pexp"), Weibull
("pweibull"), Gumbel ("pgumbel"), or Frechet ("pfrechet"). Note that
the Exponential is a single parameter distribution, the Uniform and
Weibull are two parameter distributions, and the Gumbel and Frechet
are 3 parameter distributions. Accordingly, sufficient price, margin,
reserve, and outside share information must be supplied in order to
calibrate the parameters of the specified
distribution. auction2nd.cap returns an error if insufficient
information is supplied.
auction2nd.cap returns an instance of class
Auction2ndCap.
Charles Taragin [email protected], with code contributed by Michael Sandfort and Nathan Miller
Keith Waehrer and Perry, Martin (2003). “The Effects of Mergers in Open Auction Markets”, Rand Journal of Economics, 34(2), pp. 287-304.
##Suppose there are 3 firms (A,B,C) participating in a procurement auction with ## an unknown reservation price and that firm A acquires firm B. caps <- c(0.65,0.30,0.05) # total capacity normalized to 1 in this example inShare <- .67 # probability that buyer does not select # any bidder prices <- c(3.89, 3.79, 3.74) # average price charged by each firm margins <- c(.228, .209, 0.197) # average margin earned by each firm ownerPre <- ownerPost <-c("A","B","C") ownerPost[ownerPost=="B"] <- "A" ##assume costs are uniformly distributed with unknown bounds result.unif = auction2nd.cap( capacities=caps, margins=margins,prices=prices,reserve=NA, shareInside=inShare, sellerCostCDF="punif", ownerPre=ownerPre,ownerPost=ownerPost, labels=ownerPre ) print(result.unif) summary(result.unif) ## Get a detailed description of the 'Auction2ndCap' class slots showClass("Auction2ndCap") ## Show all methods attached to the 'Auction2ndCap' Class showMethods(classes="Auction2ndCap")##Suppose there are 3 firms (A,B,C) participating in a procurement auction with ## an unknown reservation price and that firm A acquires firm B. caps <- c(0.65,0.30,0.05) # total capacity normalized to 1 in this example inShare <- .67 # probability that buyer does not select # any bidder prices <- c(3.89, 3.79, 3.74) # average price charged by each firm margins <- c(.228, .209, 0.197) # average margin earned by each firm ownerPre <- ownerPost <-c("A","B","C") ownerPost[ownerPost=="B"] <- "A" ##assume costs are uniformly distributed with unknown bounds result.unif = auction2nd.cap( capacities=caps, margins=margins,prices=prices,reserve=NA, shareInside=inShare, sellerCostCDF="punif", ownerPre=ownerPre,ownerPost=ownerPost, labels=ownerPre ) print(result.unif) summary(result.unif) ## Get a detailed description of the 'Auction2ndCap' class slots showClass("Auction2ndCap") ## Show all methods attached to the 'Auction2ndCap' Class showMethods(classes="Auction2ndCap")
Calibrates consumer demand using (Nested) Logit and then simulates the price effect of a merger between two firms under the assumption that all firms in the market are playing a differentiated products 2nd score auction game.
Let k denote the number of products produced by all firms playing the auction game below.
auction2nd.logit( prices, shares, margins, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, mcDeltaOutside = 0, control.slopes, labels = paste("Prod", 1:length(prices), sep = "") ) auction2nd.logit.nests( prices, shares, margins, nests, diversions, ownerPre, ownerPost, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, mcDeltaOutside = 0, parmsStart, constraint = TRUE, output = TRUE, control.slopes, labels = paste("Prod", 1:length(prices), sep = "") ) auction2nd.logit.alm( prices, shares, margins, ownerPre, ownerPost, mktElast = NA_real_, insideSize = NA_real_, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), mcDeltaOutside = 0, parmsStart, output = TRUE, control.slopes, labels = paste("Prod", 1:length(prices), sep = "") ) auction2nd.ces( prices, shares, margins, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, priceOutside = 1, priceStart = prices, control.slopes, labels = paste("Prod", 1:length(prices), sep = "") ) auction2nd.ces.alm( prices, shares, margins, ownerPre, ownerPost, mktElast = NA_real_, insideSize = NA_real_, output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 1, priceStart = prices, parmsStart, control.slopes, labels = paste("Prod", 1:length(prices), sep = "") )auction2nd.logit( prices, shares, margins, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, mcDeltaOutside = 0, control.slopes, labels = paste("Prod", 1:length(prices), sep = "") ) auction2nd.logit.nests( prices, shares, margins, nests, diversions, ownerPre, ownerPost, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, mcDeltaOutside = 0, parmsStart, constraint = TRUE, output = TRUE, control.slopes, labels = paste("Prod", 1:length(prices), sep = "") ) auction2nd.logit.alm( prices, shares, margins, ownerPre, ownerPost, mktElast = NA_real_, insideSize = NA_real_, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), mcDeltaOutside = 0, parmsStart, output = TRUE, control.slopes, labels = paste("Prod", 1:length(prices), sep = "") ) auction2nd.ces( prices, shares, margins, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, priceOutside = 1, priceStart = prices, control.slopes, labels = paste("Prod", 1:length(prices), sep = "") ) auction2nd.ces.alm( prices, shares, margins, ownerPre, ownerPost, mktElast = NA_real_, insideSize = NA_real_, output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 1, priceStart = prices, parmsStart, control.slopes, labels = paste("Prod", 1:length(prices), sep = "") )
prices |
A length k vector of product prices. |
shares |
A length k vector of product (quantity) shares. Values must be between 0 and 1. |
margins |
A length k vector of product margins (in levels, not percents), some of which may equal NA. |
ownerPre |
EITHER a vector of length k whose values indicate which firm produced a product pre-merger OR a k x k matrix of pre-merger ownership shares. |
ownerPost |
EITHER a vector of length k whose values indicate which firm produced a product after the merger OR a k x k matrix of post-merger ownership shares. |
output |
a length 1 logical vector equal to TRUE if merger simulation performed on output market, FALSE if simulation performed on input market. Default TRUE. |
weights |
A length k vector of non-negative product weights used in
minimum-distance calibration. Default is |
normIndex |
An integer equalling the index (position) of the inside product whose mean valuation will be normalized to 1. Default is 1, unless ‘shares’ sum to less than 1, in which case the default is NA and an outside good is assumed to exist. |
mcDelta |
A vector of length k where each element equals the (level) change in a product's marginal costs due to the merger. Default is 0, which assumes that the merger does not affect any products' marginal cost. |
subset |
A vector of length k where each element equals TRUE if the product indexed by that element should be included in the post-merger simulation and FALSE if it should be excluded.Default is a length k vector of TRUE. |
insideSize |
An integer equal to total pre-merger units sold. If shares sum to one, this also equals the size of the market. |
mcDeltaOutside |
A length 1 vector indicating the change in the marginal cost of the outside good. Default is 0. |
control.slopes |
A list of |
labels |
A k-length vector of labels. Default is "Prod#", where ‘#’ is a number between 1 and the length of ‘prices’. |
nests |
A length k factor of product nests. |
diversions |
A k x k matrix of diversion ratios with diagonal elements equal to -1. Default is missing, in which case diversion according to share is assumed. |
parmsStart |
For |
constraint |
if TRUE, then the nesting parameters for all non-singleton nests are assumed equal. If FALSE, then each non-singleton nest is permitted to have its own value. Default is TRUE. |
mktElast |
a negative value indicating market elasticity. Default is NA. |
priceOutside |
A length 1 vector indicating the price of the outside good. Default is 1. |
priceStart |
A vector of length k of starting values for the non-linear equation solver. |
Using product prices, quantity shares and all of the
product margins from at least one firm, auction2nd.logit is able to
recover the price coefficient and product mean valuations in a
Logit demand model. auction2nd.logit then uses these
calibrated parameters to simulate a merger between two firms, under the assumption that firms are participating in a 2nd score procurement auction.
auction2nd.logit.nests is identical to auction2nd.logit except that it assumes
that products can be grouped into nests. Additional margin information is needed to
identify th nesting parameters.
auction2nd.logit.alm is identical to auction2nd.logit except that it assumes
that an outside product exists and uses additional margin
information to estimate the share of the outside good.
auction2nd.logit returns an instance of Auction2ndLogit,
a child class of Logit. auction2nd.logit.nests returns an instance of Auction2ndLogitNests.
auction2nd.logit.alm returns an instance of Auction2ndLogitALM.
Charles Taragin [email protected]
Miller, Nathan (2014). “Modeling the effects of mergers in procurement” International Journal of Industrial Organization , 37, pp. 201-208.
logit,logit.nests for simulating mergers under a Nash-Bertrand pricing game with Logit demand
## Direct second-score constructor (compatibility/convenience interface). shares <- c(.29, .40, .28, .03) prices <- c(35.53, 154, 84.08, 53.16) * 1e3 costs <- c(NA, 101, NA, NA) * 1e3 before <- diag(4) after <- before after[2, 3] <- after[3, 2] <- 1 result <- auction2nd.logit(prices, shares, margins = prices - costs, ownerPre = before, ownerPost = after, normIndex = 2) summary(result, revenue = FALSE)## Direct second-score constructor (compatibility/convenience interface). shares <- c(.29, .40, .28, .03) prices <- c(35.53, 154, 84.08, 53.16) * 1e3 costs <- c(NA, 101, NA, NA) * 1e3 before <- diag(4) after <- before after[2, 3] <- after[3, 2] <- 1 result <- auction2nd.logit(prices, shares, margins = prices - costs, ownerPre = before, ownerPost = after, normIndex = 2) summary(result, revenue = FALSE)
calcBuyerExpectedCost computes the expected amount that the buyer will pay
to the auction winner.
calcBuyerValuation computes the value to the buyer of the outside option.
calcExpectedLowestCost computes the expected lowest cost of the winning bid.
calcExpectedPrice computes the expected price paid by the buyer.
calcOptimalReserve computes the bidder's optimal reserve price.
calcSellerCostParms calibrates the parameters of the Seller Cost
CDF, as well as the reserve price, if not supplied.
cdfG calculates the probability that a cost draw less than or equal to
‘c’ is realized for each firm. If ‘c’ is not supplied,
the buyer reserve and total capacity is used.
## S4 method for signature 'Auction2ndCap' calcSellerCostParms(object, ...) ## S4 method for signature 'Auction2ndCap' calcBuyerValuation(object) ## S4 method for signature 'Auction2ndCap' calcOptimalReserve(object, preMerger = TRUE, lower, upper) ## S4 method for signature 'Auction2ndCap' calcBuyerExpectedCost(object, preMerger = TRUE) ## S4 method for signature 'Auction2ndCap' cdfG(object, c, preMerger = TRUE) ## S4 method for signature 'Auction2ndCap' calcExpectedPrice(object, preMerger = TRUE) ## S4 method for signature 'Auction2ndCap' calcExpectedLowestCost(object, preMerger = TRUE)## S4 method for signature 'Auction2ndCap' calcSellerCostParms(object, ...) ## S4 method for signature 'Auction2ndCap' calcBuyerValuation(object) ## S4 method for signature 'Auction2ndCap' calcOptimalReserve(object, preMerger = TRUE, lower, upper) ## S4 method for signature 'Auction2ndCap' calcBuyerExpectedCost(object, preMerger = TRUE) ## S4 method for signature 'Auction2ndCap' cdfG(object, c, preMerger = TRUE) ## S4 method for signature 'Auction2ndCap' calcExpectedPrice(object, preMerger = TRUE) ## S4 method for signature 'Auction2ndCap' calcExpectedLowestCost(object, preMerger = TRUE)
object |
An instance of the respective class (see description for the classes) |
... |
Additional arguments to pass to |
preMerger |
If TRUE, the pre-merger ownership structure is used. If FALSE, the post-merger ownership structure is used. Default is TRUE. |
lower |
The minimum for the bidder's reserve price. |
upper |
The maximum for the bidder's reserve price. |
c |
|
Charles Taragin [email protected]
showMethods(classes="Auction2ndCap") # show all methods defined for the classshowMethods(classes="Auction2ndCap") # show all methods defined for the class
Each class contains all the information needed to calibrate a specific type of demand system and perform a merger simulation analysis under the assumption that firms are playing a differentiated products Nash Bargaining game.
The “Bargaining” class is a building block used to create other classes in this package. As such, it is most likely to be useful for developers who wish to code their own calibration/simulation routines.
The “BargainingLogit” class has the information for a Nash Bargaining game with Logit demand.
Let k denote the number of products produced by all firms below.
bargpowerPreA length k vector of pre-merger bargaining power parameters.
bargpowerPreA length k vector of post-merger bargaining power parameters.
pricesA length k vector of of observes prices.
marginsA length k vector of of observes margins.
Objects can be created by calls of the form new("Bargaining", ...).
Calibrates consumer demand using Constant Elasticity of Substitution (CES) and then simulates the price effect of a merger between two firms under the assumption that firms and customers in the market are playing a differentiated products Nash Bargaining game.
Let k denote the number of products produced by all firms playing the Nash Bargaining game below.
bargaining.ces( prices, shares, margins, ownerPre, ownerPost, bargpowerPre = rep(0.5, length(prices)), bargpowerPost = bargpowerPre, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceStart = prices, insideSize = NA_real_, priceOutside = 1, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), solver = c("nleqslv", "ag") ) bargaining2nd.ces( prices, shares, margins, ownerPre, ownerPost, bargpowerPre = rep(0.5, length(prices)), bargpowerPost = bargpowerPre, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, mcDeltaOutside = 0, control.slopes, labels = paste("Prod", 1:length(prices), sep = "") ) bargaining.ces.alm( prices, shares, margins, ownerPre, ownerPost, bargpowerPre = rep(0.5, length(prices)), bargpowerPost = bargpowerPre, output = TRUE, weights = rep(1, length(shares)), parmsStart = c(0.1, 0.5), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceStart = prices, insideSize = NA_real_, priceOutside = 1, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), mktElast = NA_real_ )bargaining.ces( prices, shares, margins, ownerPre, ownerPost, bargpowerPre = rep(0.5, length(prices)), bargpowerPost = bargpowerPre, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceStart = prices, insideSize = NA_real_, priceOutside = 1, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), solver = c("nleqslv", "ag") ) bargaining2nd.ces( prices, shares, margins, ownerPre, ownerPost, bargpowerPre = rep(0.5, length(prices)), bargpowerPost = bargpowerPre, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, mcDeltaOutside = 0, control.slopes, labels = paste("Prod", 1:length(prices), sep = "") ) bargaining.ces.alm( prices, shares, margins, ownerPre, ownerPost, bargpowerPre = rep(0.5, length(prices)), bargpowerPost = bargpowerPre, output = TRUE, weights = rep(1, length(shares)), parmsStart = c(0.1, 0.5), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceStart = prices, insideSize = NA_real_, priceOutside = 1, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), mktElast = NA_real_ )
prices |
A length k vector of product prices. |
shares |
A length k vector of product revenue shares. Values must be between 0 and 1. |
margins |
A length k vector of product margins (in levels, not percents), some of which may equal NA. |
ownerPre |
EITHER a vector of length k whose values indicate which firm produced a product pre-merger OR a k x k matrix of pre-merger ownership shares. |
ownerPost |
EITHER a vector of length k whose values indicate which firm produced a product after the merger OR a k x k matrix of post-merger ownership shares. |
bargpowerPre |
A length k vector of pre-merger bargaining power parameters. Values must be between 0 (sellers have the power) and 1 (buyers the power). NA values are allowed, though must be calibrated from additional margin and share data. Default is 0.5. |
bargpowerPost |
A length k vector of post-merger bargaining power parameters. Values must be between 0 (sellers have the power) and 1 (buyers the power). NA values are allowed, though must be calibrated from additional margin and share data. Default is ‘bargpowerPre’. |
output |
a length 1 logical vector equal to TRUE if merger simulation performed on output market, FALSE if simulation performed on input market. Default TRUE. |
weights |
A length k vector of product weights. Default is rep(1, length(shares)). |
normIndex |
An integer equalling the index (position) of the inside product whose price will be normalized to 1. Default is 1, unless ‘shares’ sum to less than 1, in which case the default is NA and an outside good is assumed to exist. |
mcDelta |
A vector of length k where each element equals the (level) change in a product's marginal costs due to the merger. Default is 0, which assumes that the merger does not affect any products' marginal cost. |
subset |
A vector of length k where each element equals TRUE if the product indexed by that element should be included in the post-merger simulation and FALSE if it should be excluded. Default is a length k vector of TRUE. |
priceStart |
A length k vector of starting values for price calculation. |
insideSize |
An integer equal to total pre-merger revenue spent inside market. If shares sum to one, this also equals the size of the market. |
priceOutside |
A positive real number equal to the price of the outside good. Default is 1. |
control.slopes |
A list of control parameters for non-linear optimization routine. |
control.equ |
A list of control parameters for non-linear equation solver routine. |
labels |
A length-k vector of product labels. |
solver |
A length-1 character vector specifying the solver algorithm used to calculate pre- and post-merger price equilibria. Options are |
mcDeltaOutside |
A length 1 vector indicating the change in the marginal cost of the outside good. Default is 0. |
parmsStart |
A length 2 vector of starting values for ALM demand parameter estimation. |
mktElast |
Optional aggregate market elasticity used by the ALM calibration; the default 'NA' keeps legacy calibration behavior. |
bargaining.ces uses observed product prices, revenue shares, margins, and pre-/post-merger
ownership matrices to calibrate a Constant Elasticity of Substitution (CES) demand system and
predict post-merger equilibrium outcomes under Nash Bargaining.
bargaining2nd.ces calculates post-merger price effects under a 2nd-score auction Nash bargaining model.
bargaining.ces.alm estimates the unobserved outside share alongside CES parameters.
bargaining.ces returns an instance of BargainingCES,
bargaining2nd.ces returns an instance of Bargaining2ndCES,
bargaining.ces.alm returns an instance of BargainingCESALM.
Charles Taragin
ces for Bertrand pricing under CES demand, and bargaining.logit for Nash Bargaining under Logit demand.
Calibrates consumer demand using Logit and then simulates the price effect of a merger between two firms under the assumption that firms and customers in the market are playing a differentiated products Nash Bargaining game.
Let k denote the number of products produced by all firms playing the Nash Bargaining game below.
bargaining.logit( prices, shares, margins, ownerPre, ownerPost, bargpowerPre = rep(0.5, length(prices)), bargpowerPost = bargpowerPre, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceStart = prices, insideSize = NA_real_, priceOutside = 0, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), solver = c("nleqslv", "ag") ) bargaining2nd.logit( prices, shares, margins, ownerPre, ownerPost, bargpowerPre = rep(0.5, length(prices)), bargpowerPost = bargpowerPre, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, mcDeltaOutside = 0, control.slopes, labels = paste("Prod", 1:length(prices), sep = "") ) bargaining.logit.alm( prices, shares, margins, ownerPre, ownerPost, bargpowerPre = rep(0.5, length(prices)), bargpowerPost = bargpowerPre, output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceStart = prices, insideSize = NA_real_, priceOutside = 0, parmsStart = c(NA_real_, NA_real_), control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), mktElast = NA_real_ )bargaining.logit( prices, shares, margins, ownerPre, ownerPost, bargpowerPre = rep(0.5, length(prices)), bargpowerPost = bargpowerPre, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceStart = prices, insideSize = NA_real_, priceOutside = 0, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), solver = c("nleqslv", "ag") ) bargaining2nd.logit( prices, shares, margins, ownerPre, ownerPost, bargpowerPre = rep(0.5, length(prices)), bargpowerPost = bargpowerPre, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, mcDeltaOutside = 0, control.slopes, labels = paste("Prod", 1:length(prices), sep = "") ) bargaining.logit.alm( prices, shares, margins, ownerPre, ownerPost, bargpowerPre = rep(0.5, length(prices)), bargpowerPost = bargpowerPre, output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceStart = prices, insideSize = NA_real_, priceOutside = 0, parmsStart = c(NA_real_, NA_real_), control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), mktElast = NA_real_ )
prices |
A length k vector of product prices. |
shares |
A length k vector of product (quantity) shares. Values must be between 0 and 1. |
margins |
A length k vector of product margins (in levels, not percents), some of which may equal NA. |
ownerPre |
EITHER a vector of length k whose values indicate which firm produced a product pre-merger OR a k x k matrix of pre-merger ownership shares. |
ownerPost |
EITHER a vector of length k whose values indicate which firm produced a product after the merger OR a k x k matrix of post-merger ownership shares. |
bargpowerPre |
A length k vector of pre-merger bargaining power parameters. Values must be between 0 (sellers have the power) and 1 (buyers the power). NA values are allowed, though must be calibrated from additional margin and share data. Default is 0.5. |
bargpowerPost |
A length k vector of post-merger bargaining power parameters. Values must be between 0 (sellers have the power) and 1 (buyers the power). NA values are allowed, though must be calibrated from additional margin and share data. Default is ‘bargpowerPre’. |
output |
a length 1 logical vector equal to TRUE if merger simulation performed on output market, FALSE if simulation performed on input market. Default TRUE. |
weights |
A length k vector of non-negative product weights used in
minimum-distance calibration. Default is |
normIndex |
An integer equalling the index (position) of the inside product whose mean valuation will be normalized to 1. Default is 1, unless ‘shares’ sum to less than 1, in which case the default is NA and an outside good is assumed to exist. |
mcDelta |
A vector of length k where each element equals the (level) change in a product's marginal costs due to the merger. Default is 0, which assumes that the merger does not affect any products' marginal cost. |
subset |
A vector of length k where each element equals TRUE if the product indexed by that element should be included in the post-merger simulation and FALSE if it should be excluded.Default is a length k vector of TRUE. |
priceStart |
A vector of length k who elements equal to an initial guess of equilibrium prices. default is ‘prices’. |
insideSize |
An integer equal to total pre-merger units sold. If shares sum to one, this also equals the size of the market. |
priceOutside |
A positive real number equal to the price of the outside good. Default equals 0 for Logit demand. |
control.slopes |
A list of |
control.equ |
A list of |
labels |
A k-length vector of labels. Default is "Prod#", where ‘#’ is a number between 1 and the length of ‘prices’. |
solver |
A length-1 character vector specifying the solver algorithm used to calculate pre- and post-merger price equilibria. Options are |
mcDeltaOutside |
A length 1 vector indicating the change in the marginal cost of the outside good. Default is 0. |
parmsStart |
A vector of length 2 of starting values for the non-linear equation solver. |
mktElast |
Optional aggregate market elasticity used by the ALM calibration; the default 'NA' keeps legacy calibration behavior. |
Using product prices, quantity shares and all of the
product margins from at least one firm, auction2nd.logit is able to
recover the price coefficient and product mean valuations in a
Logit demand model. auction2nd.logit then uses these
calibrated parameters to simulate a merger between two firms, under the assumption that firms are participating in a A Nash Bargaining Game
(bargaining.logit) or splitting the full surplus (bargaining2nd.logit).
bargaining.logit returns an instance of BargainingLogit,
a child class of Logit.
bargaining2nd.logit returns an instance of Bargaining2ndLogit,
a child class of Auction2ndLogit.
Charles Taragin [email protected]
Miller, Nathan (2014). “Modeling the effects of mergers in procurement” International Journal of Industrial Organization , 37, pp. 201-208.
logit for simulating mergers under a Nash-Bertrand pricing game with Logit demand, and ,auction2nd.logit
for simulating mergers under a 2nd score auction with Logit demand.
## Direct bargaining constructor (compatibility/convenience interface). shares <- c(.29, .40, .28, .03) prices <- c(35.53, 154, 84.08, 53.16) margins <- (prices - c(NA, 101, NA, NA)) / prices before <- diag(4) after <- before after[2, 3] <- after[3, 2] <- 1 result <- bargaining.logit(prices, shares, margins, bargpowerPre = rep(.6, 4), ownerPre = before, ownerPost = after, normIndex = 2) summary(result, revenue = FALSE)## Direct bargaining constructor (compatibility/convenience interface). shares <- c(.29, .40, .28, .03) prices <- c(35.53, 154, 84.08, 53.16) margins <- (prices - c(NA, 101, NA, NA)) / prices before <- diag(4) after <- before after[2, 3] <- after[3, 2] <- 1 result <- bargaining.logit(prices, shares, margins, bargpowerPre = rep(.6, 4), ownerPre = before, ownerPost = after, normIndex = 2) summary(result, revenue = FALSE)
Calibrates consumer demand using either a Logit, CES, or AIDS demand system and then simulates the prices effect of a merger between two firms under the assumption that all firms in the market are playing a Nash-Bertrand price setting game.
Let k denote the number of products produced by all firms below.
bertrand.alm( demand = c("logit", "ces", "aids"), prices, quantities, margins, ownerPre, ownerPost, mktElast = NA_real_, insideSize = ifelse(demand == "logit", sum(quantities, na.rm = TRUE), sum(prices * quantities, na.rm = TRUE)), diversions, mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = ifelse(demand == "logit", 0, 1), priceStart = prices, isMax = FALSE, output = TRUE, parmStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... )bertrand.alm( demand = c("logit", "ces", "aids"), prices, quantities, margins, ownerPre, ownerPost, mktElast = NA_real_, insideSize = ifelse(demand == "logit", sum(quantities, na.rm = TRUE), sum(prices * quantities, na.rm = TRUE)), diversions, mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = ifelse(demand == "logit", 0, 1), priceStart = prices, isMax = FALSE, output = TRUE, parmStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... )
demand |
A character vector indicating which demand system to use. Currently allows logit (default), ces, or aids. |
prices |
A length k vector product prices. Default is missing, in which case demand intercepts are not calibrated. |
quantities |
A length k vector of product quantities. |
margins |
A length k vector of product margins. All margins must be either be between 0 and 1, or NA. |
ownerPre |
EITHER a vector of length k whose values indicate which firm produced a product before the merger OR a k x k matrix of pre-merger ownership shares. |
ownerPost |
EITHER a vector of length k whose values indicate which firm produced a product after the merger OR a k x k matrix of post-merger ownership shares. |
mktElast |
A negative number equal to the industry pre-merger price elasticity. Default is NA. |
insideSize |
Size of all units included in the market. For logit, this defaults to total quantity, while for aids and ces this defaults to total revenues. |
diversions |
A k x k matrix of diversion ratios with diagonal elements equal to -1. Default is missing, in which case diversion according to revenue share is assumed. |
mcDelta |
A vector of length k where each element equals the proportional change in a product's marginal costs due to the merger. Default is 0, which assumes that the merger does not affect any products' marginal cost. |
subset |
A vector of length k where each element equals TRUE if the product indexed by that element should be included in the post-merger simulation and FALSE if it should be excluded. Default is a length k vector of TRUE. |
priceOutside |
A postive real number equal to the price of the outside good. Default either equals 1 for Logit demand or 0 for CES demand. |
priceStart |
A vector of length k who elements equal to an initial guess of the proportional change in price caused by the merger. For aids, the default is to draw k random elements from a [0,1] uniform distribution. For ces and logit, the default is prices. |
isMax |
If TRUE, checks to see whether computed price equilibrium locally maximizes firm profits and returns a warning if not. Default is FALSE. |
output |
a length 1 logical vector equal to TRUE if merger simulation performed on output market, FALSE if it is an input market. Default TRUE. |
parmStart |
|
control.slopes |
A list of |
control.equ |
A list of |
labels |
A k-length vector of labels. |
... |
Additional options to feed to the |
The main purpose of this function is to provide a more convenient front-end
for the aids, logit.alm and ces functions.
Using price, and quantity, information for all products
in each market, as well as margin information for at least
one products in each market, bertrand.alm is able to
recover the slopes and intercepts of either a Logit, CES, or AIDS demand
system. These parameters are then used to simulate the price
effects of a merger between
two firms under the assumption that the firms are playing a
simultaneous price setting game.
‘ownerPre’ and ‘ownerPost’ values will typically be equal to either 0 (element [i,j] is not commonly owned) or 1 (element [i,j] is commonly owned), though these matrices may take on any value between 0 and 1 to account for partial ownership.
bertrand.alm returns an instance of class LogitALM,
CESALM, or AIDS,
depending upon the value of the “demand” argument.
Charles Taragin [email protected]
The “Bertrand” class is a building block used to create other classes in this package. As such, it is most likely to be useful for developers who wish to code their own merger calibration/simulation routines.
Each class below contains all the information needed to calibrate a specific type of demand system and perform a merger simulation analysis under the assumption that firms are playing a differentiated products Bertrand pricing game.
The “Linear” class has the information for a Linear demand system.
The “LogLin” class has the information for a Log-Linear demand system.
The “AIDS” class has the information for a AIDS demand system.
The “PCAIDS” class has the information for a PCAIDS demand system
The “PCAIDSNests” class has the information for a nested PCAIDS demand system
Below, let k denote the number of products produced by all firms.
sharesA length k vector containing observed output. Depending upon the model, output will be measured in units sold, quantity shares, or revenue shares.
mcDeltaA length k vector where each element equals the proportional change in a product's marginal costs due to the merger.
slopesA k x (k+1) matrix of linear demand intercepts and slope coefficients
subsetA vector of length k where each element equals TRUE if the product indexed by that element should be included in the post-merger simulation and FALSE if it should be excluded.
interceptsA length k vector of demand intercepts. (Linear only)
pricesA length k vector product prices. (Linear only)
quantitiesA length k vector of product quantities. (Linear only)
marginsA length k vector of product margins. All margins must be between 0 and 1. (Linear only)
diversionA k x k matrix of diversion ratios with diagonal elements equal to -1.
priceStartA length k vector of prices used as the initial guess in the nonlinear equation solver. (Linear and AIDS only)
symmetryIf TRUE, requires the matrix of demand slope coefficients to be consistent with utility maximization theory. Default is false. (Linear and LogLin only)
insideSizeA positive number equal to total pre-merger revenues for all products included in the simulation. (AIDS only)
mktElastA negative number equal to the industry pre-merger price elasticity. (AIDS only)
parmStartA length 2 vector who elements equal to an initial of a single diagonal element of the matrix of slope coefficients, as well as the market elasticity. (AIDS only)
priceDeltaA length k vector containing the simulated price effects from the merger. (AIDS only)
knownElastA negative number equal to the pre-merger own-price elasticity for any of the k products. (PCAIDS only)
knownElastIndexAn integer equal to the position of the ‘knownElast’ product in the ‘shares’ vector. (PCAIDS only)
nestsA length k vector identifying which nest a product belongs to. (Nested PCAIDS only)
nestsParmsA length k vector containing nesting parameters. (Nested PCAIDS only)
For Bertrand, objects can be created by calls of the form new("Bertrand", ...).
For Linear, objects can be created by using the constructor function linear.
For LogLin, objects can be created by using the constructor function loglinear.
For AIDS, objects can be created by using the constructor function aids.
For PCAIDS, objects can be created by using the constructor pcaids.
For nested PCAIDS, objects can be created by using the constructor pcaids.nests.
Bertrand: Class Antitrust, directly.
Linear: Class Bertrand, directly.
Class Antitrust, by class Bertrand, distance 2.
LogLin: Class Linear, directly.
Class Bertrand, by class Linear, distance 2.
Class Antitrust, by class Bertrand, distance 3.
AIDS: Class Linear, directly. Class Bertrand, by class “Linear”, distance 2.
PCAIDS: Class AIDS, directly. Class Linear, by class AIDS, distance 2.
Class Bertrand, by class Linear, distance 3. Class Antitrust, by class Bertrand, distance 4.
Nested PCAIDS: Class PCAIDS, directly. Class AIDS, by class PCAIDS, distance 2.
Class Linear, by class AIDS, distance 3. Class Bertrand, by class Linear, distance 4.
Class Antitrust, by class Bertrand, distance 5.
Charles Taragin [email protected]
showClass("Bertrand") # get a detailed description of the class showClass("Linear") # get a detailed description of the class showClass("LogLin") # get a detailed description of the class showClass("AIDS") # get a detailed description of the class showClass("PCAIDS") # get a detailed description of the class showClass("PCAIDSNests") # get a detailed description of the classshowClass("Bertrand") # get a detailed description of the class showClass("Linear") # get a detailed description of the class showClass("LogLin") # get a detailed description of the class showClass("AIDS") # get a detailed description of the class showClass("PCAIDS") # get a detailed description of the class showClass("PCAIDSNests") # get a detailed description of the class
Each class contains all the information needed to calibrate a specific type of demand system and perform a merger simulation analysis under the assumption that firms are playing a differentiated products Bertrand pricing game. Also included is “LogitCournot”, for modelling firms playing a differentiated products Cournot quantity game.
The “Logit” class has the information for a Logit demand system.
The “LogitCap” class has the information for a Logit demand system and assumes that firms are playing a differentiated products Bertrand pricing game with capacity constraints. “LogitCapALM” extends “LogitCap” to allow for an unobserved outside share.
The “LogitNests” class has the information for a nested Logit
The “LogitNestsALM” class has the information for a nested Logit demand system under the assumption that the share of the outside product is not known. Once the model parameters have been calibrated, methods exist that perform a merger simulation analysis under the assumption that firms are playing a differentiated products Bertrand pricing game.
The “LogitALM” class has the information for a Logit demand system assuming that firms are playing a differentiated products Bertrand pricing game with unknown market elasticity.
The “CES” class has the information for a CES demand system
The “CESALM” class has the information for a CES demand system and assumes that firms are playing a differentiated products Bertrand pricing game with unknown market elasticity.
The “CESCournot” class has the information for a CES demand system under the assumption that firms are playing a differentiated products Cournot quantity game.
The “CESCournotALM” class has the information for a CES demand system under the assumption that firms are playing a differentiated products Cournot quantity game with unknown market elasticity.
The “CESNests” class has the information for a nested CES demand system.
Let k denote the number of products produced by all firms below.
pricesA length k vector of product prices.
marginsA length k vector of product margins, some of which may equal NA.
normIndexAn integer specifying the product index against which the mean values of all other products are normalized.
shareInsideThe share of customers that purchase any of the products included in the ‘prices’ vector.
weightsA length k vector of non-negative product weights used in minimum-distance calibration.
priceOutsideThe price of the outside good. Default is 0.
slopesA list containing the coefficient on price (‘alpha’) and the vector of mean valuations (‘meanval’).
mktElastA length 1 vector of market elasticities.
priceStartA length-k vector of starting prices for the non-linear solver.
insideSizeA positive number equal to total pre-merger quantities (revenues for CES) for all products included in the simulation.
mktSizeA positive number equal to total quantities (revenues for CES) pre-merger for all products in the simulations as well as the outside good.
capacitiesPreA length k vector whose elements equal pre-merger product capacities. (LogitCap and LogitCapALM only)
capacitiesPostA length k vector whose elements equal post-merger product capacities. (LogitCap and LogitCapALM only)
nestsA length k vector identifying the nest that each product belongs to. (LogitNests and CESNests Only)
parmsStartA length k vector who elements equal an initial guess of the nesting parameter values. (LogitNests and CESNests Only)
constraintA length 1 logical vector that equals TRUE if all nesting parameters are constrained to equal the same value and FALSE otherwise. Default is TRUE. (LogitNests and CESNests Only)
parmsStartA length 2 vector whose first element equals an initial guess of the price coefficient and whose second element equals an initial guess of the outside share. The price coefficient's initial value must be negative and the outside share's initial value must be between 0 and 1. (LogitALM and CESALM only)
slopesA list containing the coefficient on the numeraire (‘alpha’), the coefficient on price (‘gamma’), and the vector of mean valuations (‘meanval’) (CES only)
priceOutsideThe price of the outside good. Default is 1. (CES only)
For Logit, objects can be created by using the constructor function logit.
For LogitALM, objects can be created by using the constructor function logit.alm.
For LogitCap and LogitCapALM, objects can be created by using the constructor function logit.cap and logit.cap.alm.
For LogitNests, objects can be created by using the constructor function logit.nests.
For LogitNestsALM, objects can be created by using the constructor function logit.nests.alm.
For CES, objects can be created by using the constructor function ces.
For CESALM, objects can be created by using the constructor function ces.alm.
For CESNests, objects can be created by using the constructor function ces.nests.
For CESCournot, objects can be created by using the constructor function ces.cournot.
For CESCournotALM, objects can be created by using the constructor function ces.cournot.alm.
Logit: Class Bertrand, directly.
Class Antitrust, by class Bertrand, distance 2.
LogitCap: Class Logit, directly.
Class Bertrand, by class Logit, distance 2.
Class Antitrust, by class Bertrand, distance 3.
#'LogitCapALM: Class LogitCap, directly.
Class Logit, by class LogitCap, distance 2.
Class Bertrand, by class Logit, distance 3.
Class Antitrust, by class Bertrand, distance 4.
LogitNests: Class Logit, directly.
Class Bertrand, by class Logit, distance 2.
LogitNestsALM: Class LogitNests, directly.
Class Logit, by class LogitNests, distance 2.
Class Bertrand, by class Logit, distance 3.
Class Antitrust, by class Bertrand, distance 4.
LogitALM: Class Logit, directly.
Class Bertrand, by class Logit, distance 2.
Class Antitrust, by class Bertrand, distance 3.
CES: Class Logit, directly.
Class Bertrand, by class Logit, distance 2.
Class Antitrust, by class Bertrand, distance 3.
CESALM: Class CES, directly.
Class Logit, by class CES, distance 2.
Class Bertrand, by class Logit, distance 3.
Class Antitrust, by class Bertrand, distance 4.
CESNests: Class CES, directly.
Class Logit, by class CES, distance 2.
Class Bertrand, by class Logit, distance 3.
Class Antitrust, by class Bertrand, distance 4.
Charles Taragin [email protected]
showClass("Logit") # get a detailed description of the class showClass("LogitCap") # get a detailed description of the class showClass("LogitNests") # get a detailed description of the class showClass("LogitNestsALM") # get a detailed description of the class showClass("LogitALM") # get a detailed description of the class showClass("CES") # get a detailed description of the class showClass("CESALM") # get a detailed description of the class showClass("CESNests") # get a detailed description of the classshowClass("Logit") # get a detailed description of the class showClass("LogitCap") # get a detailed description of the class showClass("LogitNests") # get a detailed description of the class showClass("LogitNestsALM") # get a detailed description of the class showClass("LogitALM") # get a detailed description of the class showClass("CES") # get a detailed description of the class showClass("CESALM") # get a detailed description of the class showClass("CESNests") # get a detailed description of the class
Public entry point that selects the integration points and
normalized weights for a BLP (random-coefficients Logit) demand
specification, given a list of demand parameters. It chooses between
Gauss-Hermite quadrature, fixed-draw Monte Carlo, or caller-supplied
points according to the integration rule and the dimensionality of
the heterogeneity. This is a thin, stable wrapper over the internal
integration selection logic; downstream packages building models on the
BLP demand system (e.g. price leadership with BLP demand) can call it
instead of re-implementing integration-rule selection.
calcBLPintegration(slopes)calcBLPintegration(slopes)
slopes |
A list of BLP demand parameters. Recognized elements include
|
A list containing draws, weights (normalized to sum
to one), and rule. Two-dimensional rules additionally return an
integrationPoints matrix, canonical factorOrder, and
nodesPerAxis for Gauss-Hermite quadrature.
calcMeanval runs the BLP contraction mapping to recover
mean utilities (delta/meanval) that rationalize observed shares given
random-coefficient parameters. It is defined for the LogitBLP class
and inherited by its subclasses.
calcMeanval(object, ...) ## S4 method for signature 'LogitBLP' calcMeanval(object)calcMeanval(object, ...) ## S4 method for signature 'LogitBLP' calcMeanval(object)
object |
A |
... |
Additional arguments (currently unused). |
Implements the BLP contraction mapping
delta^(t+1) = delta^(t) + log(s_observed) - log(s_predicted(delta^(t))),
using BB::dfsane for robust convergence with a fallback to a dampened
fixed point. Handles nesting (sigmaNest) and demographic interactions
(piDemog).
The object with updated slopes$meanval (the delta vector) and
related BLP integration bookkeeping.
It delegates calibration to the corresponding model-specific legacy constructor, so existing equations, normalizations, solvers, and warnings remain the behavioral source of truth.
calibrate( demand, conduct = NULL, prices, shares = NULL, margins = NULL, ownerPre, quantities = NULL, variant = "standard", knownElast = NULL, mktElast = NULL, s0 = NULL, revenueRetentionPre = NULL, ... )calibrate( demand, conduct = NULL, prices, shares = NULL, margins = NULL, ownerPre, quantities = NULL, variant = "standard", knownElast = NULL, mktElast = NULL, s0 = NULL, revenueRetentionPre = NULL, ... )
demand |
A demand-system name or an object returned by
|
conduct |
A conduct name. Omit it when 'demand' is a model specification object. |
prices |
A length-k vector of observed product prices. |
shares |
A length-k vector of observed product shares. Required by demand systems whose calibration uses shares. |
margins |
An optional length-k vector of observed product margins; required by model families whose calibration uses margins. |
ownerPre |
Pre-merger ownership vector or matrix. |
quantities |
A length-k vector of observed product quantities for Linear or LogLin calibration, or an n-by-k plant-quantity matrix for general Cournot/Stackelberg calibration. |
variant |
A model-specific calibration variant, such as '"alm"' or '"auction2nd"' for second-score auction models. |
knownElast |
A known own-price elasticity for PCAIDS calibration. |
mktElast |
A known market own-price elasticity for PCAIDS calibration. |
s0 |
A known outside-good share for price-only BLP calibration. It
must lie in |
revenueRetentionPre |
Optional positive seller revenue-retention vector at the observed baseline; values above one represent subsidies. |
... |
Additional options accepted by the model-specific legacy
calibration constructor. For BLP calibration,
|
An AntitrustFit object.
fit <- calibrate("logit", "bertrand", prices = c(2, 2.2, 2.5), shares = c(.35, .25, .20), margins = c(.40, .35, .30), ownerPre = c("A", "B", "C"), insideSize = 100) summary(fit)[c("spec", "model_class")]fit <- calibrate("logit", "bertrand", prices = c(2, 2.2, 2.5), shares = c(.35, .25, .20), margins = c(.40, .35, .30), ownerPre = c("A", "B", "C"), insideSize = 100) summary(fit)[c("spec", "model_class")]
Compatibility and convenience constructors that calibrate consumer demand using (Nested) Constant Elasticity of Substitution (CES) and then simulates the price effect of a merger between two firms under the assumption that all firms in the market are playing a differentiated products Bertrand pricing game.
Let k denote the number of products produced by all firms playing the Bertrand pricing game below.
ces( prices, shares, margins, diversions, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(sum(shares) < 1, NA, 1), mktElast = NA_real_, insideSize = NA_real_, mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 1, priceStart = prices, isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), solver = c("nleqslv", "ag"), ... ) ces.alm( prices, shares, margins, ownerPre, ownerPost, mktElast = NA_real_, insideSize = NA_real_, output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 1, priceStart = prices, isMax = FALSE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) ces.nests( prices, shares, margins, ownerPre, ownerPost, nests = rep(1, length(shares)), normIndex = ifelse(sum(shares) < 1, NA, 1), insideSize = NA_real_, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 1, priceStart = prices, isMax = FALSE, constraint = TRUE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) ces.cournot( prices, shares, margins, diversions, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(sum(shares) < 1, NA, 1), mktElast = NA_real_, insideSize = NA_real_, mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 1, priceStart = prices, isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) ces.cournot.alm( prices, shares, margins, ownerPre, ownerPost, mktElast = NA_real_, insideSize = NA_real_, output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 1, priceStart = prices, isMax = FALSE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... )ces( prices, shares, margins, diversions, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(sum(shares) < 1, NA, 1), mktElast = NA_real_, insideSize = NA_real_, mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 1, priceStart = prices, isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), solver = c("nleqslv", "ag"), ... ) ces.alm( prices, shares, margins, ownerPre, ownerPost, mktElast = NA_real_, insideSize = NA_real_, output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 1, priceStart = prices, isMax = FALSE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) ces.nests( prices, shares, margins, ownerPre, ownerPost, nests = rep(1, length(shares)), normIndex = ifelse(sum(shares) < 1, NA, 1), insideSize = NA_real_, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 1, priceStart = prices, isMax = FALSE, constraint = TRUE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) ces.cournot( prices, shares, margins, diversions, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(sum(shares) < 1, NA, 1), mktElast = NA_real_, insideSize = NA_real_, mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 1, priceStart = prices, isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) ces.cournot.alm( prices, shares, margins, ownerPre, ownerPost, mktElast = NA_real_, insideSize = NA_real_, output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 1, priceStart = prices, isMax = FALSE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... )
prices |
A length k vector of product prices. |
shares |
A length k vector of product revenue shares. |
margins |
A length k vector of product margins, some of which may equal NA. |
diversions |
A k x k matrix of diversion ratios with diagonal elements equal to -1. Default is missing. |
ownerPre |
EITHER a vector of length k whose values indicate which firm produced a product pre-merger OR a k x k matrix of pre-merger ownership shares. |
ownerPost |
EITHER a vector of length k whose values indicate which firm produced a product after the merger OR a k x k matrix of post-merger ownership shares. |
output |
a length 1 logical vector equal to TRUE if merger simulation performed on output market, FALSE if simulation performed on input market. Default TRUE. |
weights |
A length k vector of non-negative product weights used in
minimum-distance calibration. Default is |
normIndex |
An integer specifying the product index against which the mean values of all other products are normalized. Default is 1. |
mktElast |
a negative value indicating market elasticity. Default is NA. |
insideSize |
total revenues included in the market. |
mcDelta |
A vector of length k where each element equals the proportional change in a product's marginal costs due to the merger. Default is 0, which assumes that the merger does not affect any products' marginal cost. |
subset |
A vector of length k where each element equals TRUE if the product indexed by that element should be included in the post-merger simulation and FALSE if it should be excluded.Default is a length k vector of TRUE. |
priceOutside |
A length 1 vector indicating the price of the outside good. Default is 1. |
priceStart |
A length k vector of starting values used to solve for equilibrium price. Default is the ‘prices’ vector. |
isMax |
If TRUE, checks to see whether computed price equilibrium locally maximizes firm profits and returns a warning if not. Default is FALSE. |
control.slopes |
A list of |
control.equ |
A list of |
labels |
A k-length vector of labels. Default is "Prod#", where ‘#’ is a number between 1 and the length of ‘prices’. |
solver |
A length-1 character vector specifying the solver algorithm used to calculate pre- and post-merger price equilibria. Options are |
... |
Additional options to feed to the |
parmsStart |
A vector of starting values used to solve for price coefficient and nest parameters. The first element should always be the price coefficient and the remaining elements should be nesting parameters. Theory requires the nesting parameters to be greater than the price coefficient. If missing then the random draws with the appropriate restrictions are employed. |
nests |
A length k vector identifying the nest that each product belongs to. |
constraint |
if TRUE, then the nesting parameters for all non-singleton nests are assumed equal. If FALSE, then each non-singleton nest is permitted to have its own value. Default is TRUE. |
Using product prices, revenue shares and all of the
product margins from at least one firm, ces is able to
recover the substitution curvature and product mean valuations in a
Constant Elasticity of Substitution demand model. ces then uses these
calibrated parameters to simulate the price effects of a merger between two firms under the
assumption that that all firms in the market are playing a
differentiated products Bertrand pricing game.
ces.alm is identical to ces except that it assumes that an outside product exists and uses additional margin information to estimate the share of the outside good.
ces.nests is identical to ces except that it includes the ‘nests’
argument which may be used to assign products to different
nests. Nests are useful because they allow for richer substitution
patterns between products. Products within the same nest are assumed
to be closer substitutes than products in different nests. The degree
of substitutability between products located in different nests is
controlled by the value of the nesting parameter sigma.
The nesting parameters for singleton nests (nests containing
only one product) are not identified and normalized to 1. The vector of
sigmas is calibrated from the prices, revenue shares, and margins supplied
by the user.
By default, all non-singleton nests are assumed to have a common value for sigma. This constraint may be relaxed by setting ‘constraint’ to FALSE. In this case, at least one product margin must be supplied from a product within each nest.
In both ces and ces.nests, if revenue shares sum to 1,
then one product's mean value is not identified and must be normalized
to 1. ‘normIndex’ may be used to specify the index (position) of the
product whose mean value is to be normalized. If the sum of revenue shares
is less than 1, both of these functions assume that the exists a k+1st
product in the market whose price and mean value are both normalized
to 1.
ces returns an instance of class CES.
ces.alm returns an instance of class CESALM.
ces.nests returns an instance of CESNests, a
child class of CES.
Charles Taragin [email protected]
Anderson, Simon, Palma, Andre, and Francois Thisse (1992). Discrete Choice Theory of Product Differentiation. The MIT Press, Cambridge, Mass.
Epstein, Roy and Rubinfeld, Daniel (2004). “Effects of Mergers Involving Differentiated Products.”
Sheu G (2011). “Price, Quality, and Variety: Measuring the Gains From Trade in Differentiated Products.” U.S Department of Justice.
## Direct constructor retained for compatibility; use calibrate() when ## repeated counterfactuals should share one fitted market. result <- ces(c(2, 2.2, 2.5), c(.35, .25, .20), c(.40, .35, .30), ownerPre = c("A", "B", "C"), ownerPost = c("A", "A", "C"), insideSize = 100) result@pricePost## Direct constructor retained for compatibility; use calibrate() when ## repeated counterfactuals should share one fitted market. result <- ces(c(2, 2.2, 2.5), c(.35, .25, .20), c(.40, .35, .30), ownerPre = c("A", "B", "C"), ownerPost = c("A", "A", "C"), insideSize = 100) result@pricePost
Calculate the marginal cost reductions necessary to restore premerger prices in a merger, or the Upwards Pricing Pressure Index for the products of merging firms playing a differentiated products Bertrand pricing game.
## S4 method for signature 'Bertrand' cmcr(object, market = FALSE, levels = FALSE, rel = c("cost", "price")) ## S4 method for signature 'Cournot' cmcr(object, market = TRUE, levels = FALSE, rel = c("cost", "price")) ## S4 method for signature 'AIDS' cmcr(object, market = FALSE, rel = c("cost", "price")) ## S4 method for signature 'Auction2ndLogit' cmcr(object, market = FALSE, levels = FALSE, rel = c("cost", "price"), ...)## S4 method for signature 'Bertrand' cmcr(object, market = FALSE, levels = FALSE, rel = c("cost", "price")) ## S4 method for signature 'Cournot' cmcr(object, market = TRUE, levels = FALSE, rel = c("cost", "price")) ## S4 method for signature 'AIDS' cmcr(object, market = FALSE, rel = c("cost", "price")) ## S4 method for signature 'Auction2ndLogit' cmcr(object, market = FALSE, levels = FALSE, rel = c("cost", "price"), ...)
object |
An instance of one of the classes listed above. |
market |
If TRUE, calculates (post-merger) share-weighted average of metric. Default is FALSE. |
levels |
If TRUE calculates CMCR in levels rather than as a percentage of pre-merger costs. Default is FALSE. |
rel |
A length 1 character vector indicating whether CMCR should be calculated relative to pre-merger cost (“cost”) or pre-merger price (“price”), Default is “cost”. Ignored when levels is TRUE. |
... |
Additional arguments to pass to |
cmcr uses the results from the merger simulation and calibration
methods associates with a particular class to compute the compensating
marginal cost reduction (CMCR) for each of the merging parties' products.
cmcr returns a vector of length k equal to CMCR for the
merging parties' products and 0 for all other products.
cmcr.bertrand is a function that calculates CMCR
without the need to first calibrate a demand system and simulate a
merger.
Calculate the marginal cost reductions necessary to restore premerger prices (CMCR), or the net Upwards Pricing Pressure (UPP) in a merger involving firms playing a differentiated products Bertrand pricing game.
Let k denote the number of products produced by the merging parties below.
cmcr.bertrand( prices, margins, diversions, ownerPre, ownerPost = matrix(1, ncol = length(prices), nrow = length(prices)), output = TRUE, rel = c("cost", "price"), labels = names(prices) ) upp.bertrand( prices, margins, diversions, ownerPre, ownerPost = matrix(1, ncol = length(prices), nrow = length(prices)), output = TRUE, mcDelta = rep(0, length(prices)), labels = paste("Prod", 1:length(prices), sep = "") )cmcr.bertrand( prices, margins, diversions, ownerPre, ownerPost = matrix(1, ncol = length(prices), nrow = length(prices)), output = TRUE, rel = c("cost", "price"), labels = names(prices) ) upp.bertrand( prices, margins, diversions, ownerPre, ownerPost = matrix(1, ncol = length(prices), nrow = length(prices)), output = TRUE, mcDelta = rep(0, length(prices)), labels = paste("Prod", 1:length(prices), sep = "") )
prices |
A length-k vector of product prices. |
margins |
A length-k vector of product margins. |
diversions |
A k x k matrix of diversion ratios with diagonal elements equal to -1. |
ownerPre |
EITHER a vector of length k whose values indicate which of the merging parties produced a product pre-merger OR a k x k matrix of pre-merger ownership shares. |
ownerPost |
A k x k matrix of post-merger ownership shares. Default is a k x k matrix of 1s. |
output |
length 1 logical vector equal TRUE if calculation is for output market and FALSE if for input market. Default is TRUE |
rel |
A length 1 character vector indicating whether CMCR should be calculated relative to pre-merger cost (“cost”) or pre-merger price (“price”), Default is “cost”. |
labels |
A length-k vector of product labels. |
mcDelta |
A vector of length k where each element equals the proportional change in a product's marginal costs due to the merger. Default is 0, which assumes that the merger does not affect any products' marginal cost. |
All ‘prices’ elements must be positive, all ‘margins’ elements must be between 0 and 1 (‘output’=TRUE only), and all ‘diversions’ elements must be between 0 and 1 in absolute value. In addition, off-diagonal elements (i,j) of ‘diversions’ must equal an estimate of the diversion ratio from product i to product j (i.e. the estimated fraction of i's sales that go to j due to a small increase in i's price). Also, ‘diversions’ elements are positive if i and j are substitutes and negative if i and j are complements.
‘ownerPre’ will typically be a vector whose values equal 1 if a product is produced by firm 1 and 0 otherwise, though other values including firm name are acceptable. Optionally, ‘ownerPre’ may be set equal to a matrix of the merging firms pre-merger ownership shares. These ownership shares must be between 0 and 1.
‘ownerPost’ is an optional argument that should only be specified if one party to the acquisition is assuming partial control of the other party's assets. ‘ownerPost’ elements must be between 0 and 1.
cmcr.bertrand returns a length-k vector whose values
equal the percentage change in each products'
marginal costs that the merged firms must achieve in order to offset a
price increase.
upp.bertrand returns a length-k vector whose values equal
the generalized pricing pressure (GePP) for each of the merging's parties' products,
net any efficiency claims. GePP is a generalization of Upwards Pricing Pressure (UPP)
that accomodates multi-product firms.
Charles Taragin [email protected]
Farrell, Joseph and Shapiro, Carl (2010). “Antitrust Evaluation of Horizontal Mergers: An Economic Alternative to Market Definition.” The B.E. Journal of Theoretical Economics, 10(1), pp. 1-39.
Jaffe, Sonia and Weyl Eric (2012). “The First-Order Approach to Merger Analysis.” SSRN eLibrary
Werden, Gregory (1996). “A Robust Test for Consumer Welfare Enhancing Mergers Among Sellers of Differentiated Products.” The Journal of Industrial Economics, 44(4), pp. 409-413.
cmcr.cournot for a homogeneous products Cournot
version of CMCR, and cmcr-methods for calculating
CMCR and UPP after calibrating demand system parameters and simulating a merger.
## Standalone screening when a complete market fit is unavailable. prices <- c(50, 45, 70) margins <- c(.3, .4, .6) diversions <- matrix(c(-1, .5, .01, .6, -1, .1, .02, .2, -1), ncol = 3) cmcr.bertrand(prices, margins, diversions, ownerPre = c(1, 0, 0)) upp.bertrand(prices, margins, diversions, ownerPre = c(1, 0, 0))## Standalone screening when a complete market fit is unavailable. prices <- c(50, 45, 70) margins <- c(.3, .4, .6) diversions <- matrix(c(-1, .5, .01, .6, -1, .1, .02, .2, -1), ncol = 3) cmcr.bertrand(prices, margins, diversions, ownerPre = c(1, 0, 0)) upp.bertrand(prices, margins, diversions, ownerPre = c(1, 0, 0))
Calculate the marginal cost reductions necessary to restore premerger prices (CMCR), or the net Upwards Pricing Pressure (UPP) in a merger involving firms playing a homogeneous product Cournot pricing game.
cmcr.cournot( shares, mktElast, party = FALSE, rel = c("cost", "price"), labels = names(shares) ) cmcr.cournot2( margins, rel = c("cost", "price"), party = FALSE, labels = names(margins) ) upp.cournot( prices, margins, ownerPre, ownerPost = matrix(1, ncol = length(prices), nrow = length(prices)), mcDelta = rep(0, length(prices)), labels = names(margins) )cmcr.cournot( shares, mktElast, party = FALSE, rel = c("cost", "price"), labels = names(shares) ) cmcr.cournot2( margins, rel = c("cost", "price"), party = FALSE, labels = names(margins) ) upp.cournot( prices, margins, ownerPre, ownerPost = matrix(1, ncol = length(prices), nrow = length(prices)), mcDelta = rep(0, length(prices)), labels = names(margins) )
shares |
A length-2 vector containing merging party quantity shares. |
mktElast |
A length-1 containing the industry elasticity. |
party |
If TRUE calculate a length-2 vector of individial party CMCRs. If FALSE calculate share-weighted CMCR relative to share-weighted pre-merger marginal costs. Default is FALSE |
rel |
A length 1 character vector indicating whether CMCR should be calculated relative to pre-merger cost (“cost”) or pre-merger price (“price”), Default is “cost”. |
labels |
A length-2 vector of product labels. |
margins |
A length-2 vector of product margins. |
prices |
A length-2 vector of product prices. |
ownerPre |
EITHER a vector of length 2 whose values indicate which of the merging parties produced a product pre-merger OR a 2 x 2 matrix of pre-merger ownership shares. |
ownerPost |
A 2 x 2 matrix of post-merger ownership shares. Default is a 2 x 2 matrix of 1s. |
mcDelta |
A vector of length 2 where each element equals the proportional change in a product's marginal costs due to the merger. Default is 0, which assumes that the merger does not affect any products' marginal cost. |
The ‘shares’ (or ‘margins’) vector must have 2 elements, and all ‘shares’ and ‘margins’ elements must be between 0 and 1. The ‘mktElast’ vector must have 1 non-negative element.
when ‘party’ is FALSE (default), cmcr.cournot, cmcr.cournot2 return a vector with 1 element whose value equals the percentage change
in the products' average marginal costs that the merged firms
must achieve in order to offset a price increase. When ‘party’ is TRUE, cmcr.cournot, cmcr.cournot2 return a vector with 2 element whose value equals the percentage change
in each parties' marginal costs necessary to offset a price increase. When ‘rel’ equals "cost" (default) results are in terms of per-merger marginal costs. Otherwise, results are in terms of pre-merger price.
Charles Taragin
Froeb, Luke and Werden, Gregory (1998). “A robust test for consumer welfare enhancing mergers among sellers of a homogeneous product.” Economics Letters, 58(3), pp. 367 - 369.
Werden, Gregory and Froeb, Luke (2008). “Unilateral Competitive Effects of Horizontal Mergers”, in Paolo Buccirossi (ed), Handbook of Antitrust Economics (MIT Press).
cmcr.bertrand for a differentiated products Bertrand version of this measure.
## Standalone Cournot screening with two merging firms. shares <- c(.05, .65) industry_elasticity <- 1.9 cmcr.cournot(shares, industry_elasticity, rel = "cost") cmcr.cournot2(shares / industry_elasticity, party = TRUE, rel = "cost")## Standalone Cournot screening with two merging firms. shares <- c(.05, .65) industry_elasticity <- 1.9 cmcr.cournot(shares, industry_elasticity, rel = "cost") cmcr.cournot2(shares / industry_elasticity, party = TRUE, rel = "cost")
'combine_counterfactuals()' merges the single steps of several one-step 'Counterfactual' objects into one simultaneous 'CounterfactualStep', erroring if any field is supplied with conflicting values. Combining multi-step 'Counterfactual' objects is ambiguous and is rejected explicitly; use 'add_step()' to sequence changes instead.
combine_counterfactuals(...)combine_counterfactuals(...)
... |
'Counterfactual' objects, each with exactly one step. |
A one-step 'Counterfactual'.
Combines a new marginal-cost change with a cumulative change using the cost convention of 'object'. Most structural models use proportional changes; second-score Logit auctions retain their historical additive convention.
compound_cost_shocks(object, current = NULL, change = NULL)compound_cost_shocks(object, current = NULL, change = NULL)
object |
A fitted structural model whose cost convention is used. |
current |
The current cumulative cost change, or 'NULL'. |
change |
The next cost change, or 'NULL'. |
The compounded cost-change vector, or 'current' when 'change' is 'NULL'.
For Auction2ndCap, calcMC calculates (constant) marginal cost for each product. For those classes that do not require prices, returns a length-k vector of NAs when prices are not supplied.
For Bertrand, calcMC computes either pre- or post-merger marginal costs.
Marginal costs are assumed to be constant. Post-merger marginal costs are
equal to pre-merger marginal costs multiplied by 1+‘mcDelta’, a
length-k vector of physical marginal-cost changes. With revenue retention
, constant-cost values returned by calcMC are effective costs
, so that a price-cost margin is . For an
initialized model, the post-merger value is
.
Thus a pure retention change uses ‘mcDelta’=0. The second-score
Logit auction retains its legacy additive physical cost-level
interpretation of ‘mcDelta’.
For Auction2ndLogit, calcMC computes constant marginal costs impied by the model.
For Cournot, calcMC calculates marginal cost for each product.
calcdMC computes the derivative of either pre- or post-merger marginal costs. The derivative of Marginal costs is assumed to be constant. Post-merger marginal costs are equal to pre-merger marginal costs multiplied by 1+‘mcDelta’, a length-k vector of marginal cost changes. ‘mcDelta’ will typically be between 0 and 1.
calcVC computes either pre- or post-merger variable costs. Variable costs are assumed to be quadratic by default. Post-merger variable costs are equal to pre-merger variable costs multiplied by 1+‘mcDelta’, a length-k vector of marginal cost changes. ‘mcDelta’ will typically be between 0 and 1.
## S4 method for signature 'Bertrand' calcMC(object, preMerger = TRUE) ## S4 method for signature 'Auction2ndCap' calcMC(object, t, preMerger = TRUE, exAnte = TRUE) ## S4 method for signature 'Cournot' calcMC(object, preMerger = TRUE) ## S4 method for signature 'Auction2ndLogit' calcMC(object, preMerger = TRUE, exAnte = FALSE) ## S4 method for signature 'Auction2ndCES' calcMC(object, preMerger = TRUE) ## S4 method for signature 'Stackelberg' calcdMC(object, preMerger = TRUE) ## S4 method for signature 'Cournot' calcVC(object, preMerger = TRUE)## S4 method for signature 'Bertrand' calcMC(object, preMerger = TRUE) ## S4 method for signature 'Auction2ndCap' calcMC(object, t, preMerger = TRUE, exAnte = TRUE) ## S4 method for signature 'Cournot' calcMC(object, preMerger = TRUE) ## S4 method for signature 'Auction2ndLogit' calcMC(object, preMerger = TRUE, exAnte = FALSE) ## S4 method for signature 'Auction2ndCES' calcMC(object, preMerger = TRUE) ## S4 method for signature 'Stackelberg' calcdMC(object, preMerger = TRUE) ## S4 method for signature 'Cournot' calcVC(object, preMerger = TRUE)
object |
An instance of the respective class (see description for the classes) |
preMerger |
If TRUE, the pre-merger ownership structure is used. If FALSE, the post-merger ownership structure is used. Default is TRUE. |
t |
The capacity profile of each supplier. Default is ‘preMerger’ capacities. |
exAnte |
If ‘exAnte’ equals TRUE then the ex ante expected result for each firm is produced, while FALSE produces the expected result conditional on each firm winning the auction. Default is FALSE. |
'counterfactual()' stores only supplied changes to the economic environment, bundled as the single 'CounterfactualStep' of a 'Counterfactual'. Demand, conduct, and model variants are deliberately not counterfactual fields; use 'update()' or 'respecify()' for those changes. Use 'add_step()' to append further, sequential steps.
counterfactual( ownership = NULL, costs = NULL, exit = NULL, capacity = NULL, tariff = NULL, quota = NULL, bargaining = NULL, leader = NULL, products = NULL, quality = NULL, entry = NULL, core = NULL, ... )counterfactual( ownership = NULL, costs = NULL, exit = NULL, capacity = NULL, tariff = NULL, quota = NULL, bargaining = NULL, leader = NULL, products = NULL, quality = NULL, entry = NULL, core = NULL, ... )
ownership |
Post-counterfactual ownership. |
costs |
Post-counterfactual marginal-cost changes. Constant-cost Bertrand-family models apply these to their retained structural cost primitives; second-score Logit uses its legacy additive cost-level convention. |
exit |
Products to remove, or a logical active-product vector. |
capacity |
Post-counterfactual capacities. |
tariff |
A tariff change, unsupported by antitrust models. |
quota |
A quota change, unsupported by antitrust models. |
bargaining |
Post-counterfactual bargaining parameters. |
leader |
Post-counterfactual leader indicators for Stackelberg models. |
products |
Post-counterfactual product structure for Stackelberg models. |
quality |
A named numeric vector of proportional changes to product attractiveness, keyed by product label. For Logit demand this is a proportional choice-weight change, represented as 'meanval_new <- meanval_current + log1p(quality)'; CES retains its multiplicative mean-value convention. |
entry |
An 'Entrant' object, or a list of 'Entrant' objects, each describing a new single-product firm to add to the market. |
core |
Core-firm IDs for downstream native coordination games; unsupported by ordinary antitrust fits. |
... |
Reserved; model specification fields are rejected. |
A 'Counterfactual' object with exactly one 'CounterfactualStep'.
fit <- calibrate("logit", "bertrand", prices = c(2, 2.2, 2.5), shares = c(.35, .25, .20), margins = c(.40, .35, .30), ownerPre = c("A", "B", "C"), insideSize = 100) scenario <- counterfactual(ownership = c("A", "A", "C")) simulate(fit, scenario)@pricePostfit <- calibrate("logit", "bertrand", prices = c(2, 2.2, 2.5), shares = c(.35, .25, .20), margins = c(.40, .35, .30), ownerPre = c("A", "B", "C"), insideSize = 100) scenario <- counterfactual(ownership = c("A", "A", "C")) simulate(fit, scenario)@pricePost
'Counterfactual' stores an ordered sequence of 'CounterfactualStep' objects. A 'Counterfactual' returned by 'counterfactual()' has exactly one step; 'add_step()' appends additional steps to be solved sequentially, each starting from the equilibrium produced by the previous step.
## S4 method for signature 'Counterfactual' show(object)## S4 method for signature 'Counterfactual' show(object)
object |
A 'Counterfactual' object. |
stepsA list of 'CounterfactualStep' objects.
'CounterfactualPath' records the legacy S4 result produced by every step of a multi-step 'Counterfactual', together with the ordered 'CounterfactualStep' objects that produced them and the originally calibrated legacy S4 state the path began from. The state history is the actual legacy S4 result objects; constant-cost models additionally carry internal structural cost metadata so promotion preserves calibrated cost primitives while public result slots record each step.
## S4 method for signature 'CounterfactualPath' show(object)## S4 method for signature 'CounterfactualPath' show(object)
object |
A 'CounterfactualPath' object. |
initialThe originally calibrated legacy S4 model state.
stepsThe ordered 'CounterfactualStep' objects that were solved.
resultsThe legacy S4 result after each step, in order.
diagnosticsBookkeeping needed to resume simulation from this path.
'CounterfactualStep' stores one bundle of economic-environment changes to be applied and solved as a single equilibrium. Demand, conduct, and model variants are deliberately not counterfactual fields; use 'update()' or 'respecify()' for those changes.
## S4 method for signature 'CounterfactualStep' show(object)## S4 method for signature 'CounterfactualStep' show(object)
object |
A 'CounterfactualStep' object. |
changesA named list of supplied change fields.
The “Cournot” and “Stackelberg” classes are building blocks used to create other classes in this package. As such, they are most likely to be useful for developers who wish to code their own merger calibration/simulation routines.
Note below that k is the number of products and n is the number of plants.
interceptsA length k vector containing the calibrated demand intercept.
mcfunPreA length n list whose elements equal a function that calculates a plant's pre-merger marginal cost.
mcfunPostA length n list whose elements equal a function that calculates a plant's post-merger marginal cost.
vcfunPreA length n list whose elements equal a function that calculates a plant's pre-merger variable cost.
vcfunPostA length n list whose elements equal a function that calculates a plant's post-merger variable cost.
pricesA length k vector of product prices.
quantitiesAn n x k matrix of plant quantities produced for each product.
marginsAn n x k matrix of plant product margins.
quantityPreAn n x k matrix of predicted pre-merger quantities.
quantityPostAn n x k matrix of predicted post-merger quantities.
quantityStartA length n x k vector of starting quantities for the non-linear solver.
productsPreAn n x k logical matrix qhose elements are TRUE if a plant produces a product pre-merger and FALSE otherwise.
productsPostAn n x k logical matrix qhose elements are TRUE if a plant produces a product post-merger and FALSE otherwise.
capacitiesPreA length-n logical vector whose elements equal to pre-merger plant capacities. Infinite values are allowed.
capacitiesPostA length-n logical vector whose elements equal to post-merger plant capacities. Infinite values are allowed.
demandA length k character vector specifying whether product demand is linear ("linear") or log-linear ("log").
costA length k character vector equal to "linear" if a plant's marginal cost curve is assumed to be linear or "constant" if a plant's marginal curve is assumed to be constant. Returns an error if a multi-plant firm with constant marginal costs does not have capacity constraints.
mktElastA length k vector of market elasticities.
dmcfunPreA length n list whose elements equal a function that calculates the derivative of a plant's pre-merger marginal cost with respect to that plant's output. (Stackelberg only)
dmcfunPostA length n list whose elements equal a function that calculates the derivative of a plant's post-merger marginal cost with respect to that plant's output. (Stackelberg only)
isLeaderPreAn n x k logical matrix qhose elements are TRUE if a plant produces a product pre-merger and FALSE otherwise. (Stackelberg only)
isLeaderPostAn n x k logical matrix qhose elements are TRUE if a plant produces a product post-merger and FALSE otherwise. #'@slot dmcfunPre A length n list whose elements equal a function that calculates the derivative of a plant's pre-merger marginal cost with respect to that plant's output. (Stackelberg only)
For Cournot, objects can be created by calls of the form new("Cournot", ...).
For Stackelberg, objects can be created by calls of the form new("Stackelberg", ...).
Cournot:
Class Bertrand, directly.
Class Antitrust, by class Bertrand, distance 2.
Stackelberg:
Class Cournot, directly.
Class Bertrand, by class Cournot, distance 2.
Class Antitrust, by class Bertrand, distance 3.
Charles Taragin [email protected]
showClass("Cournot") # get a detailed description of the class showClass("Stackelberg") # get a detailed description of the classshowClass("Cournot") # get a detailed description of the class showClass("Stackelberg") # get a detailed description of the class
Calibrates consumer demand for multiple products using either a linear or log-linear demand system and then simulates the prices effect of a merger between two multi-plant firms under the assumption that all firms in the market are playing either a Cournot or Stackelberg quantity setting game.
Let k denote the number of products and n denote the number of plants below.
cournot( prices, quantities, margins = matrix(NA_real_, nrow(quantities), ncol(quantities)), demand = rep("linear", length(prices)), cost = rep("linear", nrow(quantities)), mcfunPre = list(), mcfunPost = mcfunPre, vcfunPre = list(), vcfunPost = vcfunPre, capacitiesPre = rep(Inf, nrow(quantities)), capacitiesPost = capacitiesPre, productsPre = !is.na(quantities), productsPost = productsPre, ownerPre, ownerPost, output = TRUE, mktElast = rep(NA_real_, length(prices)), mcDelta = rep(0, nrow(quantities)), quantityStart = as.vector(quantities), control.slopes, control.equ, labels, ... ) stackelberg( prices, quantities, margins, demand = rep("linear", length(prices)), cost = rep("linear", nrow(quantities)), isLeaderPre = matrix(FALSE, ncol = ncol(quantities), nrow = nrow(quantities)), isLeaderPost = isLeaderPre, mcfunPre = list(), mcfunPost = mcfunPre, vcfunPre = list(), vcfunPost = vcfunPre, dmcfunPre = list(), dmcfunPost = dmcfunPre, capacitiesPre = rep(Inf, nrow(quantities)), capacitiesPost = capacitiesPre, productsPre = !is.na(quantities), productsPost = productsPre, ownerPre, ownerPost, output = TRUE, mcDelta = rep(0, nrow(quantities)), quantityStart = as.vector(quantities), control.slopes, control.equ, labels, ... )cournot( prices, quantities, margins = matrix(NA_real_, nrow(quantities), ncol(quantities)), demand = rep("linear", length(prices)), cost = rep("linear", nrow(quantities)), mcfunPre = list(), mcfunPost = mcfunPre, vcfunPre = list(), vcfunPost = vcfunPre, capacitiesPre = rep(Inf, nrow(quantities)), capacitiesPost = capacitiesPre, productsPre = !is.na(quantities), productsPost = productsPre, ownerPre, ownerPost, output = TRUE, mktElast = rep(NA_real_, length(prices)), mcDelta = rep(0, nrow(quantities)), quantityStart = as.vector(quantities), control.slopes, control.equ, labels, ... ) stackelberg( prices, quantities, margins, demand = rep("linear", length(prices)), cost = rep("linear", nrow(quantities)), isLeaderPre = matrix(FALSE, ncol = ncol(quantities), nrow = nrow(quantities)), isLeaderPost = isLeaderPre, mcfunPre = list(), mcfunPost = mcfunPre, vcfunPre = list(), vcfunPost = vcfunPre, dmcfunPre = list(), dmcfunPost = dmcfunPre, capacitiesPre = rep(Inf, nrow(quantities)), capacitiesPost = capacitiesPre, productsPre = !is.na(quantities), productsPost = productsPre, ownerPre, ownerPost, output = TRUE, mcDelta = rep(0, nrow(quantities)), quantityStart = as.vector(quantities), control.slopes, control.equ, labels, ... )
prices |
A length k vector product prices. |
quantities |
An n x k matrix of product quantities. All quantities must either be positive, or if the product is not produced by a plant, NA. |
margins |
An n x k matrix of product margins. All margins must be either be between 0 and 1, or NA. |
demand |
A length k character vector equal to "linear" if a product's demand curve is assumed to be linear or "log" if a product's demand curve is assumed to be log-linear. |
cost |
A length n character vector equal to "linear" if a plant's marginal cost curve is assumed to be linear or "constant" if a plant's marginal curve is assumed to be constant. Returns an error if a multi-plant firm with constant marginal costs does not have capacity constraints. |
mcfunPre |
a length n list of functions that calculate a plant's pre-merger marginal cost. If empty (the default), assumes quadratic costs. |
mcfunPost |
a length n list of functions that calculate a plant's post-merger marginal cost. If empty (the default), equals ‘mcfunPre’ |
vcfunPre |
a length n list of functions that calculate a plant's pre-merger variable cost. If empty (the default), assumes quadratic variable costs. |
vcfunPost |
a length n list of functions that calculate a plant's post-merger variable cost. If empty (the default), equals ‘vcfunPre’ |
capacitiesPre |
A length n numeric vector of pre-merger plant capacities. Default is Inf. |
capacitiesPost |
A length n numeric vector of post-merger plant capacities. Default ‘capacitiesPre’. |
productsPre |
An n x k matrix that equals TRUE if pre-merger, a plant produces a product. Default is TRUE if 'quantities' is not NA. |
productsPost |
An n x k matrix that equals TRUE if post-merger, a plant produces a product. Default equals ‘productsPre’. |
ownerPre |
EITHER a vector of length n whose values indicate which plants are commonly owned pre-merger OR an n x n matrix of pre-merger ownership shares. |
ownerPost |
EITHER a vector of length n whose values indicate which plants will be commonly owned after the merger OR an n x n matrix of post-merger ownership shares. |
output |
A length 1 logical vector equal to TRUE if merger simulates an output, FALSE if merger simulates an input. Default is TRUE. |
mktElast |
A length k vector of product elasticities. Default is a length k vector of NAs |
mcDelta |
A length n vector where each element equals the proportional change in a firm's marginal costs due to the merger. Default is 0, which assumes that the merger does not affect any products' marginal cost. |
quantityStart |
A length k vector of quantities used as the initial guess in the nonlinear equation solver. Default is ‘quantities’. |
control.slopes |
A list of |
control.equ |
A list of |
labels |
A list with 2 elements. The first element is a vector of firm names, while the second element is a vector of products names. Default is ‘O1:On’, and ‘P1:Pk’. |
... |
Additional options to feed to the solver. See below. |
isLeaderPre |
An n x k logical matrix equal to TRUE if a firm is
a "leader" pre-merger for a particular product and FALSE otherwise.
Default is FALSE, which is equivalent to |
isLeaderPost |
An n x k logical matrix equal to TRUE if a firm
is a "leader" pre-merger for a particular product and FALSE otherwise.
Default is FALSE, which is equivalent to |
dmcfunPre |
a length n list of functions that calculate the derivative of a plant's pre-merger marginal cost. If empty (the default), assumes quadratic variable costs. |
dmcfunPost |
a length n list of functions that calculate the derivative of a plant's post-merger marginal cost. If empty (the default), equals ‘mcfunPre’ |
Using price, and quantity, information for all products
in each market, as well as margin information for at least
one products in each market, cournot is able to
recover the slopes and intercepts of either a Linear or Log-linear demand
system as well as the cost parameters (see below for further details).
These parameters are then used to simulate the price
effects of a merger between
two firms under the assumption that the firms are playing a
homogeneous products simultaneous quantity setting game.
stackelberg, is similar to cournot, except that for a given product,
firms are either "leaders" or "followers". leaders gain a first mover advantage
over followers, which allows the leaders to anticipate how changes to their output
will effect the follower's output decisions. Firms can be the leader for
some products but the follower in others.
‘mcfunPre’ and ‘mcfunPost’ are length n lists whose elements are ‘R’ functions
that return a firm's marginal cost. The first argument of each function should be total firm quantities.
By default, each firm is assumed to have quadratic costs with a firm-specific parameter calibrated from a firm's margin.
‘vcfunPre’ and ‘vcfunPost’ are similarly defined.
‘dmcfunPre’ and ‘dmcfunPost’ are the changes in marginal cost and are only required for stackelberg.
‘ownerPre’ and ‘ownerPost’ values will typically be equal to either 0 (element [i,j] is not commonly owned) or 1 (element [i,j] is commonly owned), though these matrices may take on any value between 0 and 1 to account for partial ownership.
Under linear demand and linear marginal costs, an analytic solution to the Cournot quantity game
exists. However, this solution can at times produce negative
equilibrium quantities. To accommodate this issue, cournot
uses BBsolve to
find equilibrium quantities subject to a non-negativity constraint. ... may
be used to change the default options for BBsolve.
cournot returns an instance of class Cournot.
stackelberg returns an instance of class Stackelberg.
Charles Taragin [email protected]
## Direct quantity-game constructors remain available for compatibility. n <- 3 capacity <- c(.5, .6, .7) intercept <- 10 slope <- -.25 system <- matrix(slope, n, n) diag(system) <- 2 * slope - 1 / capacity quantities <- rowSums(solve(system) * -intercept) price <- intercept + slope * sum(quantities) margins <- 1 - (quantities / capacity) / price before <- diag(n) after <- before after[1, 2] <- after[2, 1] <- 1 result <- cournot(price, matrix(quantities, ncol = 1), margins = matrix(margins, ncol = 1), ownerPre = before, ownerPost = after) result@pricePost leader <- matrix(c(FALSE, FALSE, TRUE), ncol = 1) result_leader <- stackelberg(price, matrix(quantities, ncol = 1), margins = matrix(margins, ncol = 1), ownerPre = before, ownerPost = after, isLeaderPre = leader, isLeaderPost = matrix(TRUE, nrow = n, ncol = 1)) result_leader@pricePost## Direct quantity-game constructors remain available for compatibility. n <- 3 capacity <- c(.5, .6, .7) intercept <- 10 slope <- -.25 system <- matrix(slope, n, n) diag(system) <- 2 * slope - 1 / capacity quantities <- rowSums(solve(system) * -intercept) price <- intercept + slope * sum(quantities) margins <- 1 - (quantities / capacity) / price before <- diag(n) after <- before after[1, 2] <- after[2, 1] <- 1 result <- cournot(price, matrix(quantities, ncol = 1), margins = matrix(margins, ncol = 1), ownerPre = before, ownerPost = after) result@pricePost leader <- matrix(c(FALSE, FALSE, TRUE), ncol = 1) result_leader <- stackelberg(price, matrix(quantities, ncol = 1), margins = matrix(margins, ncol = 1), ownerPre = before, ownerPost = after, isLeaderPre = leader, isLeaderPost = matrix(TRUE, nrow = n, ncol = 1)) result_leader@pricePost
Calculate the amount of money a consumer would need to be paid to be just as well off as they were before the merger.
All the information needed to compute CV is already available within the Logit, Nested Logit CES and Nested CES classes. In CES and Nested CES, CV cannot be calculated if the outside share cannot be inferred.
For AIDS, if the ‘insideSize’ slot to the “AIDS” class equals NA, CV is calculated as a percentage of total expenditure (revenues) on products included in the simulation. Otherwise CV is calculated in terms of dollars. Pre-merger prices for all products in the market must be supplied in order for CV to be calculated.
For Linear and LogLin, although no additional information is needed to calculate CV for either the “Linear” or “LogLin” classes, The CV method will fail if the appropriate restrictions on the demand parameters have not been imposed.
CV(object, ...) ## S4 method for signature 'Cournot' CV(object) ## S4 method for signature 'Linear' CV(object) ## S4 method for signature 'Logit' CV(object, subsetPre = NULL) ## S4 method for signature 'LogitBLP' CV(object, lim = c(0, 1)) ## S4 method for signature 'LogLin' CV(object) ## S4 method for signature 'AIDS' CV(object) ## S4 method for signature 'LogitNests' CV(object) ## S4 method for signature 'Auction2ndLogit' CV(object, subsetPre = NULL) ## S4 method for signature 'CES' CV(object, subsetPre = NULL) ## S4 method for signature 'CESNests' CV(object)CV(object, ...) ## S4 method for signature 'Cournot' CV(object) ## S4 method for signature 'Linear' CV(object) ## S4 method for signature 'Logit' CV(object, subsetPre = NULL) ## S4 method for signature 'LogitBLP' CV(object, lim = c(0, 1)) ## S4 method for signature 'LogLin' CV(object) ## S4 method for signature 'AIDS' CV(object) ## S4 method for signature 'LogitNests' CV(object) ## S4 method for signature 'Auction2ndLogit' CV(object, subsetPre = NULL) ## S4 method for signature 'CES' CV(object, subsetPre = NULL) ## S4 method for signature 'CESNests' CV(object)
object |
An instance of one of the classes listed above. |
... |
Additional arguments to pass to the method. |
subsetPre |
Optional logical pre-market product mask for Logit, CES, and standard Logit second-score models. Defaults to the retained pre-market mask after a transition, otherwise all products; use it when advancing a market with prior exits or newly entering products. |
lim |
“LogitBLP” class only. A length 2 numeric vector equal to the lower and upper quantiles of the price coefficient distribution over which to compute CV. Default c(0,1). |
An Implementation of the Hypothetical Monopolist Test described in either the 2023 or 2010 Merger Guidelines.
HypoMonTest implements the Hypothetical Monopolist Test for a given ‘ssnip’.
calcPricesHypoMon computes prices for a subset of firms under the control of a hypothetical monopolist
under the specified demand function or auction.
diversionHypoMon calculates the matrix of revenue diversions between all products included in the
merger simulation, irrespective of whether or not they are also included in ‘prodIndex’.
calcPriceDeltaHypoMon computes the proportional difference in product prices between the
prices of products in ‘prodIndex’ (i.e. prices set by the
Hypothetical Monopolist) and prices set in the pre-merger equilibrium.
‘...’ may be used to pass arguments to the optimizer.
## S4 method for signature 'Bertrand' HypoMonTest( object, prodIndex, ssnip = ifelse(object@output, 0.05, -0.05), hmg = c("2023", "2010"), ... ) ## S4 method for signature 'Cournot' HypoMonTest( object, plantIndex, prodIndex, ssnip = ifelse(object@output, 0.05, -0.05), hmg = c("2023", "2010"), ... ) ## S4 method for signature 'Cournot' calcPricesHypoMon(object, plantIndex, prodIndex) ## S4 method for signature 'Linear' calcPricesHypoMon(object, prodIndex) ## S4 method for signature 'Logit' calcPricesHypoMon(object, prodIndex) ## S4 method for signature 'LogLin' calcPricesHypoMon(object, prodIndex) ## S4 method for signature 'AIDS' calcPricesHypoMon(object, prodIndex, ...) ## S4 method for signature 'LogitCap' calcPricesHypoMon(object, prodIndex, ...) ## S4 method for signature 'Auction2ndLogit' calcPricesHypoMon(object, prodIndex) ## S4 method for signature 'Bertrand' diversionHypoMon(object, prodIndex, ...) ## S4 method for signature 'AIDS' diversionHypoMon(object) ## S4 method for signature 'Bertrand' calcPriceDeltaHypoMon(object, prodIndex, ...) ## S4 method for signature 'Cournot' calcPriceDeltaHypoMon(object, prodIndex, plantIndex, ...) ## S4 method for signature 'AIDS' calcPriceDeltaHypoMon(object, prodIndex, ...)## S4 method for signature 'Bertrand' HypoMonTest( object, prodIndex, ssnip = ifelse(object@output, 0.05, -0.05), hmg = c("2023", "2010"), ... ) ## S4 method for signature 'Cournot' HypoMonTest( object, plantIndex, prodIndex, ssnip = ifelse(object@output, 0.05, -0.05), hmg = c("2023", "2010"), ... ) ## S4 method for signature 'Cournot' calcPricesHypoMon(object, plantIndex, prodIndex) ## S4 method for signature 'Linear' calcPricesHypoMon(object, prodIndex) ## S4 method for signature 'Logit' calcPricesHypoMon(object, prodIndex) ## S4 method for signature 'LogLin' calcPricesHypoMon(object, prodIndex) ## S4 method for signature 'AIDS' calcPricesHypoMon(object, prodIndex, ...) ## S4 method for signature 'LogitCap' calcPricesHypoMon(object, prodIndex, ...) ## S4 method for signature 'Auction2ndLogit' calcPricesHypoMon(object, prodIndex) ## S4 method for signature 'Bertrand' diversionHypoMon(object, prodIndex, ...) ## S4 method for signature 'AIDS' diversionHypoMon(object) ## S4 method for signature 'Bertrand' calcPriceDeltaHypoMon(object, prodIndex, ...) ## S4 method for signature 'Cournot' calcPriceDeltaHypoMon(object, prodIndex, plantIndex, ...) ## S4 method for signature 'AIDS' calcPriceDeltaHypoMon(object, prodIndex, ...)
object |
An instance of one of the classes listed above. |
prodIndex |
A vector of product indices that are to be placed under the control of the Hypothetical Monopolist. |
ssnip |
A number between 0 and 1 that equals the threshold for a “Small but Significant and Non-transitory Increase in Price” (SSNIP). Default is .05, or 5%. |
hmg |
Either the string "2023" (default) or "2010". Implements the Hypothetical Monopolist Test described in either the 2010 or 2023 Merger Guidelines. |
... |
Pass options to the optimizer used to solve for equilibrium prices. |
plantIndex |
A vector of plant indices that are to be placed under the control of the Hypothetical Monopolist (Cournot). |
Let k denote the number of products produced by all firms playing the Bertrand pricing game above.
HypoMonTest is an implementation of the 2023 Merger Guidelines Hypothetical Monopolist Test
on the products indexed by ‘prodIndex’ for a ‘ssnip’. The
Hypothetical Monopolist Test described in the 2023 Merger Guidelines determines whether a profit-maximizing
Hypothetical Monopolist who controls the products indexed by
‘prodIndex’ would increase the price of at least one of the products in ‘prodIndex’ by a
small, significant, and non-transitory amount (i.e. impose a SSNIP). Setting ‘hmg’ to "2010" implements the
Hypothetical Monopolist Test described in the 2010 Merger Guidelines, which requires the Hypothetical Monopolist to
increase the price of one of the merging parties' products in ‘prodIndex’ by a SSNIP.
calcPriceDeltaHypoMon calculates the price changes relative to (predicted) pre-merger prices that a
Hypothetical Monopolist would impose on the products indexed by ‘prodIndex’, holding the prices of products not
controlled by the Hypothetical Monopolist fixed at pre-merger levels. With the exception of ‘AIDS’, the
calcPriceDeltaHypoMon for all the classes listed above calls calcPricesHypoMon to compute price
levels. calcPriceDeltaHypoMon is in turn called by HypoMonTest.
diversionHypoMon calculates the matrix of revenue diversions between all products included in the merger simulation,
irrespective of whether or not they are also included in
‘prodIndex’. This matrix is useful for diagnosing whether or not a
product not included in ‘prodIndex’ may have a higher revenue diversion
either to or from a product included in ‘prodIndex’. Note that the ‘AIDS’
diversionHypoMon method does not contain the ‘prodIndex’
argument, as AIDS revenue diversions are only a function of demand parameters.
HypoMonTest returns TRUE if a profit-maximizing Hypothetical Monopolist who controls the products indexed by
‘prodIndex’ would increase the price of at least one of the merging
parties' products in ‘prodIndex’ by a ‘ssnip’, and
FALSE otherwise. HypoMonTest returns an error if ‘prodIndex’
does not contain at least one of the merging parties products.
calcPriceDeltaHypoMon returns a vector of proportional price changes for
all products placed under the control of the Hypothetical
Monopolist (i.e. all products indexed by ‘prodIndex’).
calcPricesHypoMon is identical, but for price levels.
diversionHypoMon returns a k x k matrix of diversions,
where element i,j is the diversion from product i to product j.
U.S. Department of Justice and Federal Trade Commission, Horizontal Merger Guidelines. Washington DC: U.S. Department of Justice, 2010. https://www.justice.gov/atr/horizontal-merger-guidelines-08192010 (accessed May 5, 2021).
Computes the percentage difference between predicted and observed pre-merger prices, shares, margins and market elasticities (if supplied) . ‘labels’ is used to specify row labels.
## S4 method for signature 'Bertrand' calcDiagnostics(object, labels = object@labels) ## S4 method for signature 'Cournot' calcDiagnostics(object) ## S4 method for signature 'MonComLogit' calcDiagnostics(object, labels = object@labels) ## S4 method for signature 'MonComCES' calcDiagnostics(object, labels = object@labels) ## S4 method for signature 'AntitrustFit' calcDiagnostics(object, ...)## S4 method for signature 'Bertrand' calcDiagnostics(object, labels = object@labels) ## S4 method for signature 'Cournot' calcDiagnostics(object) ## S4 method for signature 'MonComLogit' calcDiagnostics(object, labels = object@labels) ## S4 method for signature 'MonComCES' calcDiagnostics(object, labels = object@labels) ## S4 method for signature 'AntitrustFit' calcDiagnostics(object, ...)
object |
An instance of one of the classes listed above. |
labels |
A length-k vector of product labels. Default is object@labels. |
... |
Passed to the underlying model's |
Calculate the diversion matrix between any two products in the market.
## S4 method for signature 'Bertrand' diversion(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'AIDS' diversion(object, preMerger = TRUE, revenue = TRUE)## S4 method for signature 'Bertrand' diversion(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'AIDS' diversion(object, preMerger = TRUE, revenue = TRUE)
object |
An instance of one of the classes listed above. |
preMerger |
If TRUE, calculates pre-merger price elasticities. If FALSE, calculates post-merger price elasticities. Default is TRUE. |
revenue |
If TRUE, calculates revenue diversion. If FALSE, calculates quantity diversion. Default is TRUE for ‘Bertrand’ and FALSE for ‘AIDS’. |
For Bertrand, when ‘revenue’ is FALSE (the default),
this method uses the results from the merger calibration and
simulation to compute the quantity diversion matrix between any two products
in the market. Element i,j of this matrix is the quantity diversion from
product i to product j, or the
proportion of product i's sales that leave (go to) i for (from) j due
to a increase (decrease) in i's price. Mathematically, quantity diversion is
,
where is the cross-price elasticity from i to j.
When ‘revenue’ is TRUE, this method computes the revenue diversion
matrix between any two products in the market. Element i,j of this matrix is the revenue diversion from
product i to product j, or the
proportion of product i's revenues that leave (go to) i for (from) j due
to a increase (decrease) in i's price. Mathematically, revenue diversion is
where is the revenue share of product i.
When ‘preMerger’ is TRUE, diversions are calculated at pre-merger equilibrium prices, and when ‘preMerger’ is FALSE, they are calculated at post-merger equilibrium prices.
For AIDS, when ‘revenue’ is TRUE (the default),
this method computes the revenue diversion matrix between any two
products in the market. For AIDS, the revenue diversion from i to j is
, where is the
percentage change in product i's revenue due to a change in j's price.
When ‘revenue’ is FALSE, this callNextMethod is invoked. Will
yield a matrix of NAs if the user did not supply prices.
When ‘preMerger’ is TRUE, diversions are calculated at pre-merger equilibrium prices, and when ‘preMerger’ is FALSE, they are calculated at post-merger equilibrium prices.
returns a k x k matrix of diversion ratios, where the i,jth element is the diversion from i to j.
Calculate the own and cross-price elasticity between any two products in the market.
## S4 method for signature 'Cournot' elast(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'Linear' elast(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'Logit' elast(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'LogitBLP' elast(object, preMerger = TRUE, market = FALSE, partial = FALSE) ## S4 method for signature 'LogLin' elast(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'AIDS' elast(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'LogitNests' elast(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'CES' elast(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'CESNests' elast(object, preMerger = TRUE, market = FALSE)## S4 method for signature 'Cournot' elast(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'Linear' elast(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'Logit' elast(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'LogitBLP' elast(object, preMerger = TRUE, market = FALSE, partial = FALSE) ## S4 method for signature 'LogLin' elast(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'AIDS' elast(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'LogitNests' elast(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'CES' elast(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'CESNests' elast(object, preMerger = TRUE, market = FALSE)
object |
An instance of one of the classes listed above. |
preMerger |
If TRUE, calculates pre-merger price elasticities. If FALSE, calculates post-merger price elasticities. Default is TRUE. |
market |
If TRUE, calculates the market (aggregate) elasticity. If FALSE, calculates matrix of own- and cross-price elasticities. Default is FALSE. |
partial |
if TRUE returns the partial derivative rather than the elasticity. Default is FALSE |
When ‘market’ is FALSE, this method computes the matrix of own and cross-price elasticities. Element i,j of this matrix is the percentage change in the demand for good i from a small change in the price of good j. When ‘market’ is TRUE, this method computes the market (aggregate) elasticities using share-weighted prices.
When ‘preMerger’ is TRUE, elasticities are calculated at pre-merger equilibrium prices and shares, and when ‘preMerger’ is FALSE, they are calculated at post-merger equilibrium prices and shares.
returns a k x k matrix of own- and cross-price elasticities, where k is the number of products in the market.
Define a new single-product entrant firm
entrant(label, meanval, cost, priceStart, ...)entrant(label, meanval, cost, priceStart, ...)
label |
A unique product label for the entrant. |
meanval |
The entrant's mean valuation. |
cost |
The entrant's constant marginal cost. |
priceStart |
A starting price for the entrant. |
... |
Reserved for model-specific primitives; currently unused. |
An 'Entrant' object.
'Entrant' describes a new single-product firm that may be added to a calibrated Logit- or CES-family market via the 'entry' counterfactual field. Market-level structural parameters (e.g. the demand price coefficient) are inherited from the current model; only product-level primitives are supplied here.
## S4 method for signature 'Entrant' show(object)## S4 method for signature 'Entrant' show(object)
object |
An 'Entrant' object. |
labelA unique product label for the entrant.
meanvalThe entrant's mean valuation, on the same scale as the fitted model's calibrated 'meanval' values.
costThe entrant's constant marginal cost.
priceStartA starting price used to initialize the equilibrium solver and to compute the entrant's implied share.
extrasReserved for model-specific primitives not yet supported.
Observed mode draws shares, ownership, positive marginal costs, and one proportional reference-product margin. It leaves prices unsolved. Primitives mode retains its price design. This layer does not infer demand or conduct primitives. The active reference product is an additional one-product firm and participates in the ownership matrix; its mean utility is normalized by the economic realization adapter.
fake_market( mode = "observed", n_firms = 3L, n_products = 1L, dirichlet_alpha = NULL, outside_beta = c(2, 8), shares = NULL, costs = NULL, cost_rule = c("common", "uniform"), cost_level = 80, cost_range = c(50, 100), reference_margin = NULL, margin_range = c(0.05, 0.5), passive_outside_share = 0, passive_outside_range = c(0.1, 0.5), prices = NULL, reference_price = NULL, price_rule = c("common", "uniform"), price_level = 100, price_range = c(50, 150), outside_margin = NULL, observed_markup = NULL, reference_markup = NULL, markup_range = c(0, 100), parameters = list(), alpha = NULL, seed = NULL )fake_market( mode = "observed", n_firms = 3L, n_products = 1L, dirichlet_alpha = NULL, outside_beta = c(2, 8), shares = NULL, costs = NULL, cost_rule = c("common", "uniform"), cost_level = 80, cost_range = c(50, 100), reference_margin = NULL, margin_range = c(0.05, 0.5), passive_outside_share = 0, passive_outside_range = c(0.1, 0.5), prices = NULL, reference_price = NULL, price_rule = c("common", "uniform"), price_level = 100, price_range = c(50, 150), outside_margin = NULL, observed_markup = NULL, reference_markup = NULL, markup_range = c(0, 100), parameters = list(), alpha = NULL, seed = NULL )
mode |
Either '"observed"' or '"primitives"'. |
n_firms |
Number of inside firms; the reference firm is additional. |
n_products |
Number of products owned by each inside firm. A scalar is recycled across firms; a vector must have length 'n_firms'. |
dirichlet_alpha |
A positive finite vector with one element for each inside product. If omitted, all product-level Dirichlet shapes equal one. |
outside_beta |
A positive finite length-two vector of Beta shapes. |
shares |
Optional positive all-product shares summing to one. |
costs |
Optional complete, positive marginal-cost vector in observed mode. |
cost_rule |
'"common"' or '"uniform"' cost design in observed mode. |
cost_level |
Positive common cost; the default is 80 price units. |
cost_range |
Positive endpoints for uniform heterogeneous costs. |
reference_margin |
Observed proportional margin '(p-c)/p' for the active reference product; if omitted, drawn within 'margin_range'. |
margin_range |
Open interval used to draw the reference margin. |
passive_outside_share |
Additional passive outside-option share in observed mode. Product shares remain conditional on choosing an active product and sum to one; unconditional shares equal their product with '1-passive_outside_share'. The default zero preserves standard models. Use 'NULL' to draw from 'passive_outside_range' for ALM designs. |
passive_outside_range |
Uniform draw range for a requested passive outside share, default 0.1 to 0.5. |
prices |
Optional positive prices for inside products or all products in primitives mode. |
reference_price |
Price appended when only inside prices are supplied. |
price_rule |
Either '"common"' or '"uniform"' when prices are not supplied. |
price_level |
Common positive price and default reference price. |
price_range |
Two positive endpoints for the uniform price rule. |
outside_margin |
Retired price-first observed-mode argument. |
observed_markup |
Retired price-first observed-mode argument. |
reference_markup |
Retired price-first observed-mode argument. |
markup_range |
Retired price-first observed-mode argument. |
parameters |
A list of model-specific known primitives in primitives mode, such as 'list(alpha = -1)'. |
alpha |
Optional shorthand for 'parameters$alpha'. |
seed |
An optional explicit integer seed. |
'n_products' may be a scalar, in which case all inside firms have the same number of products, or a vector of length 'n_firms', in which case it gives each firm's product count. Shares are drawn at the product level, so 'dirichlet_alpha' has one element for each inside product.
A 'SyntheticMarket' object.
The final solved legacy S4 result of a CounterfactualPath
final_result(path) ## S4 method for signature 'CounterfactualPath' final_result(path)final_result(path) ## S4 method for signature 'CounterfactualPath' final_result(path)
path |
A 'CounterfactualPath' object. |
The legacy S4 result after the last step.
Calculate the Herfindahl-Hirschman Index with arbitrary ownership and control.
Let k denote the number of products produced by the merging parties below.
HHI(shares, owner = diag(length(shares)), control)HHI(shares, owner = diag(length(shares)), control)
shares |
A length-k vector of product quantity shares. |
owner |
EITHER a vector of length k whose values indicate which of the merging parties produced a product OR a k x k matrix of ownership shares. Default is a diagonal matrix, which assumes that each product is owned by a separate firm. |
control |
EITHER a vector of length k whose values indicate which of the merging parties have the ability to make pricing or output decisions OR a k x k matrix of control shares. Default is a k x k matrix equal to 1 if ‘owner’ > 0 and 0 otherwise. |
All ‘shares’ must be between 0 and 1. When ‘owner’ is a matrix,
the i,jth element of ‘owner’ should equal the percentage of
product j's profits earned by the owner
of product i. When ‘owner’ is a vector, HHI generates a k x k
matrix of whose i,jth element equals 1 if products i and j are
commonly owned and 0 otherwise. ‘control’ works in a fashion similar
to ‘owner’.
HHI returns a number between 0 and 10,000
Charles Taragin [email protected]
Salop, Steven and O'Brien, Daniel (2000) “Competitive Effects of Partial Ownership: Financial Interest and Corporate Control” 67 Antitrust L.J. 559, pp. 559-614.
HHI-Methods for computing HHI following merger simulation.
## Consider five products: 1 and 2 belong to Firm A, ## 3 and 4 to Firm B, and 5 to Firm C. ## The pre-merger product market shares are shares = c(.15,.2,.25,.35,.05) owner = c("A","A","B","B","C") nprod = length(shares) HHI(shares,owner) ## Suppose that Firm A acquires a 75\% ownership stake in product 3, and ## Firm B get a 10\% ownership stake in product 1. Assume that neither ## firm cedes control of the product to the other. owner <- diag(nprod) owner[1,2] <- owner[2,1] <- owner[3,4] <- owner[4,3] <- 1 control <- owner owner[1,1] <- owner[2,1] <- .9 owner[3,1] <- owner[4,1] <- .1 owner[1,3] <- owner[2,3] <- .75 owner[3,3] <- owner[4,3] <- .25 HHI(shares,owner,control) ## Suppose now that in addition to the ownership stakes described ## earlier, B receives 30\% of the control of product 1 control[1,1] <- control[2,1] <- .7 control[3,1] <- control[4,1] <- .3 HHI(shares,owner,control)## Consider five products: 1 and 2 belong to Firm A, ## 3 and 4 to Firm B, and 5 to Firm C. ## The pre-merger product market shares are shares = c(.15,.2,.25,.35,.05) owner = c("A","A","B","B","C") nprod = length(shares) HHI(shares,owner) ## Suppose that Firm A acquires a 75\% ownership stake in product 3, and ## Firm B get a 10\% ownership stake in product 1. Assume that neither ## firm cedes control of the product to the other. owner <- diag(nprod) owner[1,2] <- owner[2,1] <- owner[3,4] <- owner[4,3] <- 1 control <- owner owner[1,1] <- owner[2,1] <- .9 owner[3,1] <- owner[4,1] <- .1 owner[1,3] <- owner[2,3] <- .75 owner[3,3] <- owner[4,3] <- .25 HHI(shares,owner,control) ## Suppose now that in addition to the ownership stakes described ## earlier, B receives 30\% of the control of product 1 control[1,1] <- control[2,1] <- .7 control[3,1] <- control[4,1] <- .3 HHI(shares,owner,control)
Computes the Herfindahl-Hirschman Index (HHI) using simulated market shares and either pre- or post-merger ownership information. Outside shares are excluded from the calculation.
## S4 method for signature 'Bertrand' hhi(object, preMerger = TRUE, revenue = FALSE, insideonly = TRUE) ## S4 method for signature 'Cournot' hhi(object, preMerger = TRUE, revenue = FALSE)## S4 method for signature 'Bertrand' hhi(object, preMerger = TRUE, revenue = FALSE, insideonly = TRUE) ## S4 method for signature 'Cournot' hhi(object, preMerger = TRUE, revenue = FALSE)
object |
An instance of one of the classes listed above. |
preMerger |
If TRUE, returns pre-merger outcome. If FALSE, returns post-merger outcome. Default is TRUE. |
revenue |
If TRUE, returns revenues. If FALSE, returns quantities. Default is TRUE. |
insideonly |
If TRUE, excludes the share of the outside good from the calculation. Default is TRUE. |
'initialize_baseline_state()' records which baseline lifecycle was used by a parameterized constructor. The default '"solve"' path retains the legacy constructor behavior. The '"observed"' path is an opt-in for parameterized flat Logit/CES models whose observed prices and structural cost state are already supplied; its implementation must validate and bind those stored values without running a nonlinear baseline solve.
initialize_baseline_state(object, baseline = c("solve", "observed")) ## S4 method for signature 'StructuralFit' initialize_baseline_state(object, baseline = c("solve", "observed")) ## S4 method for signature 'AntitrustFit' initialize_baseline_state(object, baseline = c("solve", "observed"))initialize_baseline_state(object, baseline = c("solve", "observed")) ## S4 method for signature 'StructuralFit' initialize_baseline_state(object, baseline = c("solve", "observed")) ## S4 method for signature 'AntitrustFit' initialize_baseline_state(object, baseline = c("solve", "observed"))
object |
A fitted 'StructuralFit' object. |
baseline |
Either '"solve"' or '"observed"'. |
Concrete packages may define methods for their 'StructuralFit' subclasses when the model has additional policy state, such as trade tariffs.
The fitted object with baseline lifecycle diagnostics updated.
Initialize persistent structural cost state
initialize_cost_state(object)initialize_cost_state(object)
object |
A fitted structural model. |
The model with its structural cost state initialized.
Calibrates consumer demand using either a linear or log-linear demand system and then simulates the prices effect of a merger between two firms under the assumption that all firms in the market are playing a differentiated products Bertrand game.
Let k denote the number of products produced by all firms.
linear( prices, quantities, margins, diversions, symmetry = TRUE, ownerPre, ownerPost, mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceStart = prices, control.slopes, labels = paste("Prod", 1:length(prices), sep = ""), ... ) loglinear( prices, quantities, margins, diversions, ownerPre, ownerPost, mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceStart = prices, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... )linear( prices, quantities, margins, diversions, symmetry = TRUE, ownerPre, ownerPost, mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceStart = prices, control.slopes, labels = paste("Prod", 1:length(prices), sep = ""), ... ) loglinear( prices, quantities, margins, diversions, ownerPre, ownerPost, mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceStart = prices, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... )
prices |
A length k vector product prices. |
quantities |
A length k vector of product quantities. |
margins |
A length k vector of product margins. All margins must be either be between 0 and 1, or NA. |
diversions |
A k x k matrix of diversion ratios with diagonal elements equal to -1. Default is missing, in which case diversion according to quantity share is assumed. |
symmetry |
If TRUE, requires the matrix of demand slope coefficients to be symmetric and homogeneous of degree 0 in prices, both of which suffice to make demand consistent with utility maximization theory. Default is TRUE. |
ownerPre |
EITHER a vector of length k whose values indicate which firm produced a product pre-merger OR a k x k matrix of pre-merger ownership shares. |
ownerPost |
EITHER a vector of length k whose values indicate which firm produced a product after the merger OR a k x k matrix of post-merger ownership shares. |
mcDelta |
A length k vector where each element equals the proportional change in a product's marginal costs due to the merger. Default is 0, which assumes that the merger does not affect any products' marginal cost. |
subset |
A vector of length k where each element equals TRUE if the product indexed by that element should be included in the post-merger simulation and FALSE if it should be excluded.Default is a length k vector of TRUE. |
priceStart |
A length k vector of prices used as the initial guess in the nonlinear equation solver. Default is ‘prices’. |
control.slopes |
A list of |
labels |
A k-length vector of labels. Default is "Prod#", where ‘#’ is a number between 1 and the length of ‘prices’. |
... |
Additional options to feed to the optimizer used to solve for equilibrium prices. |
control.equ |
A list of |
Using price, quantity, and diversion information for all products
in a market, as well as margin information for (at least) all the
products of any firm, linear is able to
recover the slopes and intercepts in a Linear demand
system and then uses these demand parameters to simulate the price
effects of a merger between
two firms under the assumption that the firms are playing a
differentiated Bertrand pricing game.
loglinear uses the same information as linear to uncover the
slopes and intercepts in a Log-Linear demand system, and then uses these
demand parameters to simulate the price effects of a merger of two firms under the
assumption that the firms are playing a
differentiated Bertrand pricing game.
‘diversions’ must be a square matrix whose off-diagonal elements [i,j] estimate the diversion ratio from product i to product j (i.e. the estimated fraction of i's sales that go to j due to a small increase in i's price). Off-diagonal elements are restricted to be non-negative (products are assumed to be substitutes), diagonal elements must equal -1, and rows must sum to 0 (negative if you wish to include an outside good) . If ‘diversions’ is missing, then diversion according to quantity share is assumed.
‘ownerPre’ and ‘ownerPost’ values will typically be equal to either 0 (element [i,j] is not commonly owned) or 1 (element [i,j] is commonly owned), though these matrices may take on any value between 0 and 1 to account for partial ownership.
Under linear demand, an analytic solution to the Bertrand pricing game
exists. However, this solution can at times produce negative
equilibrium quantities. To accommodate this issue, linear
uses constrOptim to
find equilibrium prices with non-negative quantities. ... may
be used to change the default options for constrOptim.
loglinear uses the non-linear equation solver
BBsolve to find equilibrium prices. ... may
be used to change the default options for BBsolve.
linear returns an instance of class Linear.
loglinear returns an instance of LogLin, a
child class of Linear.
Charles Taragin [email protected]
von Haefen, Roger (2002). “A Complete Characterization Of The Linear, Log-Linear, And Semi-Log Incomplete Demand System Models.” Journal of Agricultural and Resource Economics, 27(02). doi:10.22004/ag.econ.31118.
aids for a demand system based on revenue shares rather than quantities.
## Direct Linear constructor (compatibility/convenience interface). result <- linear(c(2.9, 3.4, 2.2), c(650, 998, 1801), c(.435, .417, .370), ownerPre = c("A", "B", "C"), ownerPost = c("A", "A", "C")) result@pricePost## Direct Linear constructor (compatibility/convenience interface). result <- linear(c(2.9, 3.4, 2.2), c(650, 998, 1801), c(.435, .417, .370), ownerPre = c("A", "B", "C"), ownerPost = c("A", "A", "C")) result@pricePost
Compatibility and convenience constructors that calibrate consumer demand using (Nested) Logit and then simulates the price effect of a merger between two firms under the assumption that all firms in the market are playing a either a differentiated products Bertrand pricing game or a differentiated products Cournot quantity game (logit.cournot).
Let k denote the number of products produced by all firms playing the game below.
logit( prices, shares, margins, diversions, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, priceOutside = 0, priceStart = prices, isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), solver = c("nleqslv", "ag"), ... ) logit.cournot( prices, shares, margins, diversions, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, priceOutside = 0, priceStart = prices, isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) logit.cournot.alm( prices, shares, margins, ownerPre, ownerPost, mktElast = NA_real_, insideSize = NA_real_, output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 0, priceStart = prices, isMax = FALSE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) logit.nests( prices, shares, margins, diversions, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), nests = rep(1, length(shares)), normIndex = ifelse(sum(shares) < 1, NA, 1), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 0, priceStart = prices, isMax = FALSE, constraint = TRUE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) logit.nests.alm( prices, shares, margins, ownerPre, ownerPost, nests = rep(1, length(shares)), output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 0, priceStart = prices, isMax = FALSE, constraint = TRUE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) logit.cap( prices, shares, margins, ownerPre, ownerPost, capacitiesPre = rep(Inf, length(prices)), capacitiesPost = capacitiesPre, insideSize, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(sum(shares) < 1, NA, 1), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 0, priceStart = prices, isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) logit.alm( prices, shares, margins, ownerPre, ownerPost, mktElast = NA_real_, insideSize = NA_real_, output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 0, priceStart = prices, isMax = FALSE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) logit.cap.alm( prices, shares, margins, ownerPre, ownerPost, capacitiesPre = rep(Inf, length(prices)), capacitiesPost = capacitiesPre, mktElast = NA_real_, insideSize, output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 0, priceStart = prices, isMax = FALSE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... )logit( prices, shares, margins, diversions, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, priceOutside = 0, priceStart = prices, isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), solver = c("nleqslv", "ag"), ... ) logit.cournot( prices, shares, margins, diversions, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, priceOutside = 0, priceStart = prices, isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) logit.cournot.alm( prices, shares, margins, ownerPre, ownerPost, mktElast = NA_real_, insideSize = NA_real_, output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 0, priceStart = prices, isMax = FALSE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) logit.nests( prices, shares, margins, diversions, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), nests = rep(1, length(shares)), normIndex = ifelse(sum(shares) < 1, NA, 1), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 0, priceStart = prices, isMax = FALSE, constraint = TRUE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) logit.nests.alm( prices, shares, margins, ownerPre, ownerPost, nests = rep(1, length(shares)), output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 0, priceStart = prices, isMax = FALSE, constraint = TRUE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) logit.cap( prices, shares, margins, ownerPre, ownerPost, capacitiesPre = rep(Inf, length(prices)), capacitiesPost = capacitiesPre, insideSize, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(sum(shares) < 1, NA, 1), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 0, priceStart = prices, isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) logit.alm( prices, shares, margins, ownerPre, ownerPost, mktElast = NA_real_, insideSize = NA_real_, output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 0, priceStart = prices, isMax = FALSE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) logit.cap.alm( prices, shares, margins, ownerPre, ownerPost, capacitiesPre = rep(Inf, length(prices)), capacitiesPost = capacitiesPre, mktElast = NA_real_, insideSize, output = TRUE, weights = rep(1, length(shares)), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), priceOutside = 0, priceStart = prices, isMax = FALSE, parmsStart, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... )
prices |
A length k vector of product prices. |
shares |
A length k vector of product (quantity) shares. Values must be between 0 and 1. |
margins |
A length k vector of product margins, some of which may equal NA. |
diversions |
A k x k matrix of diversion ratios with diagonal elements equal to -1. Default is missing. |
ownerPre |
EITHER a vector of length k whose values indicate which firm produced a product pre-merger OR a k x k matrix of pre-merger ownership shares. |
ownerPost |
EITHER a vector of length k whose values indicate which firm produced a product after the merger OR a k x k matrix of post-merger ownership shares. |
output |
a length 1 logical vector equal to TRUE if merger simulation performed on output market, FALSE if simulation performed on input market. Default TRUE. |
weights |
A length k vector of non-negative product weights used in
minimum-distance calibration. Default is |
normIndex |
An integer equalling the index (position) of the inside product whose mean valuation will be normalized to 0. Default is 1, unless ‘shares’ sum to less than 1, in which case the default is NA and an outside good is assumed to exist. |
mcDelta |
A vector of length k where each element equals the proportional change in a product's marginal costs due to the merger. Default is 0, which assumes that the merger does not affect any products' marginal cost. |
subset |
A vector of length k where each element equals TRUE if the product indexed by that element should be included in the post-merger simulation and FALSE if it should be excluded.Default is a length k vector of TRUE. |
insideSize |
An integer equal to total pre-merger units sold. If shares sum to one, this also equals the size of the market. |
priceOutside |
A length 1 vector indicating the price of the outside good. Default is 0. |
priceStart |
A length k vector of starting values used to solve for equilibrium price. Default is the ‘prices’ vector. |
isMax |
If TRUE, checks to see whether computed price equilibrium locally maximizes firm profits and returns a warning if not. Default is FALSE. |
control.slopes |
A list of |
control.equ |
A list of |
labels |
A k-length vector of labels. Default is "Prod#", where ‘#’ is a number between 1 and the length of ‘prices’. |
solver |
A length-1 character vector specifying the solver algorithm used to calculate pre- and post-merger price equilibria. Options are |
... |
Additional options to feed to the |
mktElast |
a negative value indicating market elasticity. Default is NA. |
parmsStart |
For |
nests |
A length k vector identifying the nest that each product belongs to. |
constraint |
if TRUE, then the nesting parameters for all non-singleton nests are assumed equal. If FALSE, then each non-singleton nest is permitted to have its own value. Default is TRUE. |
capacitiesPre |
A length k vector of pre-merger product capacities. Capacities
must be at least as great as shares * insideSize. A value of |
capacitiesPost |
A length k vector of post-merger product capacities. |
Using product prices, quantity shares and all of the
product margins from at least one firm, logit is able to
recover the price coefficient and product mean valuations in a
Logit demand model. logit then uses these
calibrated parameters to simulate a merger between two firms.
logit.alm is identical to logit except that it assumes
that an outside product exists and uses additional margin
information to estimate the share of the outside good.
If market elasticity is known, it may be supplied using the
‘mktElast’ argument.
logit.nests is identical to logit except that it includes the ‘nests’
argument which may be used to assign products to different
nests. Nests are useful because they allow for richer substitution
patterns between products. Products within the same nest are assumed
to be closer substitutes than products in different nests. The degree
of substitutability between products located in different nests is
controlled by the value of the nesting parameter sigma.
The nesting parameters for singleton nests (nests containing
only one product) are not identified and normalized to 1. The vector of
sigmas is calibrated from the prices, revenue shares, and margins supplied
by the user.
By default, all non-singleton nests are assumed to have a common value for sigma. This constraint may be relaxed by setting ‘constraint’ to FALSE. In this case, at least one product margin must be supplied from a product within each nest.
logit.nests.alm is identical to logit.nests except that it assumes
that an outside product exists and uses additional margin
information to estimate the share of the outside good.
logit.cap is identical to logit except that firms are
playing the Bertrand pricing game under exogenously supplied capacity
constraints. Unlike logit, logit.cap requires users to
specify capacity constraints via ‘capacities’ and the number of
potential customers in a market via ‘mktSize’. ‘mktSize’ is needed to
transform ‘shares’ into quantities that must be directly compared to ‘capacities’.
In logit, logit.nests and logit.cap, if quantity shares sum to 1,
then one product's mean value is not identified and must be normalized
to 0. ‘normIndex’ may be used to specify the index (position) of the
product whose mean value is to be normalized. If the sum of revenue shares
is less than 1, both of these functions assume that the exists a k+1st
product in the market whose price and mean value are both normalized
to 0.
logit returns an instance of class
Logit.
logit.alm returns an instance of LogitALM, a
child class of Logit..
logit.nests returns an instance of LogitNests, a
child class of Logit.
logit.cap returns an instance of LogitCap, a
child class of Logit.
Charles Taragin [email protected]
Anderson, Simon, Palma, Andre, and Francois Thisse (1992). Discrete Choice Theory of Product Differentiation. The MIT Press, Cambridge, Mass.
Epstein, Roy and Rubinfeld, Daniel (2004). “Effects of Mergers Involving Differentiated Products.”
Werden, Gregory and Froeb, Luke (1994). “The Effects of Mergers in Differentiated Products Industries: Structural Merger Policy and the Logit Model”, Journal of Law, Economics, and Organization, 10, pp. 407-426.
Froeb, Luke, Tschantz, Steven and Phillip Crooke (2003). “Bertrand Competition and Capacity Constraints: Mergers Among Parking Lots”, Journal of Econometrics, 113, pp. 49-67.
Froeb, Luke and Werden, Greg (1996). “Computational Economics and Finance: Modeling and Analysis with Mathematica, Volume 2.” In Varian H (ed.), chapter Simulating Mergers among Noncooperative Oligopolists, pp. 177-95. Springer-Verlag, New York.
## Direct constructor retained for compatibility; calibrate() returns a ## reusable AntitrustFit for the structural lifecycle. result <- logit(c(2, 2.2, 2.5), c(.35, .25, .20), c(.40, .35, .30), ownerPre = c("A", "B", "C"), ownerPost = c("A", "A", "C"), insideSize = 100) result@pricePost## Direct constructor retained for compatibility; calibrate() returns a ## reusable AntitrustFit for the structural lifecycle. result <- logit(c(2, 2.2, 2.5), c(.35, .25, .20), c(.40, .35, .30), ownerPre = c("A", "B", "C"), ownerPost = c("A", "A", "C"), insideSize = 100) result@pricePost
Computes equilibrium product margins assuming that firms are playing a Nash-Bertrand, Cournot, 2nd Score Auction, or Bargaining game. For "LogitCap", assumes firms are playing a Nash-Bertrand or Cournot game with capacity constraints.
## S4 method for signature 'Bertrand' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'CES' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'LogitCournot' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'CESCournot' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'Bargaining2ndLogit' calcMargins(object, preMerger = TRUE, exAnte = FALSE, level = TRUE) ## S4 method for signature 'Bargaining2ndCES' calcMargins(object, preMerger = TRUE, exAnte = FALSE, level = FALSE) ## S4 method for signature 'BargainingCES' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'BargainingLogit' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'Auction2ndCap' calcMargins(object, preMerger = TRUE, exAnte = TRUE, level = FALSE) ## S4 method for signature 'Cournot' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'AIDS' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'LogitCap' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'Auction2ndLogit' calcMargins(object, preMerger = TRUE, exAnte = FALSE, level = TRUE) ## S4 method for signature 'Auction2ndCES' calcMargins(object, preMerger = TRUE, exAnte = FALSE, level = FALSE) ## S4 method for signature 'Auction2ndLogitNests' calcMargins(object, preMerger = TRUE, exAnte = FALSE, level = TRUE) ## S4 method for signature 'CournotBLP' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'MonComLogit' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'MonComCES' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'MonComBLP' calcMargins(object, preMerger = TRUE, level = FALSE)## S4 method for signature 'Bertrand' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'CES' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'LogitCournot' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'CESCournot' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'Bargaining2ndLogit' calcMargins(object, preMerger = TRUE, exAnte = FALSE, level = TRUE) ## S4 method for signature 'Bargaining2ndCES' calcMargins(object, preMerger = TRUE, exAnte = FALSE, level = FALSE) ## S4 method for signature 'BargainingCES' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'BargainingLogit' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'Auction2ndCap' calcMargins(object, preMerger = TRUE, exAnte = TRUE, level = FALSE) ## S4 method for signature 'Cournot' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'AIDS' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'LogitCap' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'Auction2ndLogit' calcMargins(object, preMerger = TRUE, exAnte = FALSE, level = TRUE) ## S4 method for signature 'Auction2ndCES' calcMargins(object, preMerger = TRUE, exAnte = FALSE, level = FALSE) ## S4 method for signature 'Auction2ndLogitNests' calcMargins(object, preMerger = TRUE, exAnte = FALSE, level = TRUE) ## S4 method for signature 'CournotBLP' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'MonComLogit' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'MonComCES' calcMargins(object, preMerger = TRUE, level = FALSE) ## S4 method for signature 'MonComBLP' calcMargins(object, preMerger = TRUE, level = FALSE)
object |
An instance of one of the classes listed above. |
preMerger |
If TRUE, returns pre-merger outcome. If FALSE, returns post-merger outcome. Default is TRUE. |
level |
IF TRUE, return margins in dollars. If FALSE, returns margins in proportions. Default for most classes is FALSE. |
exAnte |
If ‘exAnte’ equals TRUE then the ex ante expected result for each firm is produced, while FALSE produces the expected result conditional on each firm winning the auction. Default is FALSE. |
Computes equilibrium product margins and prices using the aggregative games technique described in Nocke and Schutz (2018). Assumes that firms are playing a Nash-Bertrand pricing game with either Logit or CES demand; bargaining and second-score wrappers reuse the corresponding model-specific first-order conditions after obtaining an AG-compatible starting point.
## S4 method for signature 'Logit' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'CES' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'Logit' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'CES' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'BargainingLogit' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'BargainingLogit' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'BargainingCES' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'BargainingCES' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'Auction2ndLogit' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'Auction2ndLogit' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'Auction2ndCES' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'Auction2ndCES' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'Bargaining2ndLogit' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'Bargaining2ndLogit' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'Bargaining2ndCES' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'Bargaining2ndCES' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'Cournot' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'Cournot' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset)## S4 method for signature 'Logit' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'CES' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'Logit' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'CES' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'BargainingLogit' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'BargainingLogit' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'BargainingCES' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'BargainingCES' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'Auction2ndLogit' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'Auction2ndLogit' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'Auction2ndCES' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'Auction2ndCES' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'Bargaining2ndLogit' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'Bargaining2ndLogit' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'Bargaining2ndCES' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'Bargaining2ndCES' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset) ## S4 method for signature 'Cournot' calcMarginsAG(object, preMerger = TRUE, level = FALSE, subset) ## S4 method for signature 'Cournot' calcPricesAG(object, preMerger = TRUE, isMax = FALSE, subset)
object |
An instance of one of the classes listed above. |
preMerger |
If TRUE, returns pre-merger outcome. If FALSE, returns post-merger outcome. Default is TRUE. |
level |
IF TRUE, return margins in dollars. If FALSE, returns margins in proportions. Default for most classes is FALSE. |
subset |
A vector whose length equals the number of products where each element equals TRUE if the product indexed by that element should be included in the post-merger simulation and FALSE if it should be excluded. Default is a length k vector of TRUE. |
isMax |
If TRUE, a check is run to determine if the calculated equilibrium price vector locally maximizes profits. Default is FALSE. |
Nocke, V. and Schutz, N. (2018), Multiproduct-Firm Oligopoly: An Aggregative Games Approach. Econometrica, 86: 523-557.doi:10.3982/ECTA14720/
Return synthetic market design metadata
market_design(x)market_design(x)
x |
A 'SyntheticMarket' object. |
The market's design metadata.
Describe a demand/conduct model combination
model_spec(demand, conduct, variant = "standard")model_spec(demand, conduct, variant = "standard")
demand |
A human-readable demand-system name, such as |
conduct |
A human-readable conduct name, such as |
variant |
A model-specific calibration variant. The default is
|
A small object of class antitrust_model_spec containing
normalized model names.
model_spec("logit", "bertrand")model_spec("logit", "bertrand")
Look up a registered structural model transition
model_transition(from, to)model_transition(from, to)
from |
An |
to |
An |
The registered transition record, including its transition kind, required arguments, retained and derived primitives, and recomputation requirements.
'MonComLogit' and 'MonComCES' contain the existing Logit and CES demand state under a differentiated-product monopolistic-competition conduct assumption. Each product chooses its own price and does not internalize strategic cross-product effects. For 'MonComCES', the aggregate CES index is held fixed in the perceived own-product derivative, so the own elasticity used by the conduct FOC is '-gamma'; this is distinct from the full share-adjusted elasticity returned by 'elast()'. For 'MonComBLP', the derivative is integrated over the existing consumer draws as 'sum_r w_r * alpha_r * s_jr'.
'MonComLogit' extends 'Logit'; 'MonComCES' extends 'CES'.
Calibrate flat Logit or CES demand under differentiated-product monopolistic competition. Each product uses its own perceived demand derivative and does not internalize cross-product effects. For CES, the aggregate CES index is held fixed, so the perceived own elasticity is '-gamma', rather than the full share-adjusted CES elasticity. The BLP MonCom model is exposed through the general 'calibrate()' and 'specify()' lifecycle using the validated integration engine.
moncom.logit( prices, shares, margins, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, priceOutside = 0, priceStart = prices, isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) moncom.ces( prices, shares, margins, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, priceOutside = 1, priceStart = prices, isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... )moncom.logit( prices, shares, margins, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, priceOutside = 0, priceStart = prices, isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... ) moncom.ces( prices, shares, margins, ownerPre, ownerPost, output = TRUE, weights = rep(1, length(shares)), normIndex = ifelse(isTRUE(all.equal(sum(shares), 1, check.names = FALSE)), 1, NA), mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = NA_real_, priceOutside = 1, priceStart = prices, isMax = FALSE, control.slopes, control.equ, labels = paste("Prod", 1:length(prices), sep = ""), ... )
prices |
A length-k vector of observed product prices. |
shares |
A length-k vector of quantity shares for Logit or revenue shares for CES. |
margins |
A length-k vector of observed positive margins. At least one margin is required; additional margins are used as precision weights. |
ownerPre |
Pre-merger ownership vector or matrix. It is retained as model metadata but does not enter the MonCom FOC. |
ownerPost |
Post-merger ownership vector or matrix. |
output |
'TRUE' for an output market and 'FALSE' for an input market. |
weights |
A length-k vector of non-negative product weights used in calibration. |
normIndex |
Normalization product when inside shares exhaust the market. |
mcDelta |
A vector of proportional marginal-cost changes. |
subset |
A logical vector identifying products active in the post- counterfactual market. |
insideSize |
Total inside quantity (Logit) or revenue (CES). |
priceOutside |
Outside-good price when the market has an outside good. |
priceStart |
Starting values for the post-counterfactual price solver. |
isMax |
If 'TRUE', request the legacy local-profit maximum diagnostic. |
control.slopes |
Optional legacy calibration controls. |
control.equ |
Optional legacy equilibrium-solver controls. |
labels |
Product labels. |
... |
Additional legacy model options. |
A 'MonComLogit' or 'MonComCES' object.
This section contains three types of methods: calcShares, calcQuantities, and calcRevenues. calcShares computes equilibrium product shares assuming that firms are playing a Nash-Bertrand or Cournot game. ‘revenue’ takes on a value of TRUE or FALSE, where TRUE calculates revenue shares, while FALSE calculates quantity shares.
calcQuantities computes equilibrium product quantities assuming that firms are playing a Nash-Bertrand, 2nd Score Auction, or Cournot game. Setting ‘market’ to TRUE returns total market quantity.
calcRevenues computes equilibrium product revenues assuming that firms are playing a Nash-Bertrand, 2nd Score Auction, or Cournot game. Setting ‘market’ to TRUE returns total market revenue.
## S4 method for signature 'Cournot' calcQuantities(object, preMerger = TRUE, market = FALSE, ...) ## S4 method for signature 'Stackelberg' calcQuantities(object, preMerger = TRUE, market = FALSE, ...) ## S4 method for signature 'Linear' calcQuantities(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'Logit' calcQuantities(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'LogLin' calcQuantities(object, preMerger = TRUE, market = FALSE, ...) ## S4 method for signature 'AIDS' calcQuantities(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'CES' calcQuantities(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'Bertrand' calcRevenues(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'Cournot' calcRevenues(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'AIDS' calcQuantities(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'CES' calcRevenues(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'Auction2ndCap' calcShares(object, preMerger = TRUE, exAnte = TRUE, revenue = FALSE) ## S4 method for signature 'Cournot' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'Linear' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'Logit' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'LogitBLP' calcShares(object, preMerger = TRUE, revenue = FALSE, aggregate = TRUE) ## S4 method for signature 'AIDS' calcShares(object, preMerger = TRUE, revenue = TRUE) ## S4 method for signature 'LogitNests' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'Auction2ndLogit' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'Auction2ndLogitNests' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'CES' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'Auction2ndCES' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'CESNests' calcShares(object, preMerger = TRUE, revenue = FALSE)## S4 method for signature 'Cournot' calcQuantities(object, preMerger = TRUE, market = FALSE, ...) ## S4 method for signature 'Stackelberg' calcQuantities(object, preMerger = TRUE, market = FALSE, ...) ## S4 method for signature 'Linear' calcQuantities(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'Logit' calcQuantities(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'LogLin' calcQuantities(object, preMerger = TRUE, market = FALSE, ...) ## S4 method for signature 'AIDS' calcQuantities(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'CES' calcQuantities(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'Bertrand' calcRevenues(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'Cournot' calcRevenues(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'AIDS' calcQuantities(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'CES' calcRevenues(object, preMerger = TRUE, market = FALSE) ## S4 method for signature 'Auction2ndCap' calcShares(object, preMerger = TRUE, exAnte = TRUE, revenue = FALSE) ## S4 method for signature 'Cournot' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'Linear' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'Logit' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'LogitBLP' calcShares(object, preMerger = TRUE, revenue = FALSE, aggregate = TRUE) ## S4 method for signature 'AIDS' calcShares(object, preMerger = TRUE, revenue = TRUE) ## S4 method for signature 'LogitNests' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'Auction2ndLogit' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'Auction2ndLogitNests' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'CES' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'Auction2ndCES' calcShares(object, preMerger = TRUE, revenue = FALSE) ## S4 method for signature 'CESNests' calcShares(object, preMerger = TRUE, revenue = FALSE)
object |
An instance of one of the classes listed above. |
preMerger |
If TRUE, returns pre-merger outcome. If FALSE, returns post-merger outcome. Default is TRUE. |
market |
If TRUE, reports market-level summary. Otherwise reports product/plant level summary. Default is FALSE. |
... |
Additional arguments to pass to |
exAnte |
If ‘exAnte’ equals TRUE then the ex ante expected result for each firm is produced, while FALSE produces the expected result conditional on each firm winning the auction. Default is FALSE. |
revenue |
If TRUE, returns revenues. If FALSE, returns quantities. Default is TRUE. |
aggregate |
If TRUE (default), returns the average product shares across all simulated draws.
If FALSE, returns a matrix of individual shares for each draw (products in rows, draws in columns).
Only used for objects of class |
ownerToMatrix converts an ownership vector (or factor) to a k x k matrix of
1s and 0s.
ownerToVec converts a k x k ownership matrix to a length-k
vector whose values identify an owner.
## S4 method for signature 'Antitrust' ownerToMatrix(object, preMerger = TRUE) ## S4 method for signature 'Antitrust' ownerToVec(object, preMerger = TRUE)## S4 method for signature 'Antitrust' ownerToMatrix(object, preMerger = TRUE) ## S4 method for signature 'Antitrust' ownerToVec(object, preMerger = TRUE)
object |
An instance of the Antitrust class. |
preMerger |
The ‘preMerger’ takes on a value of TRUE or FALSE, where TRUE invokes the method using the pre-merger values, while FALSE invokes the method using the post-merger ownership structure. |
Charles Taragin [email protected]
showMethods(classes="Antitrust") # show all methods defined for the classshowMethods(classes="Antitrust") # show all methods defined for the class
The calcSlopes methods calculate demand parameters assuming that firms are playing a differentitated product Nash-Bertrand pricing game or (as in the case of the Cournot and Stackelberg classes), a Cournot game.
getNestsParms returns a matrix containing the calibrated nesting parameters.
getParms returns a list of model-specific demand parameters. ‘digits’ specifies the number of significant digit to return (default 10).
## S4 method for signature 'Cournot' calcSlopes(object) ## S4 method for signature 'Stackelberg' calcSlopes(object) ## S4 method for signature 'Linear' calcSlopes(object) ## S4 method for signature 'Logit' calcSlopes(object) ## S4 method for signature 'LogitBLP' calcSlopes(object) ## S4 method for signature 'LogitCournot' calcSlopes(object) ## S4 method for signature 'LogLin' calcSlopes(object) ## S4 method for signature 'AIDS' calcSlopes(object) ## S4 method for signature 'PCAIDS' calcSlopes(object) ## S4 method for signature 'PCAIDSNests' calcSlopes(object) ## S4 method for signature 'LogitCap' calcSlopes(object) ## S4 method for signature 'LogitNests' calcSlopes(object) ## S4 method for signature 'Auction2ndLogitNests' calcSlopes(object) ## S4 method for signature 'LogitCapALM' calcSlopes(object) ## S4 method for signature 'LogitNestsALM' calcSlopes(object) ## S4 method for signature 'Auction2ndLogit' calcSlopes(object) ## S4 method for signature 'Auction2ndLogitALM' calcSlopes(object) ## S4 method for signature 'LogitALM' calcSlopes(object) ## S4 method for signature 'CES' calcSlopes(object) ## S4 method for signature 'BargainingCES' calcSlopes(object) ## S4 method for signature 'CESALM' calcSlopes(object) ## S4 method for signature 'BargainingCESALM' calcSlopes(object) ## S4 method for signature 'CESNests' calcSlopes(object) ## S4 method for signature 'BargainingLogit' calcSlopes(object) ## S4 method for signature 'Bargaining2ndLogit' calcSlopes(object) ## S4 method for signature 'BargainingLogitALM' calcSlopes(object) ## S4 method for signature 'Bertrand' getParms(object, digits = 10) ## S4 method for signature 'PCAIDSNests' getNestsParms(object) ## S4 method for signature 'LogitNests' getNestsParms(object) ## S4 method for signature 'Auction2ndLogitNests' getNestsParms(object) ## S4 method for signature 'CESNests' getNestsParms(object) ## S4 method for signature 'LogitCournotALM' calcSlopes(object) ## S4 method for signature 'CESCournot' calcSlopes(object) ## S4 method for signature 'CESCournotALM' calcSlopes(object) ## S4 method for signature 'Auction2ndCES' calcSlopes(object) ## S4 method for signature 'Bargaining2ndCES' calcSlopes(object) ## S4 method for signature 'Auction2ndCESALM' calcSlopes(object) ## S4 method for signature 'MonComLogit' calcSlopes(object) ## S4 method for signature 'MonComCES' calcSlopes(object)## S4 method for signature 'Cournot' calcSlopes(object) ## S4 method for signature 'Stackelberg' calcSlopes(object) ## S4 method for signature 'Linear' calcSlopes(object) ## S4 method for signature 'Logit' calcSlopes(object) ## S4 method for signature 'LogitBLP' calcSlopes(object) ## S4 method for signature 'LogitCournot' calcSlopes(object) ## S4 method for signature 'LogLin' calcSlopes(object) ## S4 method for signature 'AIDS' calcSlopes(object) ## S4 method for signature 'PCAIDS' calcSlopes(object) ## S4 method for signature 'PCAIDSNests' calcSlopes(object) ## S4 method for signature 'LogitCap' calcSlopes(object) ## S4 method for signature 'LogitNests' calcSlopes(object) ## S4 method for signature 'Auction2ndLogitNests' calcSlopes(object) ## S4 method for signature 'LogitCapALM' calcSlopes(object) ## S4 method for signature 'LogitNestsALM' calcSlopes(object) ## S4 method for signature 'Auction2ndLogit' calcSlopes(object) ## S4 method for signature 'Auction2ndLogitALM' calcSlopes(object) ## S4 method for signature 'LogitALM' calcSlopes(object) ## S4 method for signature 'CES' calcSlopes(object) ## S4 method for signature 'BargainingCES' calcSlopes(object) ## S4 method for signature 'CESALM' calcSlopes(object) ## S4 method for signature 'BargainingCESALM' calcSlopes(object) ## S4 method for signature 'CESNests' calcSlopes(object) ## S4 method for signature 'BargainingLogit' calcSlopes(object) ## S4 method for signature 'Bargaining2ndLogit' calcSlopes(object) ## S4 method for signature 'BargainingLogitALM' calcSlopes(object) ## S4 method for signature 'Bertrand' getParms(object, digits = 10) ## S4 method for signature 'PCAIDSNests' getNestsParms(object) ## S4 method for signature 'LogitNests' getNestsParms(object) ## S4 method for signature 'Auction2ndLogitNests' getNestsParms(object) ## S4 method for signature 'CESNests' getNestsParms(object) ## S4 method for signature 'LogitCournotALM' calcSlopes(object) ## S4 method for signature 'CESCournot' calcSlopes(object) ## S4 method for signature 'CESCournotALM' calcSlopes(object) ## S4 method for signature 'Auction2ndCES' calcSlopes(object) ## S4 method for signature 'Bargaining2ndCES' calcSlopes(object) ## S4 method for signature 'Auction2ndCESALM' calcSlopes(object) ## S4 method for signature 'MonComLogit' calcSlopes(object) ## S4 method for signature 'MonComCES' calcSlopes(object)
object |
An instance of the respective class (see description for the classes) |
digits |
Number of significant digits to report. Default is 2. |
Use ggplot to plot pre- and post-merger demand, marginal cost and equilibria.
‘scale’ controls the amount above marginal cost and below equilbrium price that is plotted.
## S4 method for signature 'Bertrand' plot(x, scale = 0.1)## S4 method for signature 'Bertrand' plot(x, scale = 0.1)
x |
Used only in plot method. Should always be set equal to object. |
scale |
The proportion below marginal cost and above equilbrium price that should be plotted. Default is .1. |
For Antitrust, the method computes equilibrium price changes due to a merger assuming that firms are playing a Nash-Bertrand or Cournot game. This is a wrapper method for computing the difference between pre- and post-merger equilbrium prices.
For AIDS, the method computes equilibrium price changes due to a merger assuming that firms are playing a Nash-Bertrand or Cournot game and LA-AIDS. This method calls a non-linear equations solver to find a sequence of price changes that satisfy the Bertrand FOCs.
## S4 method for signature 'Antitrust' calcPriceDelta( object, levels = FALSE, market = FALSE, party = FALSE, isMax = FALSE, index = c("paasche", "laspeyres"), ... ) ## S4 method for signature 'Cournot' calcPriceDelta( object, levels = FALSE, market = FALSE, party = FALSE, isMax = FALSE, index = c("paasche", "laspeyres"), ... ) ## S4 method for signature 'AIDS' calcPriceDelta( object, levels = FALSE, market = FALSE, party = FALSE, isMax = FALSE, index = c("paasche", "laspeyres"), subset, ... ) ## S4 method for signature 'Auction2ndLogit' calcPriceDelta( object, levels = TRUE, market = FALSE, party = FALSE, exAnte = ifelse(market, TRUE, FALSE), ... )## S4 method for signature 'Antitrust' calcPriceDelta( object, levels = FALSE, market = FALSE, party = FALSE, isMax = FALSE, index = c("paasche", "laspeyres"), ... ) ## S4 method for signature 'Cournot' calcPriceDelta( object, levels = FALSE, market = FALSE, party = FALSE, isMax = FALSE, index = c("paasche", "laspeyres"), ... ) ## S4 method for signature 'AIDS' calcPriceDelta( object, levels = FALSE, market = FALSE, party = FALSE, isMax = FALSE, index = c("paasche", "laspeyres"), subset, ... ) ## S4 method for signature 'Auction2ndLogit' calcPriceDelta( object, levels = TRUE, market = FALSE, party = FALSE, exAnte = ifelse(market, TRUE, FALSE), ... )
object |
An instance of one of the classes listed above. |
levels |
If TRUE, report results in levels. If FALSE, report results in percents. Default is FALSE. |
market |
If TRUE, calculates (post-merger) share-weighted average of metric. Default is FALSE. |
party |
If TRUE, calculates (post-merger) share-weighted average of metric for merging parties. Default is FALSE. |
isMax |
If TRUE, uses numerical derivatives to determine if equilibrium price vector is a local maximum. Default is FALSE. |
index |
If "paasche",calculates market-wide price changes using post-merger predicted shares. If "laspeyres", calculates price index using pre-merger shares. Default is "paasche". |
... |
Additional values that may be used to change the default values of the non-linear equation solver. |
subset |
A vector of length k where each element equals TRUE if the product indexed by that element should be included in the post-merger simulation and FALSE if it should be excluded.Default is a length k vector of TRUE. |
exAnte |
If ‘exAnte’ equals TRUE then the ex ante expected result for each firm is produced, while FALSE produces the expected result conditional on each firm winning the auction. Default is FALSE, unless ‘market’ is TRUE. |
For Auction2ndCap, the calcPrices method computes the expected price that the buyer pays, conditional on the buyer purchasing from a particular firm.
For Logit, the calcPrices method computes either pre-merger or post-merger equilibrium prices under the assumptions that consumer demand is Logit and firms play a differentiated product Bertrand Nash pricing game.
For LogitCap, the calcPrices method computes either pre-merger or post-merger equilibrium shares under the assumptions that consumer demand is Logit and firms play a differentiated product Bertrand Nash pricing game with capacity constraints.
For Logit, the calcPrices method computes either pre-merger or post-merger equilibrium prices under the assumptions that consumer demand is Logit and firms play a differentiated product Bertrand Nash pricing game.
For LogLin, the calcPrices method computes either pre-merger or post-merger equilibrium prices under the assumptions that consumer demand is Log-Linear and firms play a differentiated product Bertrand Nash pricing game.
For AIDS, the calcPrices method computes either pre-merger or post-merger equilibrium prices under the assumptions that consumer demand is AIDS and firms play a differentiated product Bertrand Nash pricing game. It returns a length-k vector of NAs if the user did not supply prices.
## S4 method for signature 'Cournot' calcPrices(object, preMerger = TRUE) ## S4 method for signature 'Auction2ndCap' calcPrices(object, preMerger = TRUE, exAnte = TRUE) ## S4 method for signature 'Logit' calcPrices(object, preMerger = TRUE, isMax = FALSE, subset, ...) ## S4 method for signature 'CESCournot' calcPrices(object, preMerger = TRUE, isMax = FALSE, subset, ...) ## S4 method for signature 'Auction2ndLogit' calcPrices(object, preMerger = TRUE, exAnte = FALSE) ## S4 method for signature 'Auction2ndCES' calcPrices(object, preMerger = TRUE, exAnte = FALSE) ## S4 method for signature 'LogitCap' calcPrices(object, preMerger = TRUE, isMax = FALSE, subset, ...) ## S4 method for signature 'Linear' calcPrices(object, preMerger = TRUE, subset, ...) ## S4 method for signature 'LogLin' calcPrices(object, preMerger = TRUE, subset, ...) ## S4 method for signature 'AIDS' calcPrices(object, preMerger = TRUE, ...) ## S4 method for signature 'BargainingLogit' calcPrices(object, preMerger = TRUE, isMax = FALSE, subset, ...) ## S4 method for signature 'LogitBLP' calcPrices(object, preMerger = TRUE, isMax = FALSE, ...) ## S4 method for signature 'MonComLogit' calcPrices(object, preMerger = TRUE, ...) ## S4 method for signature 'MonComCES' calcPrices(object, preMerger = TRUE, ...)## S4 method for signature 'Cournot' calcPrices(object, preMerger = TRUE) ## S4 method for signature 'Auction2ndCap' calcPrices(object, preMerger = TRUE, exAnte = TRUE) ## S4 method for signature 'Logit' calcPrices(object, preMerger = TRUE, isMax = FALSE, subset, ...) ## S4 method for signature 'CESCournot' calcPrices(object, preMerger = TRUE, isMax = FALSE, subset, ...) ## S4 method for signature 'Auction2ndLogit' calcPrices(object, preMerger = TRUE, exAnte = FALSE) ## S4 method for signature 'Auction2ndCES' calcPrices(object, preMerger = TRUE, exAnte = FALSE) ## S4 method for signature 'LogitCap' calcPrices(object, preMerger = TRUE, isMax = FALSE, subset, ...) ## S4 method for signature 'Linear' calcPrices(object, preMerger = TRUE, subset, ...) ## S4 method for signature 'LogLin' calcPrices(object, preMerger = TRUE, subset, ...) ## S4 method for signature 'AIDS' calcPrices(object, preMerger = TRUE, ...) ## S4 method for signature 'BargainingLogit' calcPrices(object, preMerger = TRUE, isMax = FALSE, subset, ...) ## S4 method for signature 'LogitBLP' calcPrices(object, preMerger = TRUE, isMax = FALSE, ...) ## S4 method for signature 'MonComLogit' calcPrices(object, preMerger = TRUE, ...) ## S4 method for signature 'MonComCES' calcPrices(object, preMerger = TRUE, ...)
object |
An instance of the respective class (see description for the classes) |
preMerger |
If TRUE, the pre-merger ownership structure is used. If FALSE, the post-merger ownership structure is used. Default is TRUE. |
exAnte |
If ‘exAnte’ equals TRUE then the ex ante expected result for each firm is produced, while FALSE produces the expected result conditional on each firm winning the auction. Default is FALSE. |
isMax |
If TRUE, a check is run to determine if the calculated equilibrium price vector locally maximizes profits. Default is FALSE. |
subset |
A vector of length k where each element equals TRUE if the product indexed by that element should be included in the post-merger simulation and FALSE if it should be excluded. Default is a length k vector of TRUE. |
... |
For Logit, additional values that may be used to change the
default values of For others, additional values that may be used to change the default values of |
Print a synthetic market
## S3 method for class 'SyntheticMarket' print(x, ...)## S3 method for class 'SyntheticMarket' print(x, ...)
x |
A 'SyntheticMarket' object. |
... |
Ignored. |
For a calibrated price-random-coefficient BLP fit, evaluate the minimum
margin-distance objective at each supplied value of sigma,
re-optimizing alphaMean. This is an identification diagnostic, not
an econometric standard-error calculation.
profileBLP(fit, sigma_grid)profileBLP(fit, sigma_grid)
fit |
An |
sigma_grid |
A finite, non-negative numeric vector of values at which to profile the objective. |
A data frame with sigma, alphaMean, objective,
and optimizer convergence columns.
In the following methods, calcProducerSurplus computes the expected profits of each supplier
with the game depending on the class. The available classes are: Bertrand, Cournot, and Auction2ndCap.
## S4 method for signature 'Bertrand' calcProducerSurplus(object, preMerger = TRUE) ## S4 method for signature 'Auction2ndCap' calcProducerSurplus(object, preMerger = TRUE, exAnte = TRUE) ## S4 method for signature 'Cournot' calcProducerSurplus(object, preMerger = TRUE)## S4 method for signature 'Bertrand' calcProducerSurplus(object, preMerger = TRUE) ## S4 method for signature 'Auction2ndCap' calcProducerSurplus(object, preMerger = TRUE, exAnte = TRUE) ## S4 method for signature 'Cournot' calcProducerSurplus(object, preMerger = TRUE)
object |
An instance of one of the classes listed above. |
preMerger |
If TRUE, returns pre-merger outcome. If FALSE, returns post-merger outcome. Default is TRUE. |
exAnte |
If ‘exAnte’ equals TRUE then the ex ante expected result for each firm is produced, while FALSE produces the expected result conditional on each firm winning the auction. Default is TRUE. |
The generic is owned by antitrust because synthetic-market realization requires an antitrust model specification. Model-specific methods own all equations, parameter inversion, cost recovery, and equilibrium diagnostics.
realize_market(market, spec, ...)realize_market(market, spec, ...)
market |
A 'SyntheticMarket' object. |
spec |
A model-specific specification or lightweight model descriptor. |
... |
Additional model-specific arguments. |
A model-specific realized market or fit object.
This is the first model-specific synthetic-market adapter. It accepts a 'SyntheticMarket' from antitrust and uses the full product-level ownership-adjusted Logit Bertrand FOCs. The active reference product is included in the system and only its mean utility is normalized to zero.
## S3 method for class 'SyntheticMarket' realize_market( market, spec, alpha = NULL, allow_negative_costs = FALSE, foc_tolerance = 1e-08, ... )## S3 method for class 'SyntheticMarket' realize_market( market, spec, alpha = NULL, allow_negative_costs = FALSE, foc_tolerance = 1e-08, ... )
market |
A 'SyntheticMarket' generated by [fake_market()]. |
spec |
An 'antitrust_model_spec', a model name, or a descriptor list. |
alpha |
Optional known Logit price coefficient. |
allow_negative_costs |
In primitives mode, permit inferred negative costs when 'TRUE'; observed costs are always supplied and positive. |
foc_tolerance |
Numerical tolerance recorded for the FOC check. |
... |
Additional arguments, including 'alpha' and safeguards. |
In observed mode, the cost vector and proportional reference margin identify the price coefficient and implied equilibrium prices. In primitives mode, 'alpha' must be in the market truth or be supplied in '...'.
A new realized 'SyntheticMarket' with markups, costs, mean values, recovered parameters, and FOC diagnostics.
'respecify()' applies an explicitly registered model transition. Same-demand conduct transitions carry portable structural parameters. Demand transitions use the taxonomy stored in the transition registry: structural restrictions, algebraic or conditional translations, and canonical first-order Linear or LogLin representations. Target mean values, intercepts, and slopes are solved analytically from the fitted baseline, or target structural primitives are required explicitly. No transition calibrates from source margins or minimizes an elasticity-distance objective.
respecify(object, ...) ## S4 method for signature 'AntitrustFit' respecify(object, demand = NULL, conduct = NULL, variant = NULL, ...) ## S4 method for signature 'StructuralFit' respecify(object, ...)respecify(object, ...) ## S4 method for signature 'AntitrustFit' respecify(object, demand = NULL, conduct = NULL, variant = NULL, ...) ## S4 method for signature 'StructuralFit' respecify(object, ...)
object |
An 'AntitrustFit' returned by 'calibrate()' or 'specify()'. |
... |
Transition-specific target primitives. Depending on the registered transition, these may include 'alpha', 'gamma', 'nests', and 'sigma'. |
demand |
Optional target demand-system name. |
conduct |
Optional target conduct name. |
variant |
Optional target model variant. |
'respecify()' is an S4 generic. The 'AntitrustFit' method below preserves the transition contract exactly; other 'StructuralFit' subclasses (e.g. from a sibling package) must supply their own method and fail explicitly otherwise, rather than silently running antitrust economics.
A newly constructed 'AntitrustFit' under the target specification.
['specify()'], ['update.AntitrustFit()']
fit <- specify("logit", "bertrand", prices = c(2, 2.2, 2.5), ownerPre = c("A", "B", "C"), parameters = list(alpha = -2, meanval = c(.6, .4, .2)), insideSize = 100) cournot_fit <- respecify(fit, conduct = "cournot") cournot_fit@spec$idfit <- specify("logit", "bertrand", prices = c(2, 2.2, 2.5), ownerPre = c("A", "B", "C"), parameters = list(alpha = -2, meanval = c(.6, .4, .2)), insideSize = 100) cournot_fit <- respecify(fit, conduct = "cournot") cournot_fit@spec$id
The legacy S4 result at a given step of a CounterfactualPath
result_at(path, i) ## S4 method for signature 'CounterfactualPath' result_at(path, i)result_at(path, i) ## S4 method for signature 'CounterfactualPath' result_at(path, i)
path |
A 'CounterfactualPath' object. |
i |
A single step index. |
The legacy S4 result after step 'i'.
Revenue retention is the share of product revenue received by the seller. Values below one represent ad valorem charges and values above one represent subsidies. The default is one for every product. An omitted argument preserves existing retention; for a new model, post-merger retention inherits pre-merger retention. Economic ownership remains separate. setRetention() changes metadata only: it does not recover costs, recalibrate, or solve prices. Prefer revenueRetentionPre in specify() or calibrate() and revenueRetentionPost in simulate() for fitted models. When changing retention on an already fitted legacy model, refresh its stored mcPre and mcPost from calcMC() before calling calcPrices(); price solvers use those stored effective costs.
setRetention(object, retentionPre = NULL, retentionPost = NULL) getRetention(object, preMerger = TRUE)setRetention(object, retentionPre = NULL, retentionPost = NULL) getRetention(object, preMerger = TRUE)
object |
An antitrust model or |
retentionPre, retentionPost
|
Positive finite product-level revenue retention vectors. Scalars are recycled and named vectors are matched to product labels. |
preMerger |
Return pre-merger retention when |
setRetention() returns the updated object; getRetention() returns its product-level retention vector.
Displays the percentage change in prices due to the merger.
## S4 method for signature 'Antitrust' show(object)## S4 method for signature 'Antitrust' show(object)
object |
An instance of the Antitrust class. |
A lightweight, inexpensive summary of a fitted model's identity: the demand system, conduct, variant, underlying legacy model class, and construction route. It reads only stored slots and never triggers simulation, contraction, or optimization.
## S4 method for signature 'AntitrustFit' show(object)## S4 method for signature 'AntitrustFit' show(object)
object |
An 'AntitrustFit'. |
'object', invisibly.
A compatibility and convenience constructor that simulates a merger with user-supplied demand parameters under the assumption that all firms in the market are playing either a differentiated products Bertrand pricing game, Cournot quantity game, 2nd price (score) auction, or bargaining game.
Let k denote the number of products produced by all firms below.
sim( prices, shares = NULL, margins = NULL, supply = c("bertrand", "moncom", "cournot", "auction2nd", "bargaining", "bargaining2nd"), demand = c("Linear", "AIDS", "LogLin", "Logit", "CES", "LogitNests", "CESNests", "LogitCap", "BLP", "LogitBLP", "CournotBLP"), demand.param, ownerPre, ownerPost, nests, capacities, mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = 1, priceOutside, priceStart, bargpowerPre = rep(0.5, length(prices)), bargpowerPost = bargpowerPre, labels = paste("Prod", 1:length(prices), sep = ""), price_domain = c("positive", "real"), ... )sim( prices, shares = NULL, margins = NULL, supply = c("bertrand", "moncom", "cournot", "auction2nd", "bargaining", "bargaining2nd"), demand = c("Linear", "AIDS", "LogLin", "Logit", "CES", "LogitNests", "CESNests", "LogitCap", "BLP", "LogitBLP", "CournotBLP"), demand.param, ownerPre, ownerPost, nests, capacities, mcDelta = rep(0, length(prices)), subset = rep(TRUE, length(prices)), insideSize = 1, priceOutside, priceStart, bargpowerPre = rep(0.5, length(prices)), bargpowerPost = bargpowerPre, labels = paste("Prod", 1:length(prices), sep = ""), price_domain = c("positive", "real"), ... )
prices |
A length k vector of product prices. |
shares |
A length k vector of product shares. Only used for ‘BLP’ demand. See Details. |
margins |
An optional length k vector of product margins. Required for demand systems that calibrate costs from observed margins. Ignored for ‘BLP’ demand, where marginal costs are recovered from observed prices and the estimated demand system. |
supply |
A character string indicating how firms compete with one another. Valid values are "moncom" (differentiated-product monopolistic competition), "bertrand" (Nash Bertrand), "cournot" (Nash Cournot), "auction2nd" (2nd score auction), "bargaining", or "bargaining2nd". |
demand |
A demand-system name for a complete supplied-parameter
implementation. See |
demand.param |
See Below. |
ownerPre |
EITHER a vector of length k whose values indicate which firm produced a product pre-merger OR a k x k matrix of pre-merger ownership shares. |
ownerPost |
EITHER a vector of length k whose values indicate which firm produced a product after the merger OR a k x k matrix of post-merger ownership shares. |
nests |
A length k vector identifying the nest that each product belongs to. Must be supplied when ‘demand’ equals ‘CESNests’ and ‘LogitNests’. |
capacities |
A length k vector of product capacities. Must be supplied when ‘demand’ equals ‘LogitCap’. |
mcDelta |
A vector of length k where each element equals the proportional change in a product's marginal costs due to the merger. Default is 0, which assumes that the merger does not affect any products' marginal cost. |
subset |
A vector of length k where each element equals TRUE if the product indexed by that element should be included in the post-merger simulation and FALSE if it should be excluded.Default is a length k vector of TRUE. |
insideSize |
A length 1 vector equal to total units sold if ‘demand’ equals "logit", or total revenues if ‘demand’ equals "ces". |
priceOutside |
A length 1 vector indicating the price of the outside good. This option only applies to the ‘Logit’ class and its child classes Default for ‘Logit’,‘LogitNests’, and ‘LogitCap’ is 0, and for ‘CES’ and ‘CesNests’ is 1. |
priceStart |
A length k vector of starting values used to solve for equilibrium price. Default is the ‘prices’ vector for all values of demand except for ‘AIDS’, which is set equal to a vector of 0s. |
bargpowerPre |
A length k vector of pre-merger bargaining power parameters. Values must be between 0 (sellers have the power) and 1 (buyers the power). Ignored if ‘supply’ not equal to "bargaining" or "bargaining2nd". |
bargpowerPost |
A length k vector of post-merger bargaining power parameters. Values must be between 0 (sellers have the power) and 1 (buyers the power). Default is ‘bargpowerPre’. Ignored if ‘supply’ not equal to "bargaining" or "bargaining2nd". |
labels |
A k-length vector of labels. Default is “Prod#”, where ‘#’ is a number between 1 and the length of ‘prices’. |
price_domain |
Input price-level simulation domain. The default
requires positive rates; |
... |
Additional options to feed to the optimizer used to solve for equilibrium prices. |
For a reusable structural fit, prefer specify
followed by counterfactual and simulate.
The supported combinations are complete implementations recorded by
supportedModels, not arbitrary demand-conduct pairings.
Using user-supplied demand parameters,
sim simulates the effects of a merger in a market where
firms are playing a differentiated products pricing game.
Under ‘supply = "moncom"’, each product uses its own demand
response and does not internalize strategic cross-product effects. Pure
ownership changes therefore have no strategic price effect, while cost,
demand, and product-set changes remain model-specific counterfactuals.
For flat CES, the direct perceived own elasticity is '-gamma', not the
full share-adjusted diagonal returned by 'elast()'. For BLP, the direct
perceived derivative is integrated over the existing consumer draws as
'sum_r w_r * alpha_r * s_jr'. Nested Logit/CES, Linear, LogLinear, AIDS,
and PCAIDS remain rejected because their package-specific nest,
expenditure, or quantity-game objects do not yet have a complete validated
MonCom lifecycle.
The ‘supply’ parameter determines the type of competition. When ‘supply’ equals ‘cournot’, firms compete on quantities rather than prices. Cournot competition is supported for ‘Logit’, ‘CES’, and ‘BLP’ demand systems. Second-score auction competition is supported for Logit and CES, as are both bargaining modes.
If ‘demand’ equals ‘Linear’, ‘LogLin’, or ‘AIDS’, then ‘demand.param’ must be a list containing:
A k x k matrix of slope coefficients.
A length-k vector of intercepts.
Additionally, if ‘demand’ equals ‘AIDS’, ‘demand.param’ must also contain:
An estimate of aggregate market elasticity.
For ‘Linear’ demand models, sim returns an error if
any intercepts are negative. For ‘Linear’, ‘LogLin’,
and ‘AIDS’ models, sim returns an error if not all
diagonal elements of the slopes matrix are negative.
If ‘demand’ equals ‘Logit’ or ‘LogitNests’, then ‘demand.param’ must equal a list containing:
The price coefficient.
A length-k vector of mean valuations. If none of the values of ‘meanval’ are zero, an outside good is assumed to exist.
If ‘demand’ equals ‘BLP’, then ‘demand.param’ must equal a list containing:
The mean price coefficient (or use alphaMean).
A length-k vector of mean valuations. If none of the values of ‘meanval’ are zero, an outside good is assumed to exist. If ‘meanval’ is not provided, then ‘shares’ must be supplied so that mean valuations can be recovered via BLP contraction mapping.
The standard deviation of the random coefficient on price, representing consumer heterogeneity in price sensitivity.
Optional nesting parameter for the outside good: sigmaNest in (0,1] where sigmaNest=1 is flat logit (no nesting) and sigmaNest->0 means products are perfect substitutes within the nest. Default is 1.
Optional vector of demographic coefficients for the price coefficient. Each element represents the interaction effect of a demographic variable with price.
Optional: Vector of length equal to piDemog length, containing the mean of each demographic variable. Default is 0 (demeaned demographics). If demographics were demeaned in estimation, use 0; otherwise provide the actual mean.
Optional: Covariance matrix (square, dimensions = length of piDemog) for demographic variables. Default is identity matrix (unit variance, independent). Should match the variance structure of demographics in your data. For a single demographic with variance sigma^2, use matrix(sigma^2, nrow=1, ncol=1).
Number of draws to use for simulating consumer heterogeneity. Default is 5000.
Integration rule: "auto",
"gauss-hermite", "monte-carlo", or "provided".
Automatic integration uses Gauss-Hermite for at most two active Gaussian
factors and Monte Carlo otherwise.
Gauss-Hermite nodes per axis: 31 by default in one dimension and 15 by 15 in two dimensions.
Optional numeric matrix of supplied standardized points for two-dimensional integration, one point per row.
Optional: k x L matrix of L product characteristics for k products.
Optional: Length-L vector of mean coefficients on product characteristics.
Optional: Length-L vector of random coefficient standard deviations on characteristics.
Optional: nDemog x L matrix of demographic interactions with characteristics.
Two-dimensional BLP integration is available for Bertrand, Cournot, and MonCom supply. BLP auction and bargaining currently accept price random-coefficient heterogeneity only.
Note: The ‘shares’ argument is only used with ‘BLP’ demand.
If supplied for any other demand system, a warning will be issued but the function will proceed
(shares will be ignored). For ‘BLP’,
either ‘meanval’ must be provided in ‘demand.param’ OR ‘shares’
must be supplied to the sim function to perform BLP contraction mapping.
If ‘demand’ equals ‘CES’ or ‘CESNests’, then ‘demand.param’ must equal a list containing:
The price coefficient.
The coefficient on the numeraire good. May instead be calibrated using ‘shareInside’.
A length-k vector of mean valuations. If none of the values of ‘meanval’ are zero, an outside good is assumed to exist.
The budget share of all products in the market. Default is 1, meaning that all consumer wealth is spent on products in the market. May instead be specified using ‘alpha’.
If ‘demand’ equals ‘LogitCap’, ‘demand.param’ must contain ‘alpha’, a finite length-k ‘meanval’ vector, and a positive ‘mktSize’. Capacities are compared with quantities implied by those demand parameters; they are not used as demand shares. Margins must be supplied for products that are exactly at capacity because their marginal costs are not identified by an unconstrained first-order condition.
sim returns an instance of the class specified by the
‘demand’ argument.
Charles Taragin [email protected]
The S4 class documentation for: Linear,
AIDS, LogLin, Logit,
LogitNests, LogitCap,
CES, CESNests
## sim() is a supported convenience interface for supplied parameters. ## Use specify() and simulate() for a reusable fit. result <- sim(c(2, 2.2, 2.5), supply = "bertrand", demand = "Logit", demand.param = list(alpha = -2, meanval = c(.6, .4, .2)), ownerPre = c("A", "B", "C"), ownerPost = c("A", "A", "C"), insideSize = 100) result@pricePost## sim() is a supported convenience interface for supplied parameters. ## Use specify() and simulate() for a reusable fit. result <- sim(c(2, 2.2, 2.5), supply = "bertrand", demand = "Logit", demand.param = list(alpha = -2, meanval = c(.6, .4, .2)), ownerPre = c("A", "B", "C"), ownerPost = c("A", "A", "C"), insideSize = 100) result@pricePost
For a one-step 'Counterfactual' (or the equivalent direct legacy scenario
arguments), 'simulate()' returns the existing S4 simulation-result object
unchanged, exactly as before. For a multi-step 'Counterfactual' (built
with add_step), each step is solved in turn, promoting the
previous step's solved equilibrium into the next step's starting state,
and a ‘CounterfactualPath' recording every step’s result is returned.
'object' may also be a 'CounterfactualPath', in which case simulation
resumes from that path's final solved state and the returned path's
history includes the earlier steps.
simulate(object, ...) ## S4 method for signature 'AntitrustFit' simulate( object, ownerPost = NULL, mcDelta = NULL, subset = NULL, priceStart, capacitiesPost = NULL, bargpowerPost = NULL, revenueRetentionPost = NULL, solver = NULL, isMax = FALSE, price_domain = c("positive", "real"), ... ) ## S4 method for signature 'CounterfactualPath' simulate(object, ownerPost = NULL, price_domain = c("positive", "real"), ...) ## S4 method for signature 'ANY' simulate(object, nsim = 1, seed = NULL, ...) ## S4 method for signature 'StructuralFit' simulate(object, ...)simulate(object, ...) ## S4 method for signature 'AntitrustFit' simulate( object, ownerPost = NULL, mcDelta = NULL, subset = NULL, priceStart, capacitiesPost = NULL, bargpowerPost = NULL, revenueRetentionPost = NULL, solver = NULL, isMax = FALSE, price_domain = c("positive", "real"), ... ) ## S4 method for signature 'CounterfactualPath' simulate(object, ownerPost = NULL, price_domain = c("positive", "real"), ...) ## S4 method for signature 'ANY' simulate(object, nsim = 1, seed = NULL, ...) ## S4 method for signature 'StructuralFit' simulate(object, ...)
object |
An |
... |
Additional arguments passed to the existing price solver.
For Stackelberg fits, |
ownerPost |
Post-counterfactual ownership vector or matrix, or a 'Counterfactual' object. |
mcDelta |
A model-specific vector of proportional cost changes, with one element per product for most models and one element per plant for general Cournot models. |
subset |
A length-k logical vector selecting products in the counterfactual equilibrium. |
priceStart |
Optional price starting values. |
capacitiesPost |
Optional post-counterfactual capacities for LogitCap or plant capacities for Stackelberg. |
bargpowerPost |
Optional post-counterfactual bargaining powers for bargaining models. |
revenueRetentionPost |
Optional positive seller revenue-retention vector for a one-step counterfactual. |
solver |
Optional solver override. The calibration solver is reused by default for Logit-Bertrand; Logit-Cournot retains its legacy solver. |
isMax |
Whether to run the existing local profit-maximum check. |
price_domain |
Input price-level simulation domain. The default '"positive"' rejects a nonpositive solved rate; '"real"' retains finite negative or zero rates for flat/nested/capacity Logit and BLP demand. Demand systems using log-prices or price powers remain positive-only. |
nsim |
For objects that are not an 'AntitrustFit' or
'CounterfactualPath', the number of simulated response vectors passed on
to |
seed |
For objects that are not an 'AntitrustFit' or
'CounterfactualPath', an optional random seed passed on to
|
'simulate()' is an S4 generic that extends simulate.
Objects that are not an 'AntitrustFit' or 'CounterfactualPath' (including
ordinary models such as 'lm') continue to dispatch to
simulate exactly as before antitrust was attached.
Other 'StructuralFit' subclasses (e.g. from a sibling package) must supply
their own method and fail explicitly otherwise.
For a one-step counterfactual, an existing S4 simulation-result
object, such as Logit or LogitCournot. For a multi-step
counterfactual, a 'CounterfactualPath'.
fit <- calibrate("logit", "bertrand", prices = c(2, 2.2, 2.5), shares = c(.35, .25, .20), margins = c(.40, .35, .30), ownerPre = c("A", "B", "C"), insideSize = 100) result <- simulate(fit, counterfactual(ownership = c("A", "A", "C"))) result@pricePostfit <- calibrate("logit", "bertrand", prices = c(2, 2.2, 2.5), shares = c(.35, .25, .20), margins = c(.40, .35, .30), ownerPre = c("A", "B", "C"), insideSize = 100) result <- simulate(fit, counterfactual(ownership = c("A", "A", "C"))) result@pricePost
Generate deterministic synthetic-market replications
simulate_markets( n, generator = fake_market, seed = NULL, max_attempts = 1L, realizer = NULL, ... )simulate_markets( n, generator = fake_market, seed = NULL, max_attempts = 1L, realizer = NULL, ... )
n |
Number of requested replications. |
generator |
A function such as [fake_market]. |
seed |
Optional base integer seed. |
max_attempts |
Maximum attempts per requested replication. |
realizer |
Optional model-specific function applied to each market. |
... |
Arguments passed to 'generator'. |
A 'SyntheticMarketBatch' list with markets, seeds, and diagnostics.
'simulate_steps()' is the extension point a 'CounterfactualPath' resume uses to solve newly appended steps: given a fitted 'object', the legacy S4 result the path last landed on, and the new 'steps' to solve, it returns a 'list(results = <list of per-step legacy S4 results>)'. Each fit family owns how state persists between steps (antitrust promotes every '*Post' slot into '*Pre' and compounds cost shocks; other families may use a different, equally valid convention) and may attach whatever extra bookkeeping its own resume needs as additional list elements alongside 'results' – 'simulate(CounterfactualPath, ...)' only inspects 'results' and forwards the rest into 'diagnostics' unchanged.
simulate_steps(object, last_result, steps, ...) ## S4 method for signature 'AntitrustFit' simulate_steps(object, last_result, steps, cumulative_costs = NULL, ...)simulate_steps(object, last_result, steps, ...) ## S4 method for signature 'AntitrustFit' simulate_steps(object, last_result, steps, cumulative_costs = NULL, ...)
object |
A fitted structural model, such as an 'AntitrustFit'. |
last_result |
The legacy S4 result the path last landed on. |
steps |
The ordered 'CounterfactualStep' objects to solve next. |
... |
Additional family-specific resume state. |
cumulative_costs |
For 'AntitrustFit', the compounded cost shock carried over from the path's previous steps. |
A list whose 'results' element is a list of legacy S4 results, one per step, in order. Additional elements are family-specific.
Construct a fitted structural model from supplied parameters
specify( demand, conduct = NULL, prices, parameters, ownerPre, shares = NULL, margins = NULL, quantities = NULL, insideSize = 1, priceOutside, priceStart, labels = paste("Prod", 1:length(prices), sep = ""), variant = "standard", output = NULL, baseline = c("solve", "observed"), revenueRetentionPre = NULL, ... )specify( demand, conduct = NULL, prices, parameters, ownerPre, shares = NULL, margins = NULL, quantities = NULL, insideSize = 1, priceOutside, priceStart, labels = paste("Prod", 1:length(prices), sep = ""), variant = "standard", output = NULL, baseline = c("solve", "observed"), revenueRetentionPre = NULL, ... )
demand |
A demand-system name or an object returned by
|
conduct |
A conduct name. Omit it when 'demand' is a model specification object. |
prices |
A length-k vector of observed product prices. |
parameters |
A named list of structural demand parameters. |
ownerPre |
Pre-merger ownership vector or matrix. |
shares |
Optional observed shares retained as model metadata. |
margins |
Optional observed margins retained as model metadata. |
quantities |
Observed quantities for Linear or LogLin demand. |
insideSize |
Market size passed to the existing 'sim()' constructor. |
priceOutside |
Optional outside-good price. |
priceStart |
Optional equilibrium price starting values. |
labels |
Product labels. |
variant |
A model-specific calibration variant, such as '"alm"'. |
output |
Logical indicator for an output ('TRUE') or input ('FALSE') market when the selected model supports both orientations. |
baseline |
Baseline lifecycle: '"solve"' retains the legacy nonlinear solve, while '"observed"' binds supplied observed prices for standard flat Logit/CES models. |
revenueRetentionPre |
Optional positive seller revenue-retention vector applied before marginal-cost recovery. |
... |
Additional options accepted by the legacy parameterized constructor. |
An AntitrustFit object.
fit <- specify("logit", "bertrand", prices = c(2, 2.2, 2.5), ownerPre = c("A", "B", "C"), parameters = list(alpha = -2, meanval = c(.6, .4, .2)), insideSize = 100) fit@parameters$alphafit <- specify("logit", "bertrand", prices = c(2, 2.2, 2.5), ownerPre = c("A", "B", "C"), parameters = list(alpha = -2, meanval = c(.6, .4, .2)), insideSize = 100) fit@parameters$alpha
'StructuralFit' is the minimal common representation for fitted structural models. It is virtual so concrete model families must supply their own lifecycle and economic methods; the class intentionally provides no simulation or respecification behavior.
specA normalized structural model specification.
modelThe fitted model state.
parametersStructural parameters recovered by calibration or supplied directly by the caller.
observedThe observed pre-merger inputs.
diagnosticsCalibration, construction, and dispatch metadata.
Summary methods for the Bertrand, Auction2ndCap, Cournot, and Auction2ndLogit classes.
Summarizes the effect of the merger, including price and revenue changes.
## S4 method for signature 'Bertrand' summary( object, revenue = TRUE, shares = TRUE, levels = FALSE, parameters = FALSE, market = FALSE, insideOnly = FALSE, digits = 2, ... ) ## S4 method for signature 'Auction2ndCap' summary( object, exAnte = FALSE, levels = FALSE, parameters = FALSE, market = TRUE, digits = 2 ) ## S4 method for signature 'Cournot' summary( object, market = FALSE, revenue = FALSE, shares = FALSE, levels = FALSE, parameters = FALSE, digits = 2, ... ) ## S4 method for signature 'Auction2ndLogit' summary(object, levels = TRUE, revenue = FALSE, ...)## S4 method for signature 'Bertrand' summary( object, revenue = TRUE, shares = TRUE, levels = FALSE, parameters = FALSE, market = FALSE, insideOnly = FALSE, digits = 2, ... ) ## S4 method for signature 'Auction2ndCap' summary( object, exAnte = FALSE, levels = FALSE, parameters = FALSE, market = TRUE, digits = 2 ) ## S4 method for signature 'Cournot' summary( object, market = FALSE, revenue = FALSE, shares = FALSE, levels = FALSE, parameters = FALSE, digits = 2, ... ) ## S4 method for signature 'Auction2ndLogit' summary(object, levels = TRUE, revenue = FALSE, ...)
object |
an instance of class |
revenue |
When TRUE, returns revenues, when FALSE returns quantitities. Default is TRUE. |
shares |
When TRUE, returns shares, when FALSE returns quantities (when possible). Default is TRUE. |
levels |
When TRUE, returns changes in levels rather than percents and quantities rather than shares, when FALSE, returns changes as a percent and shares rather than quantities. Default is FALSE. |
parameters |
When TRUE, displays all demand parameters. Default is FALSE. |
market |
When TRUE, displays aggregate information about the effect of a tariff. When FALSE displays product-specific (or in the case of Cournot, plant-specific) effects. Default is FALSE. |
insideOnly |
When TRUE, rescales shares on inside goods to sum to 1. Default is FALSE. |
digits |
Number of significant digits to report. Default is 2. |
... |
Allows other objects to be passed to a |
exAnte |
If ‘exAnte’ equals TRUE then the ex ante expected result for each firm is produced, while FALSE produces the expected result conditional on each firm winning the auction. Default is FALSE. |
Returns the stored specification, model class, and diagnostics of an 'AntitrustFit' without recomputing anything.
## S4 method for signature 'AntitrustFit' summary(object, ...)## S4 method for signature 'AntitrustFit' summary(object, ...)
object |
An 'AntitrustFit'. |
... |
Currently unused. |
A list with 'spec', 'model_class', and 'diagnostics' elements.
List demand/conduct combinations supported by antitrust
supportedModels()supportedModels()
A data frame with normalized demand names, conduct names, existing S4 result classes, and legacy constructor mappings.
head(supportedModels()[c("demand", "conduct", "calibrate", "specify", "simulate")])head(supportedModels()[c("demand", "conduct", "calibrate", "specify", "simulate")])
'synthetic_market()' is the antitrust-native entry point for fake markets. Structural demand parameters can be difficult to choose directly. Observed mode lets users reason in terms of shares, ownership, marginal costs, and a reference proportional margin, then recovers the structural parameter and equilibrium prices implied by the selected model. This is an intuition and calibration experiment, not an empirical data-generating process. In primitives mode, the supplied parameters are passed through [specify()] without hidden recalibration.
synthetic_market( demand = "logit", supply = "bertrand", mode = c("observed", "primitives"), n_firms = 3L, n_products = 1L, dirichlet_alpha = NULL, outside_beta = c(2, 8), shares = NULL, costs = NULL, cost_rule = c("common", "uniform"), cost_level = 80, cost_range = c(50, 100), reference_margin = NULL, passive_outside_share = NULL, passive_outside_range = c(0.1, 0.5), reference_price = 100, prices = NULL, outside_margin = NULL, parameters = NULL, seed = NULL, ... )synthetic_market( demand = "logit", supply = "bertrand", mode = c("observed", "primitives"), n_firms = 3L, n_products = 1L, dirichlet_alpha = NULL, outside_beta = c(2, 8), shares = NULL, costs = NULL, cost_rule = c("common", "uniform"), cost_level = 80, cost_range = c(50, 100), reference_margin = NULL, passive_outside_share = NULL, passive_outside_range = c(0.1, 0.5), reference_price = 100, prices = NULL, outside_margin = NULL, parameters = NULL, seed = NULL, ... )
demand |
Demand-system name, with '"logit"' as the default. |
supply |
Supply/conduct name, with '"bertrand"' as the default. |
mode |
Either '"observed"' or '"primitives"'. |
n_firms |
Number of inside firms; the reference firm is additional. |
n_products |
Number of products per inside firm. A scalar is recycled across firms; a vector must have length 'n_firms'. |
dirichlet_alpha |
Positive product-level Dirichlet parameters, one per inside product. If omitted, all shapes equal one. |
outside_beta |
Positive Beta shape parameters for the reference share. |
shares |
Optional complete all-product share vector summing to one. |
costs |
Optional complete positive cost vector in observed mode. |
cost_rule |
'"common"' or '"uniform"' observed cost design. |
cost_level |
Positive common cost, default 80. |
cost_range |
Positive endpoints for uniform heterogeneous costs. |
reference_margin |
Proportional reference-product margin in '(0,1)'; if omitted, drawn from the design's 'margin_range'. |
passive_outside_share |
Optional ALM passive outside-option share in '(0,1)'. If omitted for ALM, draw uniformly from 'passive_outside_range'. |
passive_outside_range |
ALM passive outside-share draw endpoints, default 0.1 and 0.5. |
reference_price |
Positive reference price in primitives mode only. |
prices |
Optional complete positive price vector in primitives mode. |
outside_margin |
Retired price-first observed argument; use 'reference_margin' with known costs. |
parameters |
Named model-specific primitives in primitives mode. Observed nested Logit and nested CES need named 'sigma' by nest; observed Linear and log-linear Bertrand need a relative all-product 'slopes' matrix. |
seed |
Optional explicit integer seed. |
... |
Model-specific arguments forwarded to [calibrate()] or [specify()], such as 'nests', 'capacities', or solver controls. |
'n_firms' counts inside firms. The active reference product is an additional one-product firm and is included in 'ownerPre'. 'n_products' may be a scalar shared by all inside firms or a vector with one count per firm, and 'dirichlet_alpha' is product-level.
In observed mode, 'reference_margin = (p_r-c_r)/p_r' pins down the reference price 'p_r=c_r/(1-reference_margin)'. Costs remain supplied design inputs. Standard Logit and CES support Bertrand, Cournot, monopolistic competition, second-score auctions, bargaining, and second-score bargaining. Nested Logit and nested CES Bertrand additionally require 'nests' and named 'parameters$sigma'; nested CES requires at least two products per nest. Linear and log-linear Bertrand require a relative 'parameters$slopes' matrix. Bargaining power defaults to 0.5 per product; 'bargpowerPre' in '...' overrides it. Other registered combinations raise an explicit unsupported or underidentification error. Primitives mode retains 'prices' and 'reference_price'. PCAIDS Bertrand uses its legacy proportional-to-share diversion rule and aggregate market elasticity of -1; the reference margin identifies the reference own-price elasticity. Logit and CES ALM Bertrand, Cournot, second-score auction, and bargaining routes use a separate passive outside-option share. Nested Logit ALM Bertrand also requires 'nests' and named 'parameters$sigma' with singleton-nest sigma fixed at one. Product shares are conditional on choosing an active product, including the reference product. If 'passive_outside_share' is omitted, it is drawn uniformly between 0.1 and 0.5; unconditional product shares are recorded.
An [AntitrustFit] directly accepted by [simulate()].
'SyntheticMarket' is a lightweight S3 representation of a generated market design. It stores observables and experimental-design metadata without imposing a demand system or conduct model.
SyntheticMarket( design, firms, products, ownership, shares, prices, observed = list(), truth = list(), diagnostics = list(), metadata = list() ) is_SyntheticMarket(x)SyntheticMarket( design, firms, products, ownership, shares, prices, observed = list(), truth = list(), diagnostics = list(), metadata = list() ) is_SyntheticMarket(x)
design |
A list describing the random design and reproducibility inputs. |
firms |
A data frame of firm-level structure. |
products |
A data frame of product-level structure. |
ownership |
A product-level ownership matrix. |
shares |
A vector of all product shares, including the reference product. |
prices |
A vector of all product prices. |
observed |
A list of observed inputs retained for calibration QA. |
truth |
A list of supplied structural primitives, when known. |
diagnostics |
A list of realization and numerical diagnostics. |
metadata |
A list of non-economic object metadata. |
x |
A 'SyntheticMarket' object. |
An object with class 'SyntheticMarket'.
'update()' rebuilds the complete calibration call from the baseline inputs stored in an 'AntitrustFit', applies the supplied replacements, and invokes the target model's ordinary calibration routine. It is intentionally not a class conversion and is available for fits created by 'calibrate()'.
## S3 method for class 'AntitrustFit' update(object, ..., evaluate = TRUE)## S3 method for class 'AntitrustFit' update(object, ..., evaluate = TRUE)
object |
An 'AntitrustFit' returned by 'calibrate()'. |
... |
Observed baseline data or model-specific calibration options to replace. Demand, conduct, and variant cannot be changed here. |
evaluate |
If 'FALSE', return the reconstructed calibration call. |
A newly calibrated 'AntitrustFit', or a call when 'evaluate' is 'FALSE'.
fit <- calibrate("logit", "bertrand", prices = c(2, 2.2, 2.5), shares = c(.35, .25, .20), margins = c(.40, .35, .30), ownerPre = c("A", "B", "C"), insideSize = 100) revised <- update(fit, margins = c(.38, .35, .30)) revised@parameters$alphafit <- calibrate("logit", "bertrand", prices = c(2, 2.2, 2.5), shares = c(.35, .25, .20), margins = c(.40, .35, .30), ownerPre = c("A", "B", "C"), insideSize = 100) revised <- update(fit, margins = c(.38, .35, .30)) revised@parameters$alpha
Calculate the Upwards Pricing Pressure Index for the products of merging firms playing a differentiated products Bertrand pricing game.
## S4 method for signature 'Bertrand' upp(object) ## S4 method for signature 'AIDS' upp(object) ## S4 method for signature 'Auction2ndLogit' upp(object)## S4 method for signature 'Bertrand' upp(object) ## S4 method for signature 'AIDS' upp(object) ## S4 method for signature 'Auction2ndLogit' upp(object)
object |
An instance of one of the classes listed above. |
upp uses the results from the merger simulation and
calibration to compute the upwards pricing pressure of the merger on
each merging parties' products.
upp returns a vector of length k equal to the net UPP for the
merging parties' products and 0 for all other products.
upp.bertrand calculates net UPP
without the need to first calibrate a demand system and simulate a merger.
Validate a counterfactual against a fitted model
validate_counterfactual(object, counterfactual) ## S4 method for signature 'AntitrustFit' validate_counterfactual(object, counterfactual) ## S4 method for signature 'StructuralFit' validate_counterfactual(object, counterfactual)validate_counterfactual(object, counterfactual) ## S4 method for signature 'AntitrustFit' validate_counterfactual(object, counterfactual) ## S4 method for signature 'StructuralFit' validate_counterfactual(object, counterfactual)
object |
A fitted structural model. |
counterfactual |
A 'Counterfactual' object. |
The validated counterfactual, invisibly.
Vertical bargaining moved to the vertical package
vertical.barg(...)vertical.barg(...)
... |
Ignored. |
This function does not return; it raises a migration error.