[Limdep Nlogit List] Endogenous Stratification- Help with Code

Peter Edwards pedwards at UDel.Edu
Wed Sep 24 12:12:54 EST 2008


Hello All

I am still trying to figure out how to get the code to work for a log 
likelihood function for an on site travel cost study.

I am trying to model the data using a negative binomial regression including 
accounting for overdispersion and endogenous stratification.

This is the code Iv'e used for overdispersion as per the Limdep Manual and 
Greene's text.

NAMELIST; X=ONE,TRIPCST4,BIRDHRS,AGE,GENDER,EDUC,INC0000,EQUIP00$

calc; k=Col(x)$

create;y=totaltri$

negbin;Lhs=Y;Rhs=X$

Matrix; b0=b;t0=1/alpha$

Calc; q0=0$

maximize;start=b0,t0,q0

;labels=k_b,t,q

;Fcn=a1=Exp(b1'x) |

tlq=t*(a1^q) |

w=tlq/(a1+tlq) |

Lgm(y+tlq)-Lgm(tlq)-Lgm(y+1)+tlq*Log(w)+y*Log(1-w)$

This liklihood function works fine.


However when I adjust the code (see below) to account for endogenous 
stratification as per the literature (Haab and McConnell 2002, page 181)


Matrix; b0=b;t0=1/alpha$
Calc; q0=0$

maximize;start=b0,t0,q0

;labels=k_b,t,q

;Fcn=a1=Exp(b1'x) |

tlq=t*(a1^q) |

w=tlq/(a1+tlq) |

y*Lgm(y+tlq)-Lgm(tlq)-Lgm(y+1)+tlq*Log(w)+y*Log(1)-Log(tlq+Exp(b1'x))+(y-1)*log(exp(b1'x))$



I get the following message. with this ....NAMELIST; X=ONE,TRIPCST4$ or

Warning 137: Iterations: function not computable at crnt. trial estimate

Error 590: Obs.= 1 Cannot compute function: GMA of-#

Maximum iterations reached. Exit iterations with status=1.

Error 143: Models - estimated variance matrix of estimates is singular

Error 447: Current estimated covariance matrix for slopes is singular.



And the following messages with this...  NAMELIST; 
X=ONE,TRIPCST4,BIRDHRS,AGE,GENDER,EDUC,INC0000,EQUIP00$

Warning 137: Iterations: function not computable at crnt. trial estimate

Line search does not improve fn. Exit iterations. Status=3

Check derivatives (with ;OUTPUT=3). This may be a solution

if several iterations have been computed, not if only one.

Error 806: (The log likelihood is flat at the current estimates.)

Error 143: Models - estimated variance matrix of estimates is singular

Error 447: Current estimated covariance matrix for slopes is singular.

I am not sure where I am going wrong.

I would appreciate any assistance.



PETER


++++++++++++++++++++++++++++++++
Peter E.T. Edwards
PhD. Candidate
University of Delaware
Graduate College of Marine and Earth Studies
Room 312 Robinson Hall
Newark, DE 19716
http://www.ocean.udel.edu/







More information about the Limdep mailing list