[R] maximum likelihood convergence reproducing Anderson Blundell 1982 Econometrica R vs Stata

Berend Hasselman bhh at xs4all.nl
Tue May 10 21:34:51 CEST 2011


Alex Olssen wrote:
> 
> Wow that is really interesting,
> 
> Sorry I was asleep when you emailed these.
> 
> And yes, of course, I had been trying to implement model 18, not 18s,
> that was a typo, sorry.
> 
> I will have a look at the code you posted.
> 
> Thanks,
> 
> Alex
> 

I have run nlm with a zero starting vector on model 18.


> start.zero <- rep(0,8)
> 
> q.zero <- nlm(p=start.zero, f=lnl, hessian=TRUE, gradtol=1e-15,
+                  y1=y1, y2=y2, x1=x1, x2=x2, x3=x3)
> 
> q.zero
$minimum
[1] -76.73878

$estimate
[1] -0.68124025  0.28686058 -0.15394903 -0.06173779  1.30304998 -0.25446946
[7]  0.14531856  0.05349810

$gradient
[1]  0.0001356761  0.0014407493  0.0013240913  0.0006367333 -0.0005172628
[6] -0.0051911383 -0.0044429086 -0.0019081432

$hessian
          [,1]     [,2]     [,3]      [,4]      [,5]     [,6]     [,7]
[1,]  197993.1  1982843  1746582  807261.9  135628.5  1355944  1194854
[2,] 1982842.8 19766730 17430209 8084282.7 1357883.8 13506353 11915748
[3,] 1746581.8 17430209 15376070 7138194.2 1196134.9 11911149 10512490
[4,]  807261.9  8084283  7138194 3323204.7  552932.9  5526861  4882154
[5,]  135628.5  1357884  1196135  552932.9  271571.7  2713953  2391658
[6,] 1355943.5 13506353 11911149 5526860.9 2713953.0 26956003 23785984
[7,] 1194854.2 11915748 10512490 4882154.2 2391658.1 23785984 20996480
[8,]  552860.7  5534816  4887292 2275676.3 1106862.5 11057031  9768028
           [,8]
[1,]   552860.7
[2,]  5534816.0
[3,]  4887292.4
[4,]  2275676.3
[5,]  1106862.5
[6,] 11057030.7
[7,]  9768027.6
[8,]  4554570.6

$code
[1] 2

$iterations
[1] 68

> 
> q.zero$estimate
[1] -0.68124025  0.28686058 -0.15394903 -0.06173779  1.30304998 -0.25446946
[7]  0.14531856  0.05349810

Quite different from what you get if one starts with AB's model 18 results
of Table II.
I have also used Gretl's FIML procedure to estimate the model (I don't know
what starting values Gretl uses).
The results are very similar to those obtained with nlm as above.

Berend

--
View this message in context: http://r.789695.n4.nabble.com/maximum-likelihood-convergence-reproducing-Anderson-Blundell-1982-Econometrica-R-vs-Stata-tp3502516p3512807.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list