[R-sig-Geo] (no subject)

Lata Rafael Rafael.Lata at ait.ac.at
Mon Aug 2 10:54:35 CEST 2010


Dear all,

 

I have a problem converting a large binary sparse weight matrix (62025 *

62025) of class dgTMatrix to listw.

 

First I create a sparse weight matrix with the code: 

 

###weightsparse###

Wmatrix<-as_dgRMatrix_listw(Reg255.listw)

 

Since I want to model spatial autocorrelation in spatial interaction data (Poisson Spatial Interaction Model with the Moran eigenvector GLM filtering  approach)I used the kronecker product and the identity Matrix to represent network spatial autocorrelation between origin–destination dyads:

 

 

I<-as_dsCMatrix_I(255)

Wo<-kronecker(I,Wmatrix)

Wd<-kronecker(Wmatrix,I)

Wod<-Wo+Wd

 

I tried to convert this sparse matrix (Wod) to a matrix but I got an error (too many elements).

 

Is there a function that creates a listw object from a sparse matrix?

 

Thank you in advance.

 

Best regards

Rafael



More information about the R-sig-Geo mailing list