[R-sig-Geo] Converge problems with spgwr
Roger Bivand
Roger.Bivand at nhh.no
Sat Mar 28 16:48:53 CET 2009
On Sat, 28 Mar 2009, Corey Sparks wrote:
>
> 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
In addition, the model does have a major scaling problem, as can be seen
by the CVS scores. Consider re-scaling the variables in the model, and you
may find that gwr.sel() has an easier time.
Roger
> 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
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no
More information about the R-sig-Geo
mailing list