[R] System is computationally singular and scale of covariates

Stephan Lindner lindners at umich.edu
Sun Aug 16 01:15:25 CEST 2009

Dear all,

I'm running a self-written numerical optimization routine (hazard
model) which includes computing the inverse of the outer product of
the score. I have been getting the above error message ("System is
computationally singular"), and after some tweaking, I realized that
these variables have some high numbers and the problem could be
circumvented by scaling them down (i.e. dividing them by 100 or taking

Since this is obviously not the best procedure, and since I have to
estimate more complex models down the rode, I would like to understand
better the reason which causes this problem. It is not a
multicollinearity issue (I get the error even when using one single
variable), and I think my code is clean (better be paranoid
though). My sense is that the outer product just becomes large, and
these are hard to invert. Maybe there are restrictions concering R in
the size of the numbers? If that is the case, I think I would fare
better scaling down the outer product rather than the variable itself,
but I first wanted to ask the community to get and understanding of
what could be the problem. 

Thanks a lot,

	Stephan Lindner

Stephan Lindner
University of Michigan

More information about the R-help mailing list