[Limdep Nlogit List] Latent class problems

Soren Olsen soeren_b_olsen at yahoo.com
Wed Mar 17 00:24:01 EST 2010


Dear Prof Greene,

Thanks for your fast reply.

It seems you are right, it is an issue of constants. However, I already had a constant in my model as the "optout"-variable was defined as a dummy taking value 1 only for the opt-out/status quo alternative (i.e. an alternative specific constant). I tried removing this variable from the Rhs line and adding your ;RH2=ONE instead. This didn't solve the problem. However, inspired by your suggestion, I then turned to the version where the utility function is specified using the model statement. The code I used analoguous to the one displayed in my first mail below was the following:

NLOGIT ;lhs=choose
;choices=1,2,3
;Model: U(1)=catc_m*catch_m+catc_h*catch_h+size_m*size_m+size_h*size_h+nat_m*nat_m+nat_h*nat_h+qua_m*qua_m+qua_h*qua_h
+dist_m*dist_m+dist_h*dist_h+num_m*num_m+num_h*num_h+price*p/
U(2)=catc_m*catch_m+catc_h*catch_h+size_m*size_m+size_h*size_h+nat_m*nat_m+nat_h*nat_h+qua_m*qua_m+qua_h*qua_h
+dist_m*dist_m+dist_h*dist_h+num_m*num_m+num_h*num_h+price*p/
U(3)=asc*optout
;LCM
;Prob=prob
;parameters
;maxit=200
;pds=6
;pts=2 $
 
As mentioned in the first mail, yesterday I had exactly the same problems using this version as the Rhs version. Now I tried formulating the utility for the third alternative using  U(3)=ONE instead of U(3)=asc*optout. This did the trick! I am now able to run the model using the available 2 to 5 classes (though using 3 classes returns an 806 message, 117 iterations are used, so this should no be a problem).
 
I'm of course happy that the model runs. Nevertheless, it puzzles me, as I can't really see any structural differences in the two formulations used? Thus, I just tried running my original model again, and to my big surprise, it now runs! Exactly the same model, and exactly the same data that gave me problems until now (I even copy pasted the model from the mail below just to make sure that it was the same, and I haven't touched the dataset). Does this make any sense? 
 
Best regards
Søren
 
 




________________________________
Fra: William Greene <wgreene at stern.nyu.edu>
Til: Limdep and Nlogit Mailing List <limdep at limdep.itls.usyd.edu.au>
Sendt: man, 15. marts 2010, kl. 06.21:35 PM
Emne: Re: [Limdep Nlogit List] Latent class problems

Dear Soren.
You should have constant terms in your model.
Add ;RH2=ONE to the command. That may not work, however, which
might suggest that the latent class model is not appropriate for
your data. On the results below. the 806 with 2 classes can be
taken as harmless if you have gone through a substantial number
of iterations - say more than 10. The results with 4 will be OK
if the suggested fix above gets you results with 3. Otherwise, 
you probably should not trust the 4 class results. Overall, the
singular covariance matrix suggests to me that at least one of
the classes is ending up with a trivial amount of mass, meaning
that there are too many classes.
B. Greene

----- Original Message -----
From: "Soren Olsen" <soeren_b_olsen at yahoo.com>
To: limdep at limdep.itls.usyd.edu.au
Sent: Monday, March 15, 2010 8:41:49 AM GMT -05:00 Colombia
Subject: [Limdep Nlogit List] Latent class problems

Dear all,

I'm experiencing some problems with a latent class model:

NLOGIT ;lhs=choose
;choices=1,2,3
;Rhs=catch_m,catch_h,size_m,size_h,nat_m,nat_h,qua_m,qua_h,dist_m,dist_h,num_m,num_h,p,optout
;LCM
;Prob=prob
;parameters
;maxit=200
;pds=6
;pts=2 $
 
My problem is that when I specify two classes as above, I get the following error message (though it does produce some results, I guess I shouldn't trust them):
Error 806: (The log likelihood is flat at the current estimates.)

When I use three classes (pts=3), I get another error message (and no results produced):
Error 1027: Models - estimated variance matrix of estimates is singular

However, when I use four classes (pts=4), it runs nicely and produces results that make very good intuitive sense, and everything looks ok.

With five classes (pts=5), I again get the following message:
Error 1027: Models - estimated variance matrix of estimates is singular
 
Now, I guess I actually have two questions:
1) Should I trust the results that I get with four classes? 
2) Why wont the other models run?

I should add that I have run RPL and EC models on exactly the same data and using the same utility function without any problems, so I guess my dataset is set up as it should be. I have tried specifying the utility functions using the model statement, but this didn't help

Any suggestions and help is much appreciated.

Regards
Søren

__________________________________________________
Bruger du Yahoo!?
Er du træt af spam?  Yahoo!Mail har den bedste spambeskyttelse, der findes 
http://dk.mail.yahoo.com 
_______________________________________________
Limdep site list
Limdep at limdep.itls.usyd.edu.au
http://limdep.itls.usyd.edu.au
_______________________________________________
Limdep site list
Limdep at limdep.itls.usyd.edu.au
http://limdep.itls.usyd.edu.au

__________________________________________________
Bruger du Yahoo!?
Er du træt af spam?  Yahoo!Mail har den bedste spambeskyttelse, der findes 
http://dk.mail.yahoo.com 


More information about the Limdep mailing list