GLM model failure; singular matrix 'a' in solve

4,444 views
Skip to first unread message

Michelle Fink

unread,
Mar 31, 2014, 1:37:24 PM3/31/14
to vistrai...@googlegroups.com

GLM with squared terms failed with the following error on one of my habitat models:

Error in qr.solve(qr.R(qr.lm(object))[p1, p1]) :
  singular matrix 'a' in solve
Calls: FitModels ... predict -> predict -> predict.glm -> predict.lm -> qr.solve
In addition: There were 50 or more warnings (use warnings() to see the first 50)
Execution halted
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

The BRT ran successfully (with 6 warnings). We're going with the BRT models anyway, but just wanted to check in with y'all on whether this error means a problem in the data that I ought to ferret out and fix.

--Michelle

marian.k...@gmail.com

unread,
Mar 31, 2014, 2:54:50 PM3/31/14
to vistrai...@googlegroups.com
That's a problem with the data.  R can't take an inverse of your matrix.  If I remember correctly we usually see it with under representation of one of the response types (you might have a low number of presence or absence), a large number of predictors or a combination of the two.  

Michelle Fink

unread,
Mar 31, 2014, 3:06:57 PM3/31/14
to vistrai...@googlegroups.com
Thanks Marian. That's puzzling, this habitat's inputs aren't much different than any of the others. 274 presence & 2,146 absence. The models started out with 17 predictors & GLM whittled it down to 4. I've had systems with fewer presence points & the same number of initial predictors run OK. I'll take a look at the predictor value spread across the presence points & see if anything odd shows up there.
Reply all
Reply to author
Forward
0 new messages