[R-sig-ME] non-positive definite matrix
David Atkins
datkins at u.washington.edu
Wed Jul 21 18:32:20 CEST 2010
Hi Tim--
All methods in the lme4 package (i.e., lmer, glmer, nlmer) use iterative
optimization routines. You can see the iterations if you set "verbose =
TRUE". It is true that linear mixed models are easier to fit, but it is
still an iterative fitting procedure.
I have received the error you mention several times, which always (I
believe) stemmed from one of two sources:
1. There was redundancy in the fixed-effects.
2. I was trying to fit a very complicated model to not so much data.
As a proposed "solution" for either 1 or 2 above, I'd suggest starting
with a very simple model and work up slowly. Ideally, you could
diagnose quickly where the error occurs -- that is, is there some
predictor or random-effect that seems to trigger the error when it
enters the model.
If those don't seem helpful or not relevant, then more info about your
data, your model, and ideally a reproducible example will get you a lot
more helpful responses.
[Hope your staying cool in Thousand Oaks...]
cheers, Dave
Tim wrote:
Hello,
I'm trying to use lmer to fit a linear mixed effects model to some data.
Unfortunately, lmer fails, saying "Error in mer_finalize(ans) : Downdated
X'X is not positive definite." While this may be a problem with my setup,
I've looked over it several times, so I think this is more likely a result
of my data. A quick search of the internet suggests that sometimes, the
random errors in real data are such that the resulting matrices are
mathematically unacceptable.
My one thought is that I might be able to avoid this problem by using a
function which fits a model via iteration/optimization. Based on a very
rough understanding of lmer, from Bates's book, my impression is that
*linear* mixed models are fit via some matrix method (akin to vanilla
least-squares regression), while generalized mixed models are fit via
optimization (similar to glm). If this is true, then if I could get glmer
to fit my lmm via optimization, then perhaps I could fit this model to my
data without needing to tweak the data.
I would greatly appreciate any thoughts or advice any of you might have on
this problem. Thanks,
Tim Handley
Fire Effects Monitor
Santa Monica Mountains National Recreation Area
401 W. Hillcrest Dr.
Thousand Oaks, CA 91360
805-370-2300 x2412
--
Dave Atkins, PhD
Research Associate Professor
Department of Psychiatry and Behavioral Science
University of Washington
datkins at u.washington.edu
Center for the Study of Health and Risk Behaviors (CSHRB)
1100 NE 45th Street, Suite 300
Seattle, WA 98105
206-616-3879
http://depts.washington.edu/cshrb/
(Mon-Wed)
Center for Healthcare Improvement, for Addictions, Mental Illness,
Medically Vulnerable Populations (CHAMMP)
325 9th Avenue, 2HH-15
Box 359911
Seattle, WA 98104
http://www.chammp.org
(Thurs)
More information about the R-sig-mixed-models
mailing list