You are on page 1of 3

1

MGTECON640

Graduate School of Business

Fall 2016

Stanford University
Problem Set III
Due: Tuesday October 25th, 2016

For this problem set you have to use the data in the ascii file yogurt 2016.txt. The data
consists of observations on 434 households making 2575 yogurt purchases. They purchase
each time one of three brands. The five variables in the data set are, (i) the household id,
running from 1 to 430, (ii) the choice made by the household, running from 1 to 3, (iii) the
price for that household when they made their decision, in cents, of yogurt brand 1, (iv) the
price, in cents, of yogurt brand 2, (v) the price, in cents, of yogurt brand 3.
Let j index the choice, running from 1 to 3, t index the purchase, running from 1 to
Ti , and i the household, running from 1 to 430. The number of purchases made by each
household differs. For example, the first two purchases come from household 1, the next two
from household 2, and the next eight from the third household.
We focus on a discrete choice model where the utility for individual i associated with
choice j, in purchase t is
Uijt = j + Pijt + ijt ,
where Pijt is the price of brand j for household i at purchase time t. We assume the ijt
are independent across time, choice and household, with an extreme value distribution.
Normalize 1 = 0, so that there are three free parameters, 2, 3 , and .
1. First, calculate the mean price for each brand, by the choice made. That is, calculate
the average price of brand 1, 2 and 3 for households choosing brand 1, calculate the
average price of brand 1, 2 and 3 for households choosing brand 2, and calculate the
average price of brand 1, 2 and 3 for households choosing brand 3. Do the patterns
make sense? That is, are the prices for brand j lowest among the households choosing
brand j?

Imbens, Problem Set III, MGTECON640 Fall 16

2. Next we want to estimate the conditional logit model. Because of the independence
assumption on the ijt , we can ignore the fact that some purchases come from the same
household, and the likelihood function is
L(2 , 3 , ) =
Ti
N Y
Y

1Yijt =1 exp(Pi1t) + 1Yijt =2 exp(Pi2t + 2 ) + 1Yijt =2 exp(Pi3t + 3 )


exp(Pi1t) + exp(Pi2t + 2 ) + exp(Pi3t + 3 )
i=1 t=1
First show that at

0.0400

2 = 0.5000
3
1.0000
the log likelihood function is equal to -2660.1.
3. Calculate the analytic first derivatives of the log likelihood function at these values for
the parameters. Hint: the first derivative with respect to is -6948.8.
4. Calculate the analytic second derivatives with respect to the parameters. Hint: the
second derivative with respect to is approximately -505130.
5. Next, use the Newton-Rahpson algorithm to find the maximum likelihood estimators
for , 2, and 3 .
6. Next we explore a random coefficients version of the conditional logit model. Rather
than use continuous mixtures, as is more common in the literature, we use a computationally simpler version with a binary mixture. We will let the coefficient on price
vary by household. Thus, we model the latent utility as
Uijt = j + i Pijt + ijt ,
where
i {L , H },

with pr(i = L ) = = 0.4.

Imbens, Problem Set III, MGTECON640 Fall 16

(More generally we may want to estimate the mixture probability , but we wont do
that here.)
Show that the likelihood function for this mixture model is
L(2 , 3 , L, H , ) =

N
Y

i=1

Ti
Y

1Yijt =1 exp(L Pi1t ) + 1Yijt =2 exp(LPi2t + 2 ) + 1Yijt =2 exp(LPi3t + 3 )


exp(L Pi1t ) + exp(L Pi2t + 2) + exp(L Pi3t + 3)
t=1

Ti
Y

1Yijt =1 exp(H Pi1t ) + 1Yijt =2 exp(H Pi2t + 2 ) + 1Yijt =2 exp(H Pi3t + 3 )


.
+(1 )
exp(
P
)
+
exp(
P
+

)
+
exp(
P
+

)
H
i1t
H
i2t
2
H
i3t
3
t=1
7. Plot the log likelihood function, for = 0.4, at

2
3
L
H

c
+ c

as a function of c, from c = 0 to c = 0.2.


Compare the value of the log likelihood function at the value of c that maximimes it
with the value at c = 0. Does it appear that allowing for the heterogeneity in price
sensitivity is important?
8. Estimate the random effects model using the EM algorithm. Report parameter estimates for 2, 3 , L, and H .

You might also like