[Limdep Nlogit List] Using maximize

William Greene wgreene at stern.nyu.edu
Wed Nov 7 06:49:15 EST 2007


Bob. You are taking the log of Phi(...).  The argument being
sent to the PHI function is (apparently) less than (roughly)
-10, and it is returning zero.  Or, the argument is very large,
and it is returning a 1.0, which then transformed to 1-Phi()
where logs appear once again.  Finally, your parameter 
GE is not constrained to be positive, and you are taking logs of it.                                                                                                       
/Bill

----- Original Message -----
From: "Robert Nakosteen" <nakosteen at som.umass.edu>
To: limdep at limdep.itls.usyd.edu.au
Sent: Tuesday, November 6, 2007 2:32:15 PM (GMT-0500) America/New_York
Subject: [Limdep Nlogit List] Using maximize

Greetings,

 

I have written the following program in Limdep, and created a small data set
with which to test it. 

 

? Recursive model with first stage OLS and second stage Probit: Hausman and
Wise 1979

 read; nrec=31; nvar=10; names=distance, hearn, heduc, hage, unem, child,
wage, weduc, wearn, Dummy; maxvar=50$

 0 100 10 30  8  5 18  9  80 0

 0 118 11 36  6  3 19  9  75 0

 0 120 11 40 12  2 19 10  90 1 

 0 125 12 19 11  6 20 10  95 0

 0  90 13 26  7  8 20 12  98 0

 0 110 12 50  5  4 22 11  90 1

 0 116 14 65  3  2 22 12  90 1

 0 119 13 21 11  2 25 12 100 1 

 0 140 10 40  9  1 25 13  89 1

 0 125  9 28  8  6 27 13 110 0

 0 129 13 70  8  7 30 13 120 0

 0 127 12 29  6  5 32 13 118 1

 0 129 16 40 11  6 32 14 116 0

 0 142 12 45  6  3 35 14 119 0

 0 130 11 38  4  2 39 15 122 1

 5 140 10 40  9  5 42 14 131 1

 5 141 12 29 13  3 43 14 129 1

 5 120 13 30 14  3 43 15 127 1

 5 136 14 22  9  2 45 16 126 0

 5 150 14 28  8  1 49 17 130 1

10 160 14 36 11  1 52 17 140 1

10 168 16 29 14  3 55 18 135 1

10 170 16 40 13  1 55 18 133 1

10 160 15 33 16  4 58 17 136 1

10 159 13 37  9  2 59 16 139 0

15 170 15 28 14  0 60 15 150 1

15 170 15 28 14  0 62 16 149 1

15 200 17 40 16  1 65 17 148 0

15 180 16 22 14  3 67 14 148 0

15 178 15 20 13  2 67 13 146 1

15 190 19 27 10  4 68 12 130 1

namelist; x = one,hage,heduc; ? variables on the rhs of the earnings
equation 

          z = one,wearn,child,unem$ ? exog variables on the right hand side
of the Probit equation

dstats; rhs=*$

? single equation estimates to get starting values - use a guess for the
covariance

regress; lhs=hearn; rhs=x$

Probit; lhs = dummy; rhs=z,hearn$

?

maximize; fcn = bx   = b0 + b1*hage + b2*heduc

              | gz   = g0 + g1*wearn + g2*child + g3*unem

              | P1   = a*b0 + a*b1*hage + a*b2*heduc + gz

              | P2   = a*se*se

              | P2   = P2 + sew

              | P2   = P2/(se*se)

              | P2a  = P2*(hearn-bx)

              | P31  = a*a*se*se

              | P31  = P31 + 2*a*sew +1

              | P32  = (P2 + sew)^2

              | P32  = P32/(se*se)

              | P3   = sqr(P31-P32)

              | PhiA = Phi((P1 + P2a)/P3)

              | ge   = N01((hearn - bx)/se)/se

              | L1   = log(PhiA)

              | L2   = log(1-PhiA)

              | L3   = log(ge)

              | dummy*(L1 + L3) + (1-dummy)*(L2 + L3);

           labels = b0,b1,b2,g0,g1,g2,g3,a,se,sew;

           start =  43.6,-0.25,8.07,2.00,0.01,-0.40,0.03,-0.02,20,0.10$ 

Stop$

 

 

 

I  get the following error messages when I run the program:

 

Error:   590: Obs.=     1 Cannot compute function: Logminus

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

Error:   802: Cannot compute function at start values. Exit status=4.

Function=  .19226648919D+02, at entry,  .00000000000D+00 at exit

Error:   590: Obs.=     1 Cannot compute function: Logminus

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

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

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

 

Since nothing I am logging takes on a negative value, I am stymied.

 

Can anyone help?

 

Robert A. Nakosteen

Professor

Isenberg School of Management

University of Massachusetts/Amherst

Amherst, MA  01003

 

Telephone:  413-545-5687

FAX: 413-545-3858

 

Fin-opmgtfaculty mailing list

Fin-opmgtfaculty at som.umass.edu

https://list.umass.edu/mailman/listinfo/fin-opmgtfaculty

 

_______________________________________________
Limdep site list
Limdep at limdep.itls.usyd.edu.au
http://limdep.itls.usyd.edu.au


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




More information about the Limdep mailing list