-
Notifications
You must be signed in to change notification settings - Fork 2
/
master.rnw
58 lines (44 loc) · 3.03 KB
/
master.rnw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
\documentclass{article}
\usepackage{booktabs}
\usepackage{fullpage}
\usepackage{caption}
\title{Random coefficient car demand models}
\author{Rossi ABI-RAFEH}
\begin{document}
\maketitle
I try to replicate the results of Berry, Levinshon and Pakes paper on car demand estimation, using a subsample of their data (years from 1977 until 1981). Instead of estimating an aggregate system of demand equations where each car model's market share depends on all the product prices, the authors reduce the number of estimated parameters (dimensionality problem) by positing an individual utility function, linear in car characteristics and car price, then aggregate over consumers to obtain moments that can be matched to the data. In the estimations, some car characteristics are assumed to beobserved by both manufacturers and consumers, but not the econometrician, and enter into the decision of the buyer. However, these unobserved demand attributes are likely to be correlated with the price of the car, resulting in the usual simultaneity bias. The solution that BLP propose is to instrument the car price with other cars' characteristics. When allowing for heterogeneity in taste accross consumers, the instruments enter the aggregate moment conditions in a non-linear way, a problem that BLP solve by using a contraction mapping to solve for the inverse function of the market shares, and then non-linear GMM for the parameter estimation. I assume all along the replication that car buyers are price takers.
Section 1 presents the three models that I use, as well as the estimation procedure of the full model allowing for taste heterogeneity, and the instruments used for each model. Section 2 presents the data and the results, and compares them to the results of BLP.
%
<< global_init, eval=TRUE,echo=FALSE,warning=FALSE,error=FALSE,message=FALSE,results='hide',cache = FALSE>>=
options(digits=3)
rm(list = ls())
seed <- 31000
set.seed(seed)
source(file = "init.R")
source(file = "data_clean.R")
source(file = "data_instr.R")
@
%
<<section-models, child='models.Rnw'>>=
@
%
<<section-data, child='data.Rnw'>>=
@
%
<< logit_instruments, eval=TRUE,echo=FALSE,warning=FALSE,error=FALSE,message=FALSE,results='hide',cache = FALSE>>=
# source(file = "check_instr1.R")
### TAKE AWAY FROM check_instr1.R: Instrumental variables to keep from set 2 and 3 : CONSTANT_iv1, door3_iv1, door5_iv1, air_iv1, drv_iv1, euro_iv1, japan_iv1, CONSTANT_iv2, door3_iv2, at_iv2, air_iv2, drv_iv2, euro_iv2, japan_iv2
### AND DROP : -dpm_iv1, -door4_iv1, -at_iv1, -ps_iv1, -wt_iv1, -hp2wt_iv1, -hp_iv1, -wb_iv1, -size_iv1, -dpm_iv2, -wt_iv2, -hp_iv2, -wb_iv2, -hp2wt_iv2, -size_iv2, -ps_iv2, -door5_iv2, -door4_iv2
#cardata <- cardata %>% select(-dpm_iv1, -door4_iv1, -at_iv1, -ps_iv1, -wt_iv1, -hp2wt_iv1, -hp_iv1, -wb_iv1, -size_iv1, -dpm_iv2, -wt_iv2, -hp_iv2, -wb_iv2, -hp2wt_iv2, -size_iv2, -ps_iv2, -door5_iv2, -door4_iv2, -euro_iv2, -japan_iv2)
@
%
<<section-logit, child='logit.Rnw'>>=
@
%
<<section-nested-logit, child='nested_logit.Rnw'>>=
@
%
<<section-blp, child="blp.Rnw">>=
@
%
\end{document}