Dear Richard,
although I am co-author of some (other) parts of 'plm', my understanding
of GMM methods is still rudimentary. Yet I have tried a quick exercise
replicating Example 18.5 in Greene's "Econometric Analysis" (5th
ed.)
like this
## retrieve data from the book's site here
http://www.stern.nyu.edu/~wgreene/Text/tables/TableF18-1.txt
## then discard first (empty) column; I did it in Excel, I must confess
Muni <- read.table(file="TableF18-1.txt",h=T)
## estimate model
munimod <- pgmm(dynformula(expend ~ revenue + grants,
lag=list(3,3,3), log=F),
data=Muni,
gmm.inst=~expend,
lag.gmm=list(c(2,99)),
effect="twoways",
model="twosteps")
and it looks like working at first try. Sure I'm putting the wrong lags
w.r.t. the original paper, but I get no crashes. So there *are* other
working examples after all :^)
Please consider that the GMM estimator is justified by N-asymptotics,
while in your Grunfeld example you have N=10. This looks like the wrong
dataset to begin with: I'm not surprised you get a singular matrix
somewhere...
I've sent an email to the maintainer anyway. Please next time consider
dropping him a line directly, as your post in the crowded r-help could
easily have been overlooked. We value user feedback.
Best,
Giovanni
############# original message ###################
Message: 61
Date: Sun, 8 Mar 2009 10:06:12 +0100
From: Richard Foltyn <richard.foltyn at gmail.com>
Subject: [R] singular matrices in plm::pgmm()
To: r-help at r-project.org
Message-ID:
<f63c7e6e0903080106p4ff499c3ob710c461715b2620 at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Hi list,
has anyone succeeded in using pgmm() on any dataset besides
Arellano/Bond's EmplUK, as shown in the vignette? Whatever I try, I
eventually get a runtime error because of a singular matrix at various
points in pgmm.diff() (which gets called by pgmm()).
For example, when estimating a "dynamic" version of the Grunfeld data:
data(Grunfeld, package="Ecdat")
grun <- pgmm(dynformula(inv ~ value + capital, lag=list(1,1,1), log=T),
data=Grunfeld, gmm.inst=~log(inv), lag.gmm=list(c(2,5)),
model="twosteps")
Error in solve.default(suml(A2)) :
system is computationally singular: reciprocal condition number 8.83721e-21
I read all the documentation available and tried stepping through the
source code, but pgmm.diff() is not exactly the easiest function to
understand, especially given R's suboptimal debugging facilities.
Please let me know if you had better luck with your estimation.
Thanks,
Richard
#################################################
Giovanni Millo
Research Dept.,
Assicurazioni Generali SpA
Via Machiavelli 4,
34132 Trieste (Italy)
tel. +39 040 671184
fax +39 040 671160
Ai sensi del D.Lgs. 196/2003 si precisa che le informazi...{{dropped:13}}