simulate_BLP_dataset {BLPestimatoR} | R Documentation |
This function creates a simulated BLP dataset.
Description
This function creates a simulated BLP dataset.
Usage
simulate_BLP_dataset(
nmkt,
nbrn,
Xlin,
Xexo,
Xrandom,
instruments,
true.parameters = list(),
price.endogeneity = list(mean.xi = -2, mean.eita = 0, cov = cbind(c(1, 0.7), c(0.7,
1))),
printlevel = 1,
seed
)
Arguments
nmkt |
number of markets |
nbrn |
number of products |
Xlin |
character vector specifying the set of linear variables |
Xexo |
character vector specifying the set of exogenous variables (subset of |
Xrandom |
character vector specifying the set of random coefficients (subset of |
instruments |
character vector specifying the set of instrumental variables |
true.parameters |
list with parameters of the DGP
|
price.endogeneity |
list with arguments of the multivariate normal distribution
|
printlevel |
0 (no output) 1 (summary of generated data) |
seed |
seed for the random number generator |
Details
The dataset is balanced, so every market has the same amount of products.
Only unobserved heterogeneity can be considered.
Variables that enter the equation as a Random Coefficient or
exogenously must be included in the set of linear variables.
The parameter.list
argument specifies the "true" effect on the
individual utility for each component. Prices are generated endogenous
as a function of exogenous variables and instruments, where the
respective effect sizes are specified in instrument.effects
and instrument.Xexo.effects
. Error terms xi
and eita
are drawn from a multivariate normal distribution, whose
parameters can be set in price.endogeneity
. Market shares
are generated by MLHS integration rule with 10000 nodes.
Value
Returns a simulated BLP dataset.
Examples
K<-2 #number of random coefficients