[Limdep Nlogit List] LL values in LIMDEP

William Greene wgreene at stern.nyu.edu
Thu May 17 20:04:00 EST 2007


Dear Andy:  In the output below, the NLOGIT routine reports a log likelihood
value of -199.9766.  At the bottom of the listing, the program segment that
replicates the calculation of the log likelihood reports a value of -199.976623.
There is no discrepancy.  This is how NLOGIT computes the log likelihood
function for a multinomial logit model.  I do not know what your routine does.
You sent me the algorithm, but you did not send me the actual commands.
The discrepancy, if there is one, must be in the code you used..  
/B. Greene

--> RESET
Initializing NLOGIT Version 4.0.1 (January 1, 2007).
--> RESET
Initializing NLOGIT Version 4.0.1 (January 1, 2007).
--> LOAD;file="C:\limdepwsrc\clogit.lpj"$
.LPJ save file contained     840 observations.
--> nlog;lhs=mode;rhs=one,gc,ttme;prob=pri;choices=air,train,bus,car$
+---------------------------------------------+
| Discrete choice and multinomial logit models|
+---------------------------------------------+
Normal exit from iterations. Exit status=0.
+---------------------------------------------+
| Discrete choice (multinomial logit) model   |
| Maximum Likelihood Estimates                |
| Model estimated: May 17, 2007 at 05:56:36AM.|
| Dependent variable               Choice     |
| Weighting variable                 None     |
| Number of observations              210     |
| Iterations completed                  6     |
| Log likelihood function       -199.9766     |
| Number of parameters                  5     |
| Info. Criterion: AIC =          1.95216     |
|   Finite Sample: AIC =          1.95356     |
| Info. Criterion: BIC =          2.03185     |
| Info. Criterion:HQIC =          1.98438     |
| R2=1-LogL/LogL*  Log-L fncn  R-sqrd  RsqAdj |
| Constants only    -283.7588  .29526  .28962 |
| Chi-squared[ 2]          =    167.56429     |
| Prob [ chi squared > value ] =   .00000     |
| Response data are given as ind. choice.     |
| Number of obs.=   210, skipped   0 bad obs. |
+---------------------------------------------+

+---------------------------------------------+
| Notes No coefficients=> P(i,j)=1/J(i).      |
|       Constants only => P(i,j) uses ASCs    |
|         only. N(j)/N if fixed choice set.   |
|         N(j) = total sample frequency for j |
|         N    = total sample frequency.      |
|       These 2 models are simple MNL models. |
|       R-sqrd = 1 - LogL(model)/logL(other)  |
|       RsqAdj=1-[nJ/(nJ-nparm)]*(1-R-sqrd)   |
|         nJ   = sum over i, choice set sizes |
+---------------------------------------------+
+--------+--------------+----------------+--------+--------+
|Variable| Coefficient  | Standard Error |b/St.Er.|P[|Z|>z]|
+--------+--------------+----------------+--------+--------+
 GC      |    -.01578375       .00438279    -3.601   .0003
 TTME    |    -.09709052       .01043509    -9.304   .0000
 A_AIR   |    5.77635888       .65591872     8.807   .0000
 A_TRAIN |    3.92300124       .44199360     8.876   .0000
 A_BUS   |    3.21073471       .44965283     7.140   .0000

--> crea;jpri=mode*pri$
--> reje;jpri=0$
--> crea;logp=log(jpri)$
--> calc;list;sum(logp)$
+------------------------------------+
| Listed Calculator Results          |
+------------------------------------+
 Result  =   -199.976623


************************************************
Professor William Greene
Department of Economics
Stern School of Business
New York University
44 West 4th St., Rm. 7-78
New York, NY   10012
Ph. 212.998.0876
Fax. 212.995.4218
URL. http://www.stern.nyu.edu/~wgreene
Email. wgreene at stern.nyu.edu
************************************************

----- Original Message -----
From: Andy Sungnok Choi <Andy.Choi at anu.edu.au>
Date: Wednesday, May 16, 2007 10:58 pm
Subject: [Limdep Nlogit List] LL values in LIMDEP

> Dear Bill,
> 
> Thanks for the kind explanation. However, the routine you showed 
> is exactly 
> the same as mine. And still, I could not have the same LL values 
> as LIMDEP. 
> To check, I asked one of my colleague and he told me the same 
> discrepancy 
> he has found.
> 
> I wonder whether other LIMDEP users have the similar experience. 
> Not sure 
> what's going on.
> 
> Regards,
> 
> Andy
> 
> At 12:00 PM 17/05/2007 +1000, you wrote:
> >Message: 4
> >Date: Wed, 16 May 2007 13:50:19 -0500
> >From: William Greene <wgreene at stern.nyu.edu>
> >Subject: Re: [Limdep Nlogit List] Log likelihood values
> >To: Limdep and Nlogit Mailing List <limdep at limdep.itls.usyd.edu.au>
> >Message-ID: <d6f583fc6b72.464b0c1b at stern.nyu.edu>
> >Content-Type: text/plain; charset=us-ascii
> >
> >Mr. Choi.  No, it is not correct.  You only sum the logs of the 
> >probabilities for
> >the choices actually made.  For example, here's a routine that 
> does it.
> >nlog;lhs=mode;rhs=one,gc,ttme;prob=pri;choices=air,train,bus,car$$
> >crea;jpri=mode*pri$
> >reje;jpri=0$
> >crea;logp=log(jpri)$
> >calc;list;sum(logp)$
> >/B. Greene
> >************************************************
> >Professor William Greene
> >Department of Economics
> >Stern School of Business
> >New York University
> >44 West 4th St., Rm. 7-78
> >New York, NY   10012
> >Fax. 212.995.4218
> >URL. http://www.stern.nyu.edu/~wgreene
> >Email. wgreene at stern.nyu.edu
> >************************************************
> >
> >----- Original Message -----
> >From: Andy Sungnok Choi <Andy.Choi at anu.edu.au>
> >Date: Wednesday, May 16, 2007 10:21 am
> >Subject: [Limdep Nlogit List] Log likelihood values
> >
> > > Dear all,
> > >
> > > I wonder how LIMDEP calculates LL values when MNL or ML models are
> > > applied.
> > > When I calculated manually, the results did not get close to LL
> > > values
> > > estimated by LIMDEP.
> > >
> > > Is the following wrong?
> > >
> > > 1. use ";prob=prob1" (in the syntax of MNL or ML models) to
> > > indicate
> > > probabilities of individual alternatives to be chosen
> > > 2. use "log(prob1) x choice" for LL values of individual
> > > alternatives
> > > (choice=0 or 1)
> > > 3. sum up all LL values.
> > >
> > > If this procedure is not right, how can I get probabilities of
> > > individual
> > > alternatives correctly? FYI, I am carrying out the test for model
> > > selection
> > > of Vuong (1989), when models are overlapping.
> > >
> > > Many thanks.
> > >
> > > Andy S. Choi
> > >
> > > PhD Candidate
> > > Australian National University
> _______________________________________________
> Limdep site list
> Limdep at limdep.itls.usyd.edu.au
> http://limdep.itls.usyd.edu.au
> 




More information about the Limdep mailing list