LOGL - hprobit1.prg
Posted: 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
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