Hi Mark,
The problem you're having is that the estimated covariance matrix of
your data is singular, or non-invertible. Thus, when Amelia tries to
invert the matrix to obtain imputations, things fall apart. This can
happen for a number of reasons, but it is usually due to some sort of
(nearly) linear dependence in the columns of the data. This can happen
if there are linear functions of other variables (a common problem
here is accidentally leaving all of the dummies for a categorical
variable in the model).
One way to track down the problem variables is the following:
svd(data)$d < .0005
The values that are TRUE from this output correspond to the variables
in the dataset that are causing problems (0.0005 is ad hoc, you're
just looking for really small values).
If this isn't the problem, it is possible that there is too little
data to estimate the covariance matrix. You can always add what we
call the empirical or ridge prior that makes estimation easier when
the covariance matrix is nearly singular. The argument for this is
"empri" and a good value to start with is 1% of the rows of the data.
One more issue is that it is possible that your choice of prior could
be leading the algorithm into parts of the parameter space with
singular covariance matrices, especially if you are putting strong
priors on the variables. This is especially possible if you are
putting variable-wide priors (as you are doing). If you are trying to
impose logical constraints on the data, it might be preferable to to
transform the variable onto an unbounded scale, impute and then
retransform. This allows the constraints to bind without necessarily
putting heavy prior beliefs on the model. (I sent an email to the list
a few weeks ago detailing how this might be done for more complex
cases).
Lastly, we're trying to put together some more informative error
messages for this problem. Sorry for the crypticism.
Hope that helps,
matt.
On Sun, Mar 16, 2008 at 6:51 PM, Mark Manger <mark.manger(a)mcgill.ca> wrote:
Hi (and especially, Hi Matt!)
I'm getting the (known) error
Error in chol.default(copy.theta[c(FALSE, m[ss, ]), c(FALSE, m[ss, ])]) :
the leading minor of order 6 is not positive definite
whenever I try to set a distribution or range prior for a whole variable
in AmeliaView. I know this has been discussed before, but no solution
was sent to the list... what's the problem here? I'm using Amelia II
version 1.1-27 and the latest version of R.
Here's my session file:
`amelia.list` <-
structure(list(amelia.args = structure(list(outname = "blimputationbig",
m = 5, empri = 0, ts = 2, cs = 1, am.filename =
"H:/mmanger/Data/blsmallv3.dta",
file.type = 2, lags = c(8L, 9L, 10L, 13L), leads = 8:10,
polytime = 2, intercs = 0, output.select = 4, priors = structure(c(0,
0, 3, 6, 0.97, 5.9, 6.9, 2.05), .Dim = c(2L, 4L), .Dimnames = list(
c("newPrior", "newPrior"), c("",
"polity", "", "")))), .Names =
c("outname",
"m", "empri", "ts", "cs",
"am.filename", "file.type", "lags",
"leads", "polytime", "intercs", "output.select",
"priors"))), .Names =
"amelia.args")
Any help would be greatly appreciated.
--Mark
--
Mark S. Manger, PhD
Assistant Professor
Department of Political Science, McGill University
mark.manger(a)mcgill.ca
on leave 2007-08:
Advanced Research Fellow, Program on US-Japan Relations
Weatherhead Center for International Affairs
Harvard University
61 Kirkland Street, Room 301
Cambridge, MA 02138
617-495-5998
--
Mark S. Manger, PhD
Assistant Professor
Department of Political Science, McGill University
mark.manger(a)mcgill.ca
on leave 2007-08:
Advanced Research Fellow, Program on US-Japan Relations
Weatherhead Center for International Affairs
Harvard University
61 Kirkland Street, Room 301
Cambridge, MA 02138
617-495-5998
-
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: