Mixed Logit Estimation Routine for Cross-Sectional Data

Authors: Kenneth Train, David Revelt, Paul Ruud

Copyright (c) 1996 and 1999. Kenneth Train, David Revelt, and Paul Ruud.

New Version: This version allows Halton draws, uniform and triangular distributions, robust standard errors, and weights.

Keywords: mixed logit, random parameters logit, error components logit, cross-sectional data, simulations

References: D. Revelt and K. Train, "Mixed Logit with Repeated Choices of Appliance Efficiency Levels." Review of Economics and Statistics, Vol. LXXX, No. 4, 647-657, 1998. Working paper version available in Postscript or PDF.

K. Train, "Recreation Demand Models with Taste Differences Over People." Land Economics, Vol. 74, No. 2, pp. 230-239, 1998. Working paper version available in postscript or PDF.

D. Brownstone and K. Train, "Forecasting New Product Penetration with Flexible Substitution Patterns." Journal of Econometrics, Vol. 89, No. 1, pp. 109-129, 1999 (PDF file of journal article). Working paper version: " PS (Postscript file of working paper)."

D. McFadden and K. Train, 1996 (revised 1998 and 2000), "Mixed MNL Models for Discrete Response." Forthcoming, Applied Econometrics. Working paper version available in Postscript or PDF.

K. Train, 1999, "Halton Sequences for Mixed Logit." Working paper available in Postscript or PDF.

Description: A mixed logit (MXL) model is essentially a standard logit model with coefficients that vary in the population. The routine estimates the distribution of coefficients. MXL does not exhibit independence from irrelevant alternatives as does standard logit, and allows correlation in unobserved utility over alternatives and over time.

The utility of an alternative is specified as U=b'x+e, where x is a vector of observed variables (which vary over alternatives and agents), b is a vector of unobserved coefficients that vary over agents but not over alternatives (representing the agent's tastes), and e is an unobserved scalar distributed extreme value iid over agents and alternatives.

Each coefficient can take any of the following five distributions: (1) Fixed coefficient: the coefficient is the same for all agents (i.e., a degenerate distribution). (2) Normally distributed coefficient, with the mean and standard deviation being estimated. (3) Uniformly distributed coefficients, with the mean and "spread" being estimated. A uniform distribution with mean b and spread s has a uniform density between b-s and b+s. (4) Triangularly distributed coefficients, with the mean and "spread" being estimated. A triangular distribution with mean b and spread s has zero density below b-s, rises linearly from b-s to b, decreases linearly from b to b+s, and then is zero again above b+s. (5) Log-normally distributed coefficient; the coefficient is calculated as exp(c + s*u) where u is a standard normal deviate and c and s are parameters. The program estimates c and s. The log-normal distribution with parameters c and s has median exp(c), mean m=exp[c+((s-squared)/2)], and standard deviation m*square-root of (exp(s-squared) - 1).

This code is designed for cross-sectional data. It does not account for the correlation over time in unobserved utility that arises when there are repeated choices by a given agent. We have another, much slower code that explicitly accounts for repeated choices (i.e., for panel data). The present code provides consistent but not efficient estimates when the data contain repeated choices for each agent -- at least within a random-parameters model where the correlation over time in unobserved utility is due to each agent's parameters being the same over time.

Platforms: Gauss. The same Gauss program can be run on either Unix (Solaris 7) or PC (W95/98/NT) platforms.

Support: Please contact the authors with questions or suggestions at train@econ.berkeley.edu.

By clicking on the links below, you agree that you have read our disclaimer, understand it, and will abide by its terms and conditions.

Archive files: train0199.zip, train0199.tar

The program, manual, sample data, and output are contained in the files described in the manifest below. If you click on the zip archive (train0199.zip), you will download an archive that requires PKWare's unzip software to expand the archive. If you click on the tar archive (train0199.tar), you will download an archive that requires the Unix tar utility to extract the files.


483040 Aug 18 10:27 data.asc
 22149 Aug 18 10:27 manual.txt
 42388 Aug 18 10:27 mxl.g
 24366 Aug 18 10:27 out.txt
  7958 Aug 18 10:27 readme.txt

Test problem developed and replicated by Kenneth Train. No errors reported. Test was run multiple times on a Pentium PC under Windows 95 and on a Sun Ultra running Solaris 7.

Archived by Grace Katagiri, 18 August 1999

Last modified: 18 August 1999