The main user-facing class for BLP demand estimation. Inherits from BLPEconomy and adds the solve() interface.
Super class
rblp::BLPEconomy -> BLPProblem
Methods
Inherited methods
Method new()
Create a BLP Problem
Usage
BLPProblem$new(
product_formulations,
product_data,
agent_formulation = NULL,
agent_data = NULL,
integration = NULL,
rc_types = NULL,
epsilon_scale = 1,
costs_type = "linear",
add_exogenous = TRUE
)Arguments
product_formulationsList of BLPFormulation objects (1-3). First: linear demand (X1). Second: nonlinear demand (X2). Third: supply (X3).
product_dataData frame with columns: market_ids, shares, prices, and optionally firm_ids, nesting_ids, demand_instruments*, supply_instruments*
agent_formulationOptional BLPFormulation for demographics
agent_dataOptional data frame with columns: market_ids, weights, nodes*
integrationOptional BLPIntegration object
rc_typesCharacter vector of random coefficient types ("linear", "log", "logit")
epsilon_scaleScaling for epsilon (default 1)
costs_type"linear" or "log"
add_exogenousWhether to add exogenous X1/X3 columns to instruments
Method solve()
Solve the BLP estimation problem
Usage
BLPProblem$solve(
sigma = NULL,
pi = NULL,
rho = NULL,
beta = NULL,
gamma = NULL,
sigma_bounds = NULL,
pi_bounds = NULL,
rho_bounds = NULL,
method = "2s",
optimization = NULL,
iteration = NULL,
fp_type = "safe_linear",
W_type = "robust",
se_type = "robust",
initial_W = NULL,
initial_update = FALSE,
scale_objective = TRUE,
center_moments = TRUE,
delta_behavior = "first",
micro_moments = NULL,
error_behavior = "revert",
error_punishment = 1,
processes = 1L
)Arguments
sigmaInitial K2 x K2 Cholesky root (0 = fixed, non-zero = free)
piInitial K2 x D demographics interaction (0 = fixed)
rhoInitial nesting parameters (0 = fixed)
betaDemand linear coefficients (NA = concentrated out)
gammaSupply linear coefficients (NA = concentrated out)
sigma_boundsList of lower, upper bound matrices for sigma
pi_boundsList of lower, upper bound matrices for pi
rho_boundsList of lower, upper bound vectors for rho
method'1s' or '2s' for one-step or two-step GMM
optimizationBLPOptimization object
iterationBLPIteration object (for contraction mapping)
fp_typeFixed point type: "safe_linear", "linear", "nonlinear"
W_typeWeighting matrix type: "robust", "clustered", "unadjusted"
se_typeStandard error type: "robust", "clustered", "unadjusted"
initial_WOptional initial weighting matrix
scale_objectiveWhether to scale objective by N
center_momentsWhether to center moment conditions
delta_behaviorHow to initialize delta: "first", "logit", "last"
micro_momentsOptional list of MicroMoment objects
error_behavior"revert", "punish", or "raise"
error_punishmentPunishment scale for objective on error
processesNumber of parallel processes (1 = no parallel)