Listed below is a Matlab script file and eight accompanying Matlab functions that compute the random coefficients discrete choice model described in two articles by Aviv Nevo:

"A Practitioner's Guide to Estimation of Random Coefficients Logit Models of Demand,"

"Measuring Market Power in the Ready-to-Eat Cereal Industry,"

The code has been provided for academic research by Aviv Nevo (and modified by Bronwyn Hall to run in Matlab 7). Users of this code (or a modified version of it) should reference the above papers. The code was successfully run using Matlab 7.0.4 on a Windows XP operating system. Questions regarding Matlab should be referred to MathWorks.

The data used by this program is described in the file readme.html. These data were motivated by real scanner data; however, they are not real and should not be used to make any inference. The only purpose these data serve is to provide an example of the inputs required by the program. The results Nevo obtained with the code can be found in results.txt.

The program consists of the following files (all Matlab m-files):

rc_dc.m - A script file that reads in the data and calls the other functions;

gmmobjg.m - This function computes the GMM objective function and its gradient;

meanval.m - This function computes the mean utility level;

mufunc.m - This function computes the non-linear part of the utility (mu_ijt in the Guide);

mktsh.m - This function computes the market share for each product;

ind_sh.m - This function computes the "individual" probabilities of choosing each brand;

jacob.m - This function computes the Jacobian of the implicit function that defines the mean utility;

var_cov.m - This function computes the VCov matrix of the estimates.

cd_dum.m - This function creates a set of dummy variables