LOGL - hprobit1.prg

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

Herman
Posts: 4
Joined: Tue Sep 14, 2010 10:43 am

LOGL - hprobit1.prg

Postby Herman » Wed Sep 15, 2010 1:46 am

Hello,

based on EViews 7 I am trying to estimate a probit model with heteroskedasticity for a panel data workfile. The program is based on the example "hprobit1.prg" and I only adjusted the code to work with my data. Starting values are based on the "simple" binary regression. Running the program generates the error message:
"Missing values in @logl series at current coefficients at observation XXX in Do LL1.ML(...)"

I checked all relevant series:
surprise_1_2 - no missing values, no lagged values
d_7_2 - no missing values, no lagged values
OC_bin_7 - Limited to non-NA observations due to "smpl if (OC_bin_7<>NA)"

The program still reports missing values, but I am not sure where to check for missing values. Does anyone know how to handle this problem or has any advice on this logl?

Thank you


Code:


'starting values based on binary regression
smpl if (OC_bin_7<>NA)

equation example.binary(d=n,h) OC_bin_7 c surprise_1_2 d_7_2
coef(3) beta
beta(1)=example.@coefs(1)
beta(2)=example.@coefs(2)
beta(3)=example.@coefs(3)

smpl @all
coef(2) gam
gam(1)=1
gam(2)=2


' specify the likelihood
logl ll1
ll1.append @logl logl1
ll1.append index=(beta(1)+beta(2)*surprise_1_2+beta(3)*d_7_2)/exp(gam(1)*surprise_1_2+gam(2)*d_7_2) 'create residuals
ll1.append mills=@dnorm(index)*(OC_bin_7-@cnorm(index))/@cnorm(index)/(1-@cnorm(index)) 'create var
ll1.append logl1=OC_bin_7*log(@cnorm(index))+(1-OC_bin_7)*log(1-@cnorm(index))

' specify analytic derivatives
ll1.append @deriv beta(1) grad1 beta(2) grad2 beta(3) grad3 gam(1) grad4 gam(2) grad5
ll1.append grad1 = mills/exp(gam(1)*surprise_1_2+gam(2)*d_7_2)
ll1.append grad2 = grad1*surprise_1_2
ll1.append grad3 = grad1*d_7_2
ll1.append grad4 = mills*surprise_1_2*(-index)
ll1.append grad5 = mills*d_7_2*(-index)

' carry out MLE and display results
smpl if (OC_bin_7<>NA)
ll1.ml(showopts, m=1000, c=1e-5)

show ll1.output

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

LOGL - hprobit1.prg

Postby EViews Gareth » Wed Sep 15, 2010 7:22 am

That probably means that the likelihood went into a region where st the current coefficient values it produces an na. Adjusting starting values can sometimes fix that.

Herman
Posts: 4
Joined: Tue Sep 14, 2010 10:43 am

Re: LOGL - hprobit1.prg

Postby Herman » Wed Sep 15, 2010 8:10 am

Hello Gareth,

thank you very much. I tried to use results from the "normal" binary regression as starting values, but it doesn't work. Thus, I think I will have to "play around" with starting values or do you know any rule one can determine starting values for that ML?

Thankx again

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: LOGL - hprobit1.prg

Postby EViews Gareth » Wed Sep 15, 2010 8:17 am

Just play around with different values. You could also try removing the analytic derivatives - it might perform better without them.

Herman
Posts: 4
Joined: Tue Sep 14, 2010 10:43 am

Re: LOGL - hprobit1.prg

Postby Herman » Wed Sep 15, 2010 9:14 am

Hello Gareth,

sorry to bother you again. So I played around a little bit and got some results.

'Including Derivatives:
The problem is EViews breaks down after one iteration, which is simply based on the starting values. Starting values for beta(1) - beta(3) refer to estimation results from the "normal" model. Currently gamma (gam(1)) is only based on coefficient d_7_2.
So when I put in a starting value for d_7_2 between 0 and 0.001 Eviews breaks down after one iteration, when I put in a starting value for d_7_2 between 0.001 and 0.5 EViews reports "Division by zero" and when I put in a starting value > 0.5 EViews reports "Overflow".

PLOT:
LogL: LL1
Method: Maximum Likelihood (Marquardt)
Date: 09/15/10 Time: 18:09
Sample: 1991M12 2009M11 IF (OC_BIN_7<>NA)
Included observations: 16142
Evaluation order: By equation
Estimation settings: tol= 1.0e-05, derivs=analytic
Initial Values: BETA(1)=0.00356, BETA(2)=0.00757, BETA(3)=-0.00028,
GAM(1)=0.00100
Failure to improve Likelihood after 1 iteration

Coefficient Std. Error z-Statistic Prob.

BETA(1) 0.003560 0.010280 0.346333 0.7291
BETA(2) 0.007573 0.006541 1.157836 0.2469
BETA(3) -0.000278 4.61E-05 -6.038975 0.0000
GAM(1) 0.001000 0.000177 5.641056 0.0000

Log likelihood -11299.25 Akaike info criterion 1.400478
Avg. log likelihood -0.699991 Schwarz criterion 1.402383
Number of Coefs. 4 Hannan-Quinn criter. 1.401107




'Excluding Derivatives:
Eviews reports a result.

PLOT:
LogL: LL1
Method: Maximum Likelihood (Marquardt)
Date: 09/15/10 Time: 18:05
Sample: 1991M12 2009M11 IF (OC_BIN_7<>NA)
Included observations: 16142
Evaluation order: By equation
Estimation settings: tol= 1.0e-05, derivs=accurate numeric
Initial Values: BETA(1)=0.00356, BETA(2)=0.00757, BETA(3)=-0.00028,
GAM(1)=0.00100
Convergence achieved after 11 iterations

Coefficient Std. Error z-Statistic Prob.

BETA(1) -0.031720 0.011004 -2.882444 0.0039
BETA(2) 0.000875 0.005691 0.153658 0.8779
BETA(3) 0.000278 5.17E-05 5.382814 0.0000
GAM(1) -0.001819 0.000427 -4.258417 0.0000

Log likelihood -11150.87 Akaike info criterion 1.382092
Avg. log likelihood -0.690798 Schwarz criterion 1.383998
Number of Coefs. 4 Hannan-Quinn criter. 1.382722


My problem is, I feel a little uncomfortable on the reliability of the results without the derivatives and the input for gam(1). Do you think, based on the error messages, there is any possibility to include the derivatives in the estimation? Given the low value for gam(1), this means that there is nearly any heteroskedasticity at all?

Thank you again

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: LOGL - hprobit1.prg

Postby EViews Gareth » Wed Sep 15, 2010 9:31 am

I wouldn't trust the results you're getting. Seems like your particular model is quite difficult to estimate. I'm not sure what to suggest.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests