Anders,
Clearly the code is crashing out, and that is something I would like to
fix. If you have the ability to send me the dataset I'll find out exactly
what is going on.
However, in the short term, the "!" sign, which you see after every
iteration denotes that covariance matrix created at the end of the E-step
is not positive definite. Sometimes this happens with EM algorithms, and
generally they get back into positive definite territory after a couple
iterations and it is nothing to worry about if it is early in the chain.
In your case, from the end of step one until things crash, you never leave
a non-positive definite space. My guess then is poor starting values for
the EM chain. I don't see starting values modified as an option in your amelia()
call.
You might try amelia(...,startvals=1).
The default of "startvals=0" uses the covariance matrix of the
list-wise deleted dataset. Changing to "startvals=1" uses an identity
matrix, after a normalizing transformation where all variables have mean
0, variance 1. Thus, the starting value is essentially the observed
variances in the incomplete dataset, and covariances equal to 0. If there
are not enough observations to use startvals=0, amelia automatically
switches to startval=1. Therefore, it's possible that making this change
in your options will have zero effect, as it is already being done by
necessity. There are more complicated ways of creating starting values if
this change still does not work for you.
Anyway, in short, I'd like to get this error fixed so that such a problem
never crashes the code in future (so send me your dataset if that is
allowable/convenient), but changing the starting values of the EM chain is
a probable way to get you up and running in your particular case.
(Thanks for sending the p2s=2 screen output. That is what showed what the
root cause of the problem was. I'm not sure all the commenting symbols
like the "!" you found are in the current manual, but they will be in the
next draft.)
Just as a final note, it looks like your dataset is very large--at
least 96 variables BEFORE adding polynomials of time interacted with
cross-section. Getting up there. Computationally, I'm not certain what
the upper bound is on the current algorithm. Although it was engineered
with large datasets specificially in mind, someone always has something
even larger. A useful approach (which you may already have tried) is to
start with a pared-back dataset and then keep adding subsets of variables
and see which are giving you problems. That might jog your thinking about
whether you are accidentally violating any of the linearity and
identification assumptions.
regards,
James.
On Sun, 6 Jan 2008, Anders Schwartz Corr wrote:
Hi,
I got the following error message from Amelia:
ameliaoutput10<-amelia(merge24,
p2s=2,lgstc=c(8,9,33,40,82:96),ords=c(10,37,38,39,49,50,51,52,53,72:81),
logs=c(3:7,25,26,29,36,41:47,54:71),ts=1,cs=2,polytime=2,intercs=TRUE,
archive=TRUE)
amelia starting
beginning prep functions
running bootstrap
-- Imputation 1 --
setting up EM chain indicies
1(347357!) 2(51802!) 3(45797!) 4(40634!) 5(46795!) 6(40806!) 7(40043!)
8(35876!) 9(33598!)10(34136!)
11(28776!)12(25746!)13(23438!)14(21293!)15(30009!)16(32754!)17(24128!)18(23706!)19
Loading required package: foreign
Error in e[e > tol] <- 1/e[e > tol] :
NAs are not allowed in subscripted assignments
Calls: amelia -> emarch -> emfred -> amsweep -> mpinv
Execution halted
Any suggestions?
Thanks,
Anders
-
Amelia mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive:
http://lists.gking.harvard.edu/?info=amelia
-
Amelia mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive:
http://lists.gking.harvard.edu/?info=amelia