Efficient counterfactual estimation in
semiparametric discrete choice models:
a note on Chiong, Hsieh, and Shum (2017)
Abstract
I suggest an enhancement of the procedure of Chiong, Hsieh, and Shum (2017) for calculating bounds on counterfactual demand in semiparametric discrete choice models. Their algorithm relies on a system of inequalities indexed by cycles of a large number of observed markets, and hence seems to require computationally infeasible enumeration of all such cycles. I show that such enumeration is unnecessary because solving the “fully efficient” inequality system exploiting cycles of all possible lengths can be reduced to finding the length of the shortest path between every pair of vertices in a complete bidirected weighted graph on vertices. The latter problem can be solved using the Floyd–Warshall algorithm with computational complexity , which takes only seconds to run even for thousands of markets. Monte Carlo simulations illustrate the efficiency gain from using cycles of all lengths, which turns out to be positive, but small.
1 The Algorithm
The family of inequalities for the linear program in Chiong et al. (2017) takes the form
(1) |
for every cycle from with . Here and are the mean utility vector and the market share vector for market , is the mean utility vector for the counterfactual market and is the choice variable – the counterfactual market share to be bounded. Denote the inequality (1) by .
The number of possible cycles in a complete graph is exponential in and is of order already for 111See sequence A119913 in the Online Encyclopedia of Integer Sequences. Therefore, simple enumeration is computationally infeasible and Chiong et al. (2017) resort to using a (tiny) subset of inequalities (1) corresponding to cycles of length . I will show that enumeration is not necessary for this problem and that the full system of inequalities is easy to construct using graph optimization.
Define to be a complete bidirected weighted graph on vertices with weight assigned to edge . Since the mean utilities and shares for markets are identified via cyclic monotonicity, it holds that
for every path from , and hence has no negative cycles.
Note that the left-hand side of the inequality (1) depends on and so the inequalities for different values of are generally non-parallel. Hence, for each , we can minimize the right-hand side over all possible paths starting from to get the sharpest inequality.
This minimization problem resembles the problem of finding the shortest path from vertex in the graph , but is not equivalent to it because of the presence of the second term in (1), corresponding to the last edge in the path.
I suggest iterating through ordered pairs of different vertices from and, for each such pair, finding the shortest path that connects and in graph . This can be accomplished using the Floyd–Warshall algorithm, which has polynomial computational complexity for graphs with no negative cycles such as . The length of the shortest path between and corresponds to the sharpest of the family of inequalities
from which we can then pick the sharpest one over .
I suggest the following algorithmic implementation:
-
1.
Run the Floyd–Warshall algorithm on graph , obtaining a matrix of shortest path lengths between every pair of vertices. Set the diagonal elements for all .
-
2.
For every ,
-
•
for every , set ,
-
•
set ,
-
•
save the inequality with the right hand side .
-
•
-
3.
The resulting system of inequalities is equivalent to the system (1) with all cycles exhausted.
2 Monte Carlo Simulation
I extend the Monte Carlo exercise of Chiong et al. (2017) and compare performance of their original procedure using only 2-cycles (denoted CHS) with the proposed procedure exhausting all possible cycles (denoted All cyc.).
I use the following two model specifications: one is multinomial logit as in Chiong et al. (2017) and the other is multinomial probit with the same DGP parameters as the logit and with the covariance matrix of the error term
A counterfactual of interest is the increase of price of good by 1% (denoted ), for As can be seen from Tables 1 and 2, the fully efficient procedure always dominates the CHS procedure both in terms of widths of the bounds and their standard errors. Although the gain is minimal and is unlikely to be relevant in practice, I suggest using the fully efficient procedure since it bears no extra computational costs (average computational time is less than 20 seconds for and is less than 3 seconds for ).
CHS | 0.0478 | 0.0835 | 0.0932 | 0.0074 | 0.0373 | 0.0367 | 0.0070 | 0.0376 | 0.0376 | |
(0.0136) | (0.0267) | (0.0290) | (0.0022) | (0.0129) | (0.0125) | (0.0030) | (0.0117) | (0.0118) | ||
All cyc. | 0.0454 | 0.0794 | 0.0878 | 0.0071 | 0.0351 | 0.0345 | 0.0066 | 0.0355 | 0.0355 | |
(0.0126) | (0.0243) | (0.0255) | (0.0021) | (0.0112) | (0.0108) | (0.0026) | (0.0103) | (0.0104) | ||
CHS | 0.0890 | 0.0575 | 0.0978 | 0.0131 | 0.0245 | 0.0289 | 0.0101 | 0.0255 | 0.0289 | |
0.0286 | 0.0217 | 0.0306 | 0.0046 | 0.0118 | 0.0105 | 0.0031 | 0.0075 | 0.0082 | ||
All cyc. | 0.0837 | 0.0551 | 0.0915 | 0.0123 | 0.0230 | 0.0270 | 0.0096 | 0.0247 | 0.0278 | |
(0.0256) | (0.0197) | (0.0271) | (0.0040) | (0.0098) | (0.0090) | (0.0028) | (0.0069) | (0.0075) | ||
CHS | 0.0844 | 0.0833 | 0.0626 | 0.0125 | 0.0314 | 0.0268 | 0.0097 | 0.0263 | 0.0225 | |
(0.0306) | (0.0279) | (0.0254) | (0.0041) | (0.0085) | (0.0073) | (0.0032) | (0.0092) | (0.0086) | ||
All cyc. | 0.0799 | 0.0790 | 0.0597 | 0.0119 | 0.0299 | 0.0256 | 0.0092 | 0.0250 | 0.0214 | |
(0.0274) | (0.0256) | (0.0226) | (0.0036) | (0.0077) | (0.0066) | (0.0029) | (0.0083) | (0.0077) |
CHS | 0.0050 | 0.0051 | 0.0003 | 0.0167 | 0.0516 | 0.0523 | 0.0006 | 0.0060 | 0.0061 | |
(0.0015) | (0.0015) | (0.0002) | (0.0056) | (0.0161) | (0.0156) | (0.0001) | (0.0018) | (0.0018) | ||
All cyc. | 0.0048 | 0.0049 | 0.0003 | 0.0160 | 0.0487 | 0.0496 | 0.0006 | 0.0057 | 0.0058 | |
(0.0013) | (0.0013) | (0.0002) | (0.0052) | (0.0140) | (0.0139) | (0.0001) | (0.0016) | (0.0016) | ||
CHS | 0.0036 | 0.0035 | 0.0003 | 0.0271 | 0.0333 | 0.0434 | 0.0012 | 0.0048 | 0.0051 | |
(0.0017) | (0.0017) | (0.0002) | (0.0082) | (0.0104) | (0.0133) | (0.0004) | (0.0012) | (0.0012) | ||
All cyc. | 0.0035 | 0.0033 | 0.0003 | 0.0256 | 0.0318 | 0.0412 | 0.0011 | 0.0046 | 0.0049 | |
(0.0016) | (0.0015) | (0.0002) | (0.0075) | (0.0095) | (0.0121) | (0.0003) | (0.0011) | (0.0011) | ||
CHS | 0.0051 | 0.0051 | 0.0000 | 0.0265 | 0.0413 | 0.0332 | 0.0013 | 0.0063 | 0.0063 | |
(0.0021) | (0.0021) | (0.0000) | (0.0095) | (0.0137) | (0.0128) | (0.0004) | (0.0017) | (0.0017) | ||
All cyc. | 0.0049 | 0.0049 | 0.0000 | 0.0248 | 0.0389 | 0.0315 | 0.0012 | 0.0059 | 0.0059 | |
(0.0020) | (0.0020) | (0.0000) | (0.0084) | (0.0122) | (0.0112) | (0.0004) | (0.0015) | (0.0016) |
References
- Chiong et al. (2017) Chiong, K., Y.-W. Hsieh, and M. Shum (2017): “Counterfactual estimation in semiparametric discrete choice models,” Unpublished manuscript.