Package 'antitrust'

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

Help Index


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.

Details

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

Author(s)

Charles Taragin [aut, cre], Michael Sandfort [aut], Shlok Goyal [ctb] Maintainer: Charles Taragin <[email protected]>

See Also

Useful links:

Examples

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@pricePost

Append a sequential counterfactual step

Description

'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.

Usage

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,
  ...
)

Arguments

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.

Value

A 'Counterfactual' object with the new step appended.


Advance a solved market without estimating or solving it

Description

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.

Usage

advance_market(model, step = NULL)

## S4 method for signature 'Antitrust'
advance_market(model, step = NULL)

Arguments

model

A solved legacy antitrust model.

step

An optional 'CounterfactualStep' containing only 'entry' and 'quality' changes. Entry support follows the concrete model registry.

Details

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.

Value

The advanced model, with any supplied environment changes applied.


(Nested) AIDS Calibration and Merger Simulation

Description

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.

Usage

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 = ""),
  ...
)

Arguments

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 aids and -1 for pcaids.

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

aids only. A vector of length 2 who elements equal to an initial guess for "known" element of the diagonal of the demand matrix and the market elasticity.

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 optim control parameters passed to the calibration routine optimizer (typically the calcSlopes method).

control.equ

A list of BBsolve control parameters passed to the non-linear equation solver (typically the calcPrices method).

labels

A k-length vector of labels.

...

Additional options to feed to the BBsolve optimizer used to solve for equilibrium prices.

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.

Details

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 ww nests, 2≤w≤k2\le w \le k, then the model must estimate w(w−1)/2w(w-1)/2 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.

Value

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.

Author(s)

Charles Taragin [email protected]

References

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.”

See Also

linear for a demand system based on quantities rather than revenue shares.

Examples

## 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])

“Antitrust” Classes

Description

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.

Slots

pricePre

A length k vector of simulated pre-merger prices.

pricePost

A length k vector of simulated post-merger prices.

output

A 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.

ownerPre

A k x k matrix of pre-merger ownership shares.

ownerPost

A k x k matrix of post-merger ownership shares.

labels

A length k vector of labels.

control.slopes

A list of optim control parameters passed to the calibration routine optimizer (typically the calcSlopes method).

control.equ

A list of BBsolve control parameters passed to the non-linear equation solver (typically the calcPrices method).

Objects from the Class

Objects can be created by calls of the form new("Antitrust", ...).

The “matrixOrList”, “matrixOrVector” and “characterOrList” Classes

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”.

Author(s)

Charles Taragin [email protected]

Examples

showClass("Antitrust") # get a detailed description of the class

A calibrated structural model

Description

'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.

Slots

spec

An antitrust_model_spec object.

model

The calibrated existing S4 model state.

parameters

Structural parameters recovered by calibration.

observed

The observed pre-merger inputs.

diagnostics

Calibration warnings, messages, and dispatch metadata.


Class “Auction”

Description

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.

)

Slots

capacities

A length k vector of firm capacities.

margins

A length k vector of product margins, some of which may equal NA.

prices

A length k vector of product prices.

reserve

A length 1 vector equal to observed buyer's reserve price. May equal NA.

shareInside

A length 1 vector equal to the probability that a buyer does not select the outside option. May equal NA.

sellerCostCDF

A length 1 character vector equal to the name of the function that calculates the Cumulative Distribution (CDF) of SellerCosts.

sellerCostCDFLowerTail

A length 1 logical vector equal to TRUE if the probabilities are P[X <= x], otherwise, P[X > x].

sellerCostPDF

A function returning the Probability Density of Seller Costs.

sellerCostBounds

The bounds on the seller's CDF.

sellerCostParms

The parameters of the seller's CDF.

buyerValuation

Buyer's self-supply cost.

reservePre

Buyer's optimal pre-merger reservation price.

reservePost

Buyer's optimal post-merger reservation price.

mcDelta

A length k vector equal to the proportional change in a firm's capacity following the merger.

parmsStart

A vector of starting values.

Objects from the Class

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.

Extends

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.

Author(s)

Charles Taragin [email protected]

Examples

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 class

(Capacity Constrained) 2nd Price Auction Model

Description

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.

Usage

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),
  ...
)

Arguments

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 optim control parameters passed to the calibration routine optimizer (typically the calcSlopes method).

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 optim or constrOptim.

Details

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.

Value

auction2nd.cap returns an instance of class Auction2ndCap.

Author(s)

Charles Taragin [email protected], with code contributed by Michael Sandfort and Nathan Miller

References

Keith Waehrer and Perry, Martin (2003). “The Effects of Mergers in Open Auction Markets”, Rand Journal of Economics, 34(2), pp. 287-304.

Examples

##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")

2nd Score Procurement Auction Model with (Nested) Logit Demand

Description

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.

Usage

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 = "")
)

Arguments

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 rep(1, length(shares)).

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 optim control parameters passed to the calibration routine optimizer (typically the calcSlopes method).

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 auction2nd.logit.alm, a length 2 vector of starting values used to solve for price coefficient and the share of the outside good. The first element should always be the price coefficient and the second should be the outside good. For auction2nd.logit.nests, a length n+1 vector of starting values used to solve for price coefficient and the nesting parameters. The first element should always be the price coefficient and the remaining elements should be the nesting parameters.

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.

Details

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.

Value

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.

Author(s)

Charles Taragin [email protected]

References

Miller, Nathan (2014). “Modeling the effects of mergers in procurement” International Journal of Industrial Organization , 37, pp. 201-208.

See Also

logit,logit.nests for simulating mergers under a Nash-Bertrand pricing game with Logit demand

Examples

## 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)

Auction Cap Methods

Description

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.

Usage

## 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)

Arguments

object

An instance of the respective class (see description for the classes)

...

Additional arguments to pass to calcSellerCostParms

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

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.

Author(s)

Charles Taragin [email protected]

Examples

showMethods(classes="Auction2ndCap") # show all methods defined for the class

“Bargaining” Classes

Description

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.

Slots

bargpowerPre

A length k vector of pre-merger bargaining power parameters.

bargpowerPre

A length k vector of post-merger bargaining power parameters.

prices

A length k vector of of observes prices.

margins

A length k vector of of observes margins.

Objects from the Class

Objects can be created by calls of the form new("Bargaining", ...).


Nash Bargaining Model with CES Demand

Description

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.

Usage

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_
)

Arguments

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 "nleqslv" (default) or "ag" (Aggregative Games).

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.

Details

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.

Value

bargaining.ces returns an instance of BargainingCES, bargaining2nd.ces returns an instance of Bargaining2ndCES, bargaining.ces.alm returns an instance of BargainingCESALM.

Author(s)

Charles Taragin

See Also

ces for Bertrand pricing under CES demand, and bargaining.logit for Nash Bargaining under Logit demand.


Nash Bargaining Model with Logit Demand

Description

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.

Usage

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_
)

Arguments

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 rep(1, length(shares)).

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 optim control parameters passed to the calibration routine optimizer (typically the calcSlopes method).

control.equ

A list of BBsolve control parameters passed to the non-linear equation solver (typically the calcPrices method).

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 "nleqslv" (default) or "ag" (Aggregative Games).

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.

Details

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).

Value

bargaining.logit returns an instance of BargainingLogit, a child class of Logit. bargaining2nd.logit returns an instance of Bargaining2ndLogit, a child class of Auction2ndLogit.

Author(s)

Charles Taragin [email protected]

References

Miller, Nathan (2014). “Modeling the effects of mergers in procurement” International Journal of Industrial Organization , 37, pp. 201-208.

See Also

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.

Examples

## 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)

Bertrand Calibration and Merger Simulation With Logit, CES and AIDS Demand

Description

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.

Usage

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 = ""),
  ...
)

Arguments

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

aids only. A vector of length 2 who elements equal to an initial guess for "known" element of the diagonal of the demand matrix and the market elasticity.

control.slopes

A list of optim control parameters passed to the calibration routine optimizer (typically the calcSlopes method).

control.equ

A list of BBsolve control parameters passed to the non-linear equation solver (typically the calcPrices method).

labels

A k-length vector of labels.

...

Additional options to feed to the BBsolve optimizer used to solve for equilibrium prices.

Details

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.

Value

bertrand.alm returns an instance of class LogitALM, CESALM, or AIDS, depending upon the value of the “demand” argument.

Author(s)

Charles Taragin [email protected]


“Bertrand” Classes

Description

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.

Slots

shares

A length k vector containing observed output. Depending upon the model, output will be measured in units sold, quantity shares, or revenue shares.

mcDelta

A length k vector where each element equals the proportional change in a product's marginal costs due to the merger.

slopes

A k x (k+1) matrix of linear demand intercepts and slope coefficients

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.

intercepts

A length k vector of demand intercepts. (Linear only)

prices

A length k vector product prices. (Linear only)

quantities

A length k vector of product quantities. (Linear only)

margins

A length k vector of product margins. All margins must be between 0 and 1. (Linear only)

diversion

A k x k matrix of diversion ratios with diagonal elements equal to -1.

priceStart

A length k vector of prices used as the initial guess in the nonlinear equation solver. (Linear and AIDS only)

symmetry

If TRUE, requires the matrix of demand slope coefficients to be consistent with utility maximization theory. Default is false. (Linear and LogLin only)

insideSize

A positive number equal to total pre-merger revenues for all products included in the simulation. (AIDS only)

mktElast

A negative number equal to the industry pre-merger price elasticity. (AIDS only)

parmStart

A 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)

priceDelta

A length k vector containing the simulated price effects from the merger. (AIDS only)

knownElast

A negative number equal to the pre-merger own-price elasticity for any of the k products. (PCAIDS only)

knownElastIndex

An integer equal to the position of the ‘knownElast’ product in the ‘shares’ vector. (PCAIDS only)

nests

A length k vector identifying which nest a product belongs to. (Nested PCAIDS only)

nestsParms

A length k vector containing nesting parameters. (Nested PCAIDS only)

Objects from the Class

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.

Extends

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.

Author(s)

Charles Taragin [email protected]

Examples

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 class

“Bertrand RUM” Classes

Description

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.

Slots

prices

A length k vector of product prices.

margins

A length k vector of product margins, some of which may equal NA.

normIndex

An integer specifying the product index against which the mean values of all other products are normalized.

shareInside

The share of customers that purchase any of the products included in the ‘prices’ vector.

weights

A length k vector of non-negative product weights used in minimum-distance calibration.

priceOutside

The price of the outside good. Default is 0.

slopes

A list containing the coefficient on price (‘alpha’) and the vector of mean valuations (‘meanval’).

mktElast

A length 1 vector of market elasticities.

priceStart

A length-k vector of starting prices for the non-linear solver.

insideSize

A positive number equal to total pre-merger quantities (revenues for CES) for all products included in the simulation.

mktSize

A positive number equal to total quantities (revenues for CES) pre-merger for all products in the simulations as well as the outside good.

capacitiesPre

A length k vector whose elements equal pre-merger product capacities. (LogitCap and LogitCapALM only)

capacitiesPost

A length k vector whose elements equal post-merger product capacities. (LogitCap and LogitCapALM only)

nests

A length k vector identifying the nest that each product belongs to. (LogitNests and CESNests Only)

parmsStart

A length k vector who elements equal an initial guess of the nesting parameter values. (LogitNests and CESNests Only)

constraint

A 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)

parmsStart

A 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)

slopes

A list containing the coefficient on the numeraire (‘alpha’), the coefficient on price (‘gamma’), and the vector of mean valuations (‘meanval’) (CES only)

priceOutside

The price of the outside good. Default is 1. (CES only)

Objects from the Class

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.

Extends

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.

Author(s)

Charles Taragin [email protected]

Examples

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 class

Select BLP Integration Points and Weights

Description

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.

Usage

calcBLPintegration(slopes)

Arguments

slopes

A list of BLP demand parameters. Recognized elements include integration ("auto", "gauss-hermite", "monte-carlo", or "provided"), nNodes, nDraws, integrationPoints, consDraws/draws, integrationWeights/drawWeights, sigma, nDemog, piDemog, sigmaChar, and pi.

Value

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.


Calculate BLP Mean Utilities via Contraction Mapping

Description

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.

Usage

calcMeanval(object, ...)

## S4 method for signature 'LogitBLP'
calcMeanval(object)

Arguments

object

A LogitBLP object (or a subclass) with BLP parameters stored in its slopes slot.

...

Additional arguments (currently unused).

Details

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).

Value

The object with updated slopes$meanval (the delta vector) and related BLP integration bookkeeping.


Calibrate a structural antitrust model

Description

It delegates calibration to the corresponding model-specific legacy constructor, so existing equations, normalizations, solvers, and warnings remain the behavioral source of truth.

Usage

calibrate(
  demand,
  conduct = NULL,
  prices,
  shares = NULL,
  margins = NULL,
  ownerPre,
  quantities = NULL,
  variant = "standard",
  knownElast = NULL,
  mktElast = NULL,
  s0 = NULL,
  revenueRetentionPre = NULL,
  ...
)

Arguments

demand

A demand-system name or an object returned by model_spec.

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 [0, 1) and product shares must sum to 1 - s0.

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, multistart = "adaptive" evaluates a deterministic pilot and escalates to the retained grid when convergence diagnostics are inconclusive; multistart = "exhaustive" evaluates all 12 retained starts.

Value

An AntitrustFit object.

Examples

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")]

(Nested) Constant Elasticity of Substitution Demand Calibration and Merger Simulation

Description

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.

Usage

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 = ""),
  ...
)

Arguments

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 rep(1, length(shares)).

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 optim control parameters passed to the calibration routine optimizer (typically the calcSlopes method).

control.equ

A list of BBsolve control parameters passed to the non-linear equation solver (typically the calcPrices method).

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 "nleqslv" (default) or "ag" (Aggregative Games).

...

Additional options to feed to the BBsolve optimizer used to solve for equilibrium prices.

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.

Details

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.

Value

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.

Author(s)

Charles Taragin [email protected]

References

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.

See Also

logit

Examples

## 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

Methods For Calculating Compensating Marginal Cost Reductions

Description

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.

Usage

## 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"), ...)

Arguments

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.

Details

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.

Value

cmcr returns a vector of length k equal to CMCR for the merging parties' products and 0 for all other products.

See Also

cmcr.bertrand is a function that calculates CMCR without the need to first calibrate a demand system and simulate a merger.


Compensating Marginal Cost Reductions and Upwards Pricing Pressure (Bertrand)

Description

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.

Usage

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 = "")
)

Arguments

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.

Details

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.

Value

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.

Author(s)

Charles Taragin [email protected]

References

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.

See Also

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.

Examples

## 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))

Compensating Marginal Cost Reductions and Upwards Pricing Pressure (Cournot)

Description

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.

Usage

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)
)

Arguments

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.

Details

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.

Value

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.

Author(s)

Charles Taragin

References

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).

See Also

cmcr.bertrand for a differentiated products Bertrand version of this measure.

Examples

## 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 non-conflicting counterfactual changes into one simultaneous step

Description

'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.

Usage

combine_counterfactuals(...)

Arguments

...

'Counterfactual' objects, each with exactly one step.

Value

A one-step 'Counterfactual'.


Compound structural marginal-cost shocks

Description

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.

Usage

compound_cost_shocks(object, current = NULL, change = NULL)

Arguments

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'.

Value

The compounded cost-change vector, or 'current' when 'change' is 'NULL'.


Methods for Calculating marginal and Variable Costs

Description

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 rr, constant-cost values returned by calcMC are effective costs κ=c/r\kappa=c/r, so that a price-cost margin is p−κp-\kappa. For an initialized model, the post-merger value is κpost=κbase(1+mcDelta)rbase/rpost\kappa_{post}=\kappa_{base}(1+mcDelta)r_{base}/r_{post}. 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.

Usage

## 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)

Arguments

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.


Define a post-calibration economic counterfactual

Description

'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.

Usage

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,
  ...
)

Arguments

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.

Value

A 'Counterfactual' object with exactly one 'CounterfactualStep'.

Examples

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)@pricePost

An ordered sequence of counterfactual steps

Description

'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.

Usage

## S4 method for signature 'Counterfactual'
show(object)

Arguments

object

A 'Counterfactual' object.

Slots

steps

A list of 'CounterfactualStep' objects.


The realized sequence of states from a multi-step Counterfactual

Description

'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.

Usage

## S4 method for signature 'CounterfactualPath'
show(object)

Arguments

object

A 'CounterfactualPath' object.

Slots

initial

The originally calibrated legacy S4 model state.

steps

The ordered 'CounterfactualStep' objects that were solved.

results

The legacy S4 result after each step, in order.

diagnostics

Bookkeeping needed to resume simulation from this path.


A single simultaneous set of counterfactual changes

Description

'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.

Usage

## S4 method for signature 'CounterfactualStep'
show(object)

Arguments

object

A 'CounterfactualStep' object.

Slots

changes

A named list of supplied change fields.


“Cournot” Classes

Description

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.

Slots

intercepts

A length k vector containing the calibrated demand intercept.

mcfunPre

A length n list whose elements equal a function that calculates a plant's pre-merger marginal cost.

mcfunPost

A length n list whose elements equal a function that calculates a plant's post-merger marginal cost.

vcfunPre

A length n list whose elements equal a function that calculates a plant's pre-merger variable cost.

vcfunPost

A length n list whose elements equal a function that calculates a plant's post-merger variable cost.

prices

A length k vector of product prices.

quantities

An n x k matrix of plant quantities produced for each product.

margins

An n x k matrix of plant product margins.

quantityPre

An n x k matrix of predicted pre-merger quantities.

quantityPost

An n x k matrix of predicted post-merger quantities.

quantityStart

A length n x k vector of starting quantities for the non-linear solver.

productsPre

An n x k logical matrix qhose elements are TRUE if a plant produces a product pre-merger and FALSE otherwise.

productsPost

An n x k logical matrix qhose elements are TRUE if a plant produces a product post-merger and FALSE otherwise.

capacitiesPre

A length-n logical vector whose elements equal to pre-merger plant capacities. Infinite values are allowed.

capacitiesPost

A length-n logical vector whose elements equal to post-merger plant capacities. Infinite values are allowed.

demand

A length k character vector specifying whether product demand is linear ("linear") or log-linear ("log").

cost

A 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.

mktElast

A length k vector of market elasticities.

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)

dmcfunPost

A 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)

isLeaderPre

An n x k logical matrix qhose elements are TRUE if a plant produces a product pre-merger and FALSE otherwise. (Stackelberg only)

isLeaderPost

An 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)

Objects from the Class

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", ...).

Extends

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.

Author(s)

Charles Taragin [email protected]

Examples

showClass("Cournot")           # get a detailed description of the class
showClass("Stackelberg")           # get a detailed description of the class

Multi-product Cournot/Stackelberg Calibration and Merger Simulation With Linear or Log-Linear Demand

Description

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.

Usage

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,
  ...
)

Arguments

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 optim control parameters passed to the calibration routine optimizer (typically the calcSlopes method).

control.equ

A list of BBsolve control parameters passed to the non-linear equation solver (typically the calcQuantities method).

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 cournot.

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 cournot.

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’

Details

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.

Value

cournot returns an instance of class Cournot. stackelberg returns an instance of class Stackelberg.

Author(s)

Charles Taragin [email protected]

Examples

## 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

Methods For Calculating Compensating Variation (CV)

Description

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.

Usage

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)

Arguments

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).


Methods For Implementing The Hypothetical Monopolist Test

Description

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.

Usage

## 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, ...)

Arguments

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).

Details

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.

Value

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.

References

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).


Methods for Calculating Diagnostics

Description

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.

Usage

## 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, ...)

Arguments

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 calcDiagnostics method.


Methods For Calculating Diversion

Description

Calculate the diversion matrix between any two products in the market.

Usage

## S4 method for signature 'Bertrand'
diversion(object, preMerger = TRUE, revenue = FALSE)

## S4 method for signature 'AIDS'
diversion(object, preMerger = TRUE, revenue = TRUE)

Arguments

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’.

Details

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 −ϵjisharejϵiisharei\frac{-\epsilon_{ji}share_j}{\epsilon_{ii}share_i}, where ϵij\epsilon_{ij} 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 −ϵji(ϵjj−1)rjϵjj(ϵii−1)rj-\frac{\epsilon_{ji}(\epsilon_{jj}-1)r_j}{\epsilon_{jj}(\epsilon_{ii}-1)r_j} where rir_i 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 βjiβij\frac{\beta_{ji}}{\beta_ij}, where βij\beta_{ij} 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.

Value

returns a k x k matrix of diversion ratios, where the i,jth element is the diversion from i to j.


Methods For Calculating Own and Cross-Price Elasticities

Description

Calculate the own and cross-price elasticity between any two products in the market.

Usage

## 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)

Arguments

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

Details

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.

Value

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

Description

Define a new single-product entrant firm

Usage

entrant(label, meanval, cost, priceStart, ...)

Arguments

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.

Value

An 'Entrant' object.


A new single-product entrant firm

Description

'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.

Usage

## S4 method for signature 'Entrant'
show(object)

Arguments

object

An 'Entrant' object.

Slots

label

A unique product label for the entrant.

meanval

The entrant's mean valuation, on the same scale as the fitted model's calibrated 'meanval' values.

cost

The entrant's constant marginal cost.

priceStart

A starting price used to initialize the equilibrium solver and to compute the entrant's implied share.

extras

Reserved for model-specific primitives not yet supported.


Generate a reproducible synthetic antitrust market design

Description

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.

Usage

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
)

Arguments

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.

Details

'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.

Value

A 'SyntheticMarket' object.


The final solved legacy S4 result of a CounterfactualPath

Description

The final solved legacy S4 result of a CounterfactualPath

Usage

final_result(path)

## S4 method for signature 'CounterfactualPath'
final_result(path)

Arguments

path

A 'CounterfactualPath' object.

Value

The legacy S4 result after the last step.


Herfindahl-Hirschman Index

Description

Calculate the Herfindahl-Hirschman Index with arbitrary ownership and control.

Let k denote the number of products produced by the merging parties below.

Usage

HHI(shares, owner = diag(length(shares)), control)

Arguments

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.

Details

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’.

Value

HHI returns a number between 0 and 10,000

Author(s)

Charles Taragin [email protected]

References

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.

See Also

HHI-Methods for computing HHI following merger simulation.

Examples

## 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)

Methods For Calculating the Herfindahl-Hirschman Index

Description

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.

Usage

## S4 method for signature 'Bertrand'
hhi(object, preMerger = TRUE, revenue = FALSE, insideonly = TRUE)

## S4 method for signature 'Cournot'
hhi(object, preMerger = TRUE, revenue = FALSE)

Arguments

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 a fitted model's observed baseline state

Description

'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.

Usage

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"))

Arguments

object

A fitted 'StructuralFit' object.

baseline

Either '"solve"' or '"observed"'.

Details

Concrete packages may define methods for their 'StructuralFit' subclasses when the model has additional policy state, such as trade tariffs.

Value

The fitted object with baseline lifecycle diagnostics updated.


Initialize persistent structural cost state

Description

Initialize persistent structural cost state

Usage

initialize_cost_state(object)

Arguments

object

A fitted structural model.

Value

The model with its structural cost state initialized.


Linear and Log-Linear Demand Calibration and Merger Simulation

Description

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.

Usage

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 = ""),
  ...
)

Arguments

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 optim control parameters passed to the calibration routine optimizer (typically the calcSlopes method).

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 BBsolve control parameters passed to the non-linear equation solver (typically the calcPrices method).

Details

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.

Value

linear returns an instance of class Linear. loglinear returns an instance of LogLin, a child class of Linear.

Author(s)

Charles Taragin [email protected]

References

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.

See Also

aids for a demand system based on revenue shares rather than quantities.

Examples

## 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

(Nested) Logit Demand Calibration and Merger Simulation)

Description

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.

Usage

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 = ""),
  ...
)

Arguments

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 rep(1, length(shares)).

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 optim control parameters passed to the calibration routine optimizer (typically the calcSlopes method).

control.equ

A list of BBsolve control parameters passed to the non-linear equation solver (typically the calcPrices method).

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 "nleqslv" (default) or "ag" (Aggregative Games).

...

Additional options to feed to the BBsolve optimizer used to solve for equilibrium prices.

mktElast

a negative value indicating market elasticity. Default is NA.

parmsStart

For logit.cap.alm, a length-2 vector of starting values used to solve for the price coefficient and outside share (in that order). For logit.nets, rhe first element should always be the price coefficient and the remaining elements should be the 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.

capacitiesPre

A length k vector of pre-merger product capacities. Capacities must be at least as great as shares * insideSize. A value of Inf denotes an unconstrained product.

capacitiesPost

A length k vector of post-merger product capacities.

Details

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.

Value

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.

Author(s)

Charles Taragin [email protected]

References

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.

See Also

ces

Examples

## 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

Methods for Calculating Margins

Description

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.

Usage

## 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)

Arguments

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.


Methods for Calculating Prices and Margins Using Aggregative Games

Description

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.

Usage

## 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)

Arguments

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.

References

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

Description

Return synthetic market design metadata

Usage

market_design(x)

Arguments

x

A 'SyntheticMarket' object.

Value

The market's design metadata.


Describe a demand/conduct model combination

Description

Describe a demand/conduct model combination

Usage

model_spec(demand, conduct, variant = "standard")

Arguments

demand

A human-readable demand-system name, such as "logit" or "ces".

conduct

A human-readable conduct name, such as "bertrand" or "cournot".

variant

A model-specific calibration variant. The default is "standard"; "alm" selects the existing unknown-market- elasticity calibration where supported.

Value

A small object of class antitrust_model_spec containing normalized model names.

Examples

model_spec("logit", "bertrand")

Look up a registered structural model transition

Description

Look up a registered structural model transition

Usage

model_transition(from, to)

Arguments

from

An antitrust_model_spec returned by model_spec that identifies the source model.

to

An antitrust_model_spec returned by model_spec that identifies the target model.

Value

The registered transition record, including its transition kind, required arguments, retained and derived primitives, and recomputation requirements.


Monopolistic-competition classes

Description

'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'.

Extends

'MonComLogit' extends 'Logit'; 'MonComCES' extends 'CES'.


Monopolistic-competition calibration

Description

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.

Usage

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 = ""),
  ...
)

Arguments

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.

Value

A 'MonComLogit' or 'MonComCES' object.


Output Methods

Description

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.

Usage

## 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)

Arguments

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 calcQuantities.

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 LogitBLP.


Methods for Manipulating Ownership Matrices

Description

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.

Usage

## S4 method for signature 'Antitrust'
ownerToMatrix(object, preMerger = TRUE)

## S4 method for signature 'Antitrust'
ownerToVec(object, preMerger = TRUE)

Arguments

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.

Author(s)

Charles Taragin [email protected]

Examples

showMethods(classes="Antitrust") # show all methods defined for the class

Methods for Calculating Demand Parameters

Description

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).

Usage

## 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)

Arguments

object

An instance of the respective class (see description for the classes)

digits

Number of significant digits to report. Default is 2.


Methods For Calculating Upwards Pricing Pressure Index (Bertrand)

Description

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.

Usage

## S4 method for signature 'Bertrand'
plot(x, scale = 0.1)

Arguments

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.


Methods For Calculating Price Delta

Description

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.

Usage

## 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),
  ...
)

Arguments

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.


“Calculating Prices” Methods

Description

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.

Usage

## 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, ...)

Arguments

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 BBsolve, the non-linear equation solver.

For others, additional values that may be used to change the default values of constrOptim, the non-linear equation solver used to enforce non-negative equilibrium quantities.


Print a synthetic market

Description

Print a synthetic market

Usage

## S3 method for class 'SyntheticMarket'
print(x, ...)

Arguments

x

A 'SyntheticMarket' object.

...

Ignored.


Profile the BLP calibration objective over random-coefficient scale

Description

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.

Usage

profileBLP(fit, sigma_grid)

Arguments

fit

An AntitrustFit produced by BLP calibration.

sigma_grid

A finite, non-negative numeric vector of values at which to profile the objective.

Value

A data frame with sigma, alphaMean, objective, and optimizer convergence columns.


Producer Surplus Methods

Description

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.

Usage

## 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)

Arguments

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.


Realize a synthetic market under a model-specific specification

Description

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.

Usage

realize_market(market, spec, ...)

Arguments

market

A 'SyntheticMarket' object.

spec

A model-specific specification or lightweight model descriptor.

...

Additional model-specific arguments.

Value

A model-specific realized market or fit object.


Realize a SyntheticMarket under multi-product Bertrand Logit

Description

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.

Usage

## S3 method for class 'SyntheticMarket'
realize_market(
  market,
  spec,
  alpha = NULL,
  allow_negative_costs = FALSE,
  foc_tolerance = 1e-08,
  ...
)

Arguments

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.

Details

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 '...'.

Value

A new realized 'SyntheticMarket' with markups, costs, mean values, recovered parameters, and FOC diagnostics.


Respecify a fitted antitrust model

Description

'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.

Usage

respecify(object, ...)

## S4 method for signature 'AntitrustFit'
respecify(object, demand = NULL, conduct = NULL, variant = NULL, ...)

## S4 method for signature 'StructuralFit'
respecify(object, ...)

Arguments

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.

Details

'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.

Value

A newly constructed 'AntitrustFit' under the target specification.

See Also

['specify()'], ['update.AntitrustFit()']

Examples

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$id

The legacy S4 result at a given step of a CounterfactualPath

Description

The legacy S4 result at a given step of a CounterfactualPath

Usage

result_at(path, i)

## S4 method for signature 'CounterfactualPath'
result_at(path, i)

Arguments

path

A 'CounterfactualPath' object.

i

A single step index.

Value

The legacy S4 result after step 'i'.


Product revenue retention

Description

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.

Usage

setRetention(object, retentionPre = NULL, retentionPost = NULL)

getRetention(object, preMerger = TRUE)

Arguments

object

An antitrust model or AntitrustFit.

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 TRUE.

Value

setRetention() returns the updated object; getRetention() returns its product-level retention vector.


Show Method

Description

Displays the percentage change in prices due to the merger.

Usage

## S4 method for signature 'Antitrust'
show(object)

Arguments

object

An instance of the Antitrust class.


Print a calibrated structural model

Description

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.

Usage

## S4 method for signature 'AntitrustFit'
show(object)

Arguments

object

An 'AntitrustFit'.

Value

'object', invisibly.


Merger Simulation With User-Supplied Demand Parameters

Description

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.

Usage

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"),
  ...
)

Arguments

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 supportedModels for the current demand/conduct combinations and their specify support.

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; "real" permits negative or zero rates for flat/nested/capacity Logit and BLP demand.

...

Additional options to feed to the optimizer used to solve for equilibrium prices.

Details

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:

slopes

A k x k matrix of slope coefficients.

intercepts

A length-k vector of intercepts.

Additionally, if ‘demand’ equals ‘AIDS’, ‘demand.param’ must also contain:

mktElast

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:

alpha

The price coefficient.

meanval

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:

alpha

The mean price coefficient (or use alphaMean).

meanval

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.

sigma

The standard deviation of the random coefficient on price, representing consumer heterogeneity in price sensitivity.

sigmaNest

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.

piDemog

Optional vector of demographic coefficients for the price coefficient. Each element represents the interaction effect of a demographic variable with price.

demogMean

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.

demogCov

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).

nDraws

Number of draws to use for simulating consumer heterogeneity. Default is 5000.

integration

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.

nNodes

Gauss-Hermite nodes per axis: 31 by default in one dimension and 15 by 15 in two dimensions.

integrationPoints

Optional numeric matrix of supplied standardized points for two-dimensional integration, one point per row.

prodChar

Optional: k x L matrix of L product characteristics for k products.

beta

Optional: Length-L vector of mean coefficients on product characteristics.

sigmaChar

Optional: Length-L vector of random coefficient standard deviations on characteristics.

pi

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:

gamma

The price coefficient.

alpha

The coefficient on the numeraire good. May instead be calibrated using ‘shareInside’.

meanval

A length-k vector of mean valuations. If none of the values of ‘meanval’ are zero, an outside good is assumed to exist.

shareInside

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.

Value

sim returns an instance of the class specified by the ‘demand’ argument.

Author(s)

Charles Taragin [email protected]

See Also

The S4 class documentation for: Linear, AIDS, LogLin, Logit, LogitNests, LogitCap, CES, CESNests

Examples

## 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

Simulate a counterfactual from a calibrated structural model

Description

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.

Usage

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, ...)

Arguments

object

An AntitrustFit returned by calibrate, or a 'CounterfactualPath' to resume from.

...

Additional arguments passed to the existing price solver. For Stackelberg fits, isLeaderPost, productsPost, mcfunPost, vcfunPost, and dmcfunPost may be supplied as counterfactual structure; the remaining arguments are passed to the existing quantity solver.

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 simulate.

seed

For objects that are not an 'AntitrustFit' or 'CounterfactualPath', an optional random seed passed on to simulate.

Details

'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.

Value

For a one-step counterfactual, an existing S4 simulation-result object, such as Logit or LogitCournot. For a multi-step counterfactual, a 'CounterfactualPath'.

Examples

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@pricePost

Generate deterministic synthetic-market replications

Description

Generate deterministic synthetic-market replications

Usage

simulate_markets(
  n,
  generator = fake_market,
  seed = NULL,
  max_attempts = 1L,
  realizer = NULL,
  ...
)

Arguments

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'.

Value

A 'SyntheticMarketBatch' list with markets, seeds, and diagnostics.


Resolve a sequence of counterfactual steps for a fitted structural model

Description

'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.

Usage

simulate_steps(object, last_result, steps, ...)

## S4 method for signature 'AntitrustFit'
simulate_steps(object, last_result, steps, cumulative_costs = NULL, ...)

Arguments

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.

Value

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

Description

Construct a fitted structural model from supplied parameters

Usage

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,
  ...
)

Arguments

demand

A demand-system name or an object returned by model_spec.

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.

Value

An AntitrustFit object.

Examples

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$alpha

A shared structural fit contract

Description

'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.

Slots

spec

A normalized structural model specification.

model

The fitted model state.

parameters

Structural parameters recovered by calibration or supplied directly by the caller.

observed

The observed pre-merger inputs.

diagnostics

Calibration, construction, and dispatch metadata.


Summary Methods

Description

Summary methods for the Bertrand, Auction2ndCap, Cournot, and Auction2ndLogit classes. Summarizes the effect of the merger, including price and revenue changes.

Usage

## 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, ...)

Arguments

object

an instance of class Bertrand, Auction2ndCap, Cournot, or Auction2ndLogit

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 CV method.

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.


Summarize a calibrated structural model

Description

Returns the stored specification, model class, and diagnostics of an 'AntitrustFit' without recomputing anything.

Usage

## S4 method for signature 'AntitrustFit'
summary(object, ...)

Arguments

object

An 'AntitrustFit'.

...

Currently unused.

Value

A list with 'spec', 'model_class', and 'diagnostics' elements.


List demand/conduct combinations supported by antitrust

Description

List demand/conduct combinations supported by antitrust

Usage

supportedModels()

Value

A data frame with normalized demand names, conduct names, existing S4 result classes, and legacy constructor mappings.

Examples

head(supportedModels()[c("demand", "conduct", "calibrate", "specify", "simulate")])

Generate a model-consistent synthetic antitrust market

Description

'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.

Usage

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,
  ...
)

Arguments

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.

Details

'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.

Value

An [AntitrustFit] directly accepted by [simulate()].


A model-independent synthetic market design

Description

'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.

Usage

SyntheticMarket(
  design,
  firms,
  products,
  ownership,
  shares,
  prices,
  observed = list(),
  truth = list(),
  diagnostics = list(),
  metadata = list()
)

is_SyntheticMarket(x)

Arguments

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.

Value

An object with class 'SyntheticMarket'.


Recalibrate a fitted antitrust model

Description

'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()'.

Usage

## S3 method for class 'AntitrustFit'
update(object, ..., evaluate = TRUE)

Arguments

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.

Value

A newly calibrated 'AntitrustFit', or a call when 'evaluate' is 'FALSE'.

Examples

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$alpha

Methods For Calculating Upwards Pricing Pressure Index (Bertrand)

Description

Calculate the Upwards Pricing Pressure Index for the products of merging firms playing a differentiated products Bertrand pricing game.

Usage

## S4 method for signature 'Bertrand'
upp(object)

## S4 method for signature 'AIDS'
upp(object)

## S4 method for signature 'Auction2ndLogit'
upp(object)

Arguments

object

An instance of one of the classes listed above.

Details

upp uses the results from the merger simulation and calibration to compute the upwards pricing pressure of the merger on each merging parties' products.

Value

upp returns a vector of length k equal to the net UPP for the merging parties' products and 0 for all other products.

See Also

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

Description

Validate a counterfactual against a fitted model

Usage

validate_counterfactual(object, counterfactual)

## S4 method for signature 'AntitrustFit'
validate_counterfactual(object, counterfactual)

## S4 method for signature 'StructuralFit'
validate_counterfactual(object, counterfactual)

Arguments

object

A fitted structural model.

counterfactual

A 'Counterfactual' object.

Value

The validated counterfactual, invisibly.


Vertical bargaining moved to the vertical package

Description

Vertical bargaining moved to the vertical package

Usage

vertical.barg(...)

Arguments

...

Ignored.

Value

This function does not return; it raises a migration error.