Skip to content
Prev 772 / 29559 Next

2 problems with errorsarlm(method="SparseM")

On Wed, 1 Feb 2006, Martin Reismann wrote:

            
When in doubt, immediately after the error exit from an R function, type
which will list out the function calls back to the function in error. I 
think that the problem is that because of the density of your spatial 
weights matrix, chol() for sparse matrices is running out of working 
space, and that nnzlmax now needs setting (Danlin Yu reported a similar 
problem with tmpmax over a year ago).

Could you repeat the problem and then run and report traceback()? Could
you also report sum(card()) for your list of neighbours? I think your
matrix is quite dense, and knowing how dense it is will help work out how
big nnzlmax needs to be.
Why can't you use the glist= argument to nb2listw()?

Also note that method="SparseM" should only work with weights that are 
either symmetric or similar to symmetric - I'll make this clearer on the 
help page, and block style="M" for that method.

This means that symmetric general weights, like inverse distance, may be 
possible, but that both asymmetric neighbours and asymmetric general 
weights for symmetric neighbours are banned for method="SparseM" - 
obviously because chol() for sparse matrices only works when they are 
symmetric (row standardised symmetric neighbours are asymmetric weights, 
but the determinant is the same for the similar-to-symmetric version.

I guess the problem below will go away when I block the entrance.

Possibly the only weights matrix that could be tolerated is a fully 
symmetric neighbours matrix with symmetric general weights. There is 
different code in spautolm() doing much the same as errorsarlm(), but I'm 
not sure that both problems will not re-occur there until they are fixed. 
Getting nnzlmax right is possible, but chol() is just not going to work if 
the weights are neither symmetric nor similar-to-symmetric.

Roger

PS. Access to your data would speed up finding a solution, then I can run 
traceback() myself.
PPS. In R, "crash" is reserved for R itself terminating and exiting with
data loss. Here, it just reported something wrong and returned to the
prompt, so the function did its best, with no "crash" as such.