[R-sig-Geo] Converge problems with spgwr

Corey Sparks corey.sparks at UTSA.EDU
Sat Mar 28 13:51:36 CET 2009


The problems is that you are sending the bandwidth (percentage) to  
the wrong argument of gwr

try:
coords<-cbind(data$X_COORD, data$Y_COORD)
percentage<-gwr.sel(Y ~ X1 + X2, data = data, coords = coords,  
adapt=TRUE, longlat=TRUE)
adaptive.model<-gwr(Y ~ X1 + X2, data = data, coords = coords,  
adapt=TRUE, bandwidth=percentage, longlat=TRUE)

that should do the trick
Corey

I'm trying to fit an adaptive GWR model using the spgwr package but  
ran into some problems.
Specifically, what I'm trying to do is to plug the optimal percentage  
generated by the gwr.sel function into the gwr function.
This is my model's layout:

coords<-cbind(data$X_COORD, data$Y_COORD)
percentage<-gwr.sel(Y ~ X1 + X2, data = data, coords = coords,  
adapt=TRUE, longlat=TRUE)
adaptive.model<-gwr(Y ~ X1 + X2, data = data, coords = coords,  
adapt=percentage, longlat=TRUE)

But the gwr.sel function won't pass a value to the gwr function.  It  
seems that gwr.sel fails to converge.  It just stops without giving  
any error messages.
This is the output I've got:

Adaptive q: 0.381966 CV score: 4.635847e+14
Adaptive q: 0.618034 CV score: 4.969922e+14
Adaptive q: 0.236068 CV score: 4.256574e+14
Adaptive q: 0.1458980 CV score: 3.818798e+14
Adaptive q: 0.09016994 CV score: 3.386485e+14
Adaptive q: 0.05572809 CV score: 2.959508e+14
Adaptive q: 0.03444185 CV score: 2.516265e+14

Are there any known issues with the gwr.sel function?

Corey Sparks
Assistant Professor
Department of Demography and Organization Studies
College of Public Policy
One UTSA Circle
San Antonio, TX 78239
corey.sparks at utsa.edu



More information about the R-sig-Geo mailing list