[Limdep Nlogit List] Re: Limdep Digest, Vol 14, Issue 4
Andy Sungnok Choi
Andy.Choi at anu.edu.au
Mon May 21 00:54:20 EST 2007
Dear Dr. Greene,
Andy again. Regarding LL values, sorry! I should have been more elaborated.
You are absolutely right when MNL models are applied. However, I am using
mixed logit models. As the following outputs show, the manually calculated
LL value (at the end) is not close to both LL values of MNL and ML
estimates. That is what I tried to ask. Any idea?
Best wishes,
Andy S. Choi
PhD Candidate
Australian National University
--> sample ;all$
--> Nlogit
;lhs=choice, cset, alti
;choices=1, 2, 3
;rpl=old,gen,uni,inc
;fcn=c2(n),cnpg(n),ctem(n),cint(n),cfac(n),ctax(n)
;Prob=prob_SD
;pts=100
;halton
;pds=5
;maxit=100
;Model:
U(1)=crep*rep+cnpg*npg+ctem*tem+cint*int+cexh*exh+ceve*eve+cfac*fac+ctax*...
U(2)=c2+crep*rep+cnpg*npg+ctem*tem+cint*int+cexh*exh+ceve*eve+cfac*fac+ct...
U(3)=c2+crep*rep+cnpg*npg+ctem*tem+cint*int+cexh*exh+ceve*eve+cfac*fac+ct...
Normal exit from iterations. Exit status=0.
+---------------------------------------------+
| Start values obtained using nonnested model |
| Maximum Likelihood Estimates |
| Model estimated: May 20, 2007 at 06:36:09PM.|
| Dependent variable Choice |
| Weighting variable None |
| Number of observations 3925 |
| Iterations completed 5 |
| Log likelihood function -3948.085 |
| Log-L for Choice model = -3948.08540 |
| R2=1-LogL/LogL* Log-L fncn R-sqrd RsqAdj |
| Constants only. Must be computed directly. |
| Use NLOGIT ;...; RHS=ONE $ |
| Response data are given as ind. choice. |
| Number of obs.= 3925, skipped 0 bad obs. |
+---------------------------------------------+
+---------+--------------+----------------+--------+---------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] |
+---------+--------------+----------------+--------+---------+
C2 -.2663306962 .12268521 -2.171 .0299
CNPG -.5192644722E-01 .55200724E-01 -.941 .3469
CTEM .9543844085E-01 .20985588E-01 4.548 .0000
CINT .2564211502 .57130348E-01 4.488 .0000
CFAC .2010000283 .30400071E-01 6.612 .0000
CTAX -.2421919430E-01 .10958630E-01 -2.210 .0271
CREP .1965589530 .18169612 1.082 .2793
CEXH .8434991488E-01 .69121601E-01 1.220 .2223
CEVE .9754254919E-01 .55469769E-01 1.758 .0787
(Note: E+nn or E-nn means multiply by 10 to + or -nn power.)
Normal exit from iterations. Exit status=0.
+---------------------------------------------+
| Random Parameters Logit Model |
| Maximum Likelihood Estimates |
| Model estimated: May 21, 2007 at 00:12:44AM.|
| Dependent variable CHOICE |
| Weighting variable None |
| Number of observations 11775 |
| Iterations completed 87 |
| Log likelihood function -2999.925 |
| Restricted log likelihood -4312.053 |
| Chi squared 2624.257 |
| Degrees of freedom 39 |
| Prob[ChiSqd > value] = .0000000 |
| R2=1-LogL/LogL* Log-L fncn R-sqrd RsqAdj |
| No coefficients -4312.0532 .30429 .30082 |
| Constants only. Must be computed directly. |
| Use NLOGIT ;...; RHS=ONE $ |
| At start values -3948.0854 .24016 .23636 |
| Response data are given as ind. choice. |
+---------------------------------------------+
+---------------------------------------------+
| Random Parameters Logit Model |
| Replications for simulated probs. = 100 |
| Halton sequences used for simulations |
| ------------------------------------------- |
| RPL model with panel has 785 groups. |
| Fixed number of obsrvs./group= 5 |
| Random effects model was specified |
| ------------------------------------------- |
| Hessian was not PD. Using BHHH estimator. |
| Number of obs.= 3925, skipped 0 bad obs. |
+---------------------------------------------+
+---------+--------------+----------------+--------+---------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] |
+---------+--------------+----------------+--------+---------+
Random parameters in utility functions
C2 1.075217537 1.2441197 .864 .3875
CNPG .2720569803 .31342523 .868 .3854
CTEM .2843338080 .12117424 2.346 .0190
CINT .3929863233 .37191855 1.057 .2907
CFAC .5622360369 .19532371 2.878 .0040
CTAX -.1727720247 .87521371E-01 -1.974 .0484
Nonrandom parameters in utility functions
CREP .4431833560 .24476960 1.811 .0702
CEXH .2055225877 .90316183E-01 2.276 .0229
CEVE .3342026667E-02 .75659190E-01 .044 .9648
Heterogeneity in mean, Parameter:Variable
C2:OLD -.3942854455E-01 .16609177E-01 -2.374 .0176
C2:GEN -.1085920005 .48927588 -.222 .8244
C2:UNI .6564092435 .49696646 1.321 .1866
C2:INC .1226827228E-04 .81746597E-05 1.501 .1334
CNPG:OLD -.4951551004E-02 .43622492E-02 -1.135 .2563
CNPG:GEN -.8628792321E-01 .12957477 -.666 .5055
CNPG:UNI -.5875244064E-01 .13395609 -.439 .6610
CNPG:INC -.5862173776E-06 .21029477E-05 -.279 .7804
CTEM:OLD -.2798302276E-02 .16941507E-02 -1.652 .0986
CTEM:GEN -.1016663631E-01 .48672625E-01 -.209 .8345
CTEM:UNI -.9508708540E-02 .51551647E-01 -.184 .8537
CTEM:INC .8759373514E-06 .80704690E-06 1.085 .2778
CINT:OLD -.3227159342E-02 .50865164E-02 -.634 .5258
CINT:GEN .2371150816 .15674834 1.513 .1304
CINT:UNI -.7893586621E-01 .16537162 -.477 .6331
CINT:INC -.1900121273E-05 .24989246E-05 -.760 .4470
CFAC:OLD -.5237950787E-02 .27175897E-02 -1.927 .0539
CFAC:GEN -.9116722591E-01 .77305532E-01 -1.179 .2383
CFAC:UNI .4048481528E-02 .79532293E-01 .051 .9594
CFAC:INC .7875725277E-06 .12739218E-05 .618 .5364
CTAX:OLD .1539969693E-03 .12211236E-02 .126 .8996
CTAX:GEN .1622910026E-01 .37443357E-01 .433 .6647
CTAX:UNI .4625877590E-01 .38479590E-01 1.202 .2293
CTAX:INC .6640594438E-06 .62969174E-06 1.055 .2916
Derived standard deviations of parameter distributions
NsC2 4.017164742 .24138858 16.642 .0000
NsCNPG .3210807778 .15041239 2.135 .0328
NsCTEM .5380942876E-01 .88241729E-01 .610 .5420
NsCINT .6355227859 .12125596 5.241 .0000
NsCFAC .4276296049E-01 .19602661 .218 .8273
NsCTAX .1020525972 .39258483E-01 2.600 .0093
(Note: E+nn or E-nn means multiply by 10 to + or -nn power.)
--> Create ;LL_SD=log(prob_sd)*choice$ ?choice is 0 or 1 (the indicator
for the chosen options)
--> Calc ;list ;sum(LL_SD)$
Result = -.39096698358844520D+04
At 12:00 PM 18/05/2007 +1000, you wrote:
>Message: 2
>Date: Thu, 17 May 2007 05:04:00 -0500
>From: William Greene <wgreene at stern.nyu.edu>
>Subject: Re: [Limdep Nlogit List] LL values in LIMDEP
>To: Limdep and Nlogit Mailing List <limdep at limdep.itls.usyd.edu.au>
>Message-ID: <e62ac445628a.464be240 at stern.nyu.edu>
>Content-Type: text/plain; charset=us-ascii
>
>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
> > _______________________________________________
More information about the Limdep
mailing list