Professional Documents
Culture Documents
CE687A Lecture20
CE687A Lecture20
2022-23, Semester I
IIT Kanpur
1
Disclaimer
This course material is being distributed as part of CE687A, titled “Statistical and
Econometric Methods for Transportation Engineering ", at IIT Kanpur during
semester I of the academic year 2022-23. Its contents are being shared in
confidence, for the sole purpose of instruction, and are only meant for the
students registered in this course. Any form of distribution, reproduction or
uploading of these materials anywhere, or with anyone, outside this course is
strictly prohibited.
For discrete choice modelling, parts of the discussion are also adapted from
Kenneth Train’s Discrete Choice Methods with Simulation
2
Multinomial logit (MNL) model
𝑦
𝐿 𝛃 = ෑ ෑ 𝑃𝑖𝑛𝑖𝑛 , 𝐿𝐿(𝛃) = 𝑦𝑖𝑛 log 𝑃𝑖𝑛
∀𝑛 ∀𝑖 𝑛 𝑖
3
Goodness of fit
2 log 𝐿𝑀𝐿𝐸
𝑅𝑃𝑠𝑒𝑢𝑑𝑜 =1−
log 𝐿0
2
log 𝐿𝑀𝐿𝐸 − 𝐾
𝐴𝑑𝑗𝑢𝑠𝑡𝑒𝑑 − 𝑅𝑃𝑠𝑒𝑢𝑑𝑜 =1−
log 𝐿0
4
Model selection: Likelihood Ratio Test
• Under the null hypothesis that the restricted model is true, a 𝜒 2 test statistic can be
developed as follows
2
−2 𝐿𝐿𝑅 𝛃𝑅 − 𝐿𝐿𝐹 𝛃𝐹 ≈ 𝜒𝑑𝑓 𝑅 −𝑑𝑓𝐹
5
Elasticity
• Elasticity is defined the percent effect that a 1% change in 𝑥𝑖𝑛𝑘 has on the outcome
probability 𝑃𝑖𝑛 :
𝑃𝑖𝑛 𝛿𝑃𝑖𝑛 𝑥𝑖𝑛𝑘 𝛿𝑃𝑖𝑛 /𝑃𝑖𝑛
𝐸𝑥𝑖𝑛𝑘 = × =
𝛿𝑥𝑖𝑛𝑘 𝑃𝑖𝑛 𝛿𝑥𝑖𝑛𝑘 /𝑥𝑖𝑛𝑘
𝑃 𝑖𝑛
𝐸𝑥𝑖𝑛𝑘 = 1 − 𝑃𝑖𝑛 𝛽𝑖𝑘 𝑥𝑖𝑛𝑘
6
Cross-elasticity
Cross-elasticity is defined the percent effect that a 1% change in 𝑥𝑗𝑛𝑘 has on the outcome
probability 𝑃𝑖𝑛 :
𝑃
𝑖𝑛
𝛿𝑃𝑖𝑛 𝑥𝑗𝑛𝑘 𝛿𝑃𝑖𝑛 /𝑃𝑖𝑛
𝐸𝑥𝑗𝑛𝑘 = × =
𝛿𝑥𝑗𝑛𝑘 𝑃𝑖𝑛 𝛿𝑥𝑗𝑛𝑘 /𝑥𝑗𝑛𝑘
7
MNL example (route choice, example 13.1, Washington et al.)
8
MNL example (route choice, example 13.1, Washington et al.)
• Commuters had a choice of three alternate routes: a four-lane arterial, a two-lane highway,
and a limited access four-lane freeway.
• Each of these three routes shared some common portions for access and egress because,
for example, the same road to the downtown area is used by both freeway and two-lane
road alternatives since the freeway exits onto the same city street as the two-lane road.
9
Route choices and explanatory variables
• Route choices:
a. four-lane arterial (speed
limit = 60 km/h, 2 lanes
each direction)
t. two-lane highway (speed
limit = 60 km/h, 1 lane
each direction)
f. limited access four-lane
freeway (speed limit = 90
km/h, 2 lanes each
direction).
• The variables are both
individual and alternative-
specific
Image source: Washington, S., Karlaftis, M. G., Mannering, F., & Anastasopoulos, P. (2020). Statistical and econometric methods for 10
transportation data analysis. CRC press.
MNL output
Image source: Washington, S., Karlaftis, M. G., Mannering, F., & Anastasopoulos, P. (2020). Statistical and econometric methods for 11
transportation data analysis. CRC press.
Should effect of distance vary across routes?
Image source: Washington, S., Karlaftis, M. G., Mannering, F., & Anastasopoulos, P. (2020). Statistical and econometric methods for 12
transportation data analysis. CRC press.
How about elasticities for distance variable?
Image source: Washington, S., Karlaftis, M. G., Mannering, F., & Anastasopoulos, P. (2020). Statistical and econometric methods for 13
transportation data analysis. CRC press.
Nested logit model
Image source: Washington, S., Karlaftis, M. G., Mannering, F., & Anastasopoulos, P. (2020). Statistical and econometric methods for 14
transportation data analysis. CRC press.
Nested logit model: substitution patterns
• For any two alternatives that are in the same nest, the ratio of probabilities is
independent of the attributes or existence of all other alternatives. That is, IIA holds
within each nest.
• For any two alternatives in different nests, the ratio of probabilities can depend on the
attributes of other alternatives in the two nests. IIA does not hold in general for
alternatives in different nests.
Image source: Washington, S., Karlaftis, M. G., Mannering, F., & Anastasopoulos, P. (2020). Statistical and econometric methods for 15
transportation data analysis. CRC press.
Example of substitution patterns
• 𝑃 𝐴𝑢𝑡𝑜 |𝑃 𝐶𝑎𝑟𝑝𝑜𝑜𝑙
=4
16
Image source: Train, K. E. (2009). Discrete choice methods with simulation. Cambridge university press.
Nested logit model: probability estimation
• 𝑊𝑘𝑛 depends only on variables that describe nest 𝑘. These variables differ over nests
but not over alternatives within each nest.
• 𝑌𝑖𝑛 depends on variables that describe alternative 𝑖 ∈ 𝐵𝑘 . These variables vary over
alternatives (𝐵𝑘 ) within nest 𝑘.
17
Nested logit model: probability estimation
18
Nested logit model: probability estimation
𝑒 𝑌𝑖𝑛/𝜆𝑘
𝑃𝑖𝑛|𝐵𝑘 =
σ𝑗∈𝐵𝑘 𝑒 𝑌𝑗𝑛/𝜆𝑘
• 𝐼𝑘𝑛 = log σ𝑗∈𝐵𝑘 𝑒 𝑌𝑗𝑛 /𝜆𝑘 is referred to as the inclusive value (or logsum)
• 𝜆𝑘 = 1 ∀𝑘 reduces the nested logit to MNL (which can then be tested using
hypothesis testing)
20
Nested logit model estimation
Image source: Washington, S., Karlaftis, M. G., Mannering, F., & Anastasopoulos, P. (2020). Statistical and econometric methods for 22
transportation data analysis. CRC press.
Model output
Image source: Washington, S., Karlaftis, M. G., Mannering, F., & Anastasopoulos, P. (2020). Statistical and econometric methods for 23
transportation data analysis. CRC press.
Other discrete choice alternatives
• Chapter 4 of Train(2009) also discusses other versions of nested logit functions that
can be explained collectively as generalized extreme value models.
• Section 4.2.3 of Train(2009) also contains a brief discussion on some differences in
probability formulae used for nested logit model estimation across different texts with
regards to whether 𝜆𝑘 are divided in the lower model or not.
24
Comments
Discussion
Questions
E-mail: amedury@iitk.ac.in 25