[R-sig-Geo] GWR.sel returning CV of NA, and Runtime

Danlin Yu yud at mail.montclair.edu
Sun Jul 1 18:07:00 CEST 2007


Ryan:

1. The code you are giving actually doesn't use an adaptive kernel. You 
need to turn the adpt = True parameter on (its default is False), it 
should read like this:

col.d <- gwr.sel
(ResponseTime~IsRural+IsSemiRural,data=sb,coords=cbind(sb$Longitude,sb$Latitude),adapt = True, gweight= gwr.bisquare,longlat=TRUE)


2. Without seeing your data, it's hard to see why an "NA" is returned 
for your CV score, probably there is something wrong with your 
coordinates? Since you mentioned you were using like 19,000 data points, 
and using long. and lat. as coordinates. For 19,000 data points, I 
assume that they are very close to one another in space (in a city?), 
and the long. and lat. are recorded in decimal degrees? If so, one 
probability is that when the coordinates were generated by either R or 
some other program (ArcGIS, maybe?), due to trunctuation of the 
significant decimal points, coordinates for some points that are very 
close to one another might have the same values. This could be a 
problem. Maybe Roger can give more insights?

3. If you don't want to see the results being printed to the screen, you 
need to turn the verbose parameter off (its default is True), hence the 
code will read like this:

col.d <- gwr.sel
(ResponseTime~IsRural+IsSemiRural,data=sb,coords=cbind(sb$Longitude,sb$Latitude),adapt = True, gweight= gwr.bisquare,verbose=False, longlat=TRUE)

4. And yes, gwr is very time comsuming (not only gwr.sel). For 19,000 
data points, even using the cross-validation score method, it'll take a 
very long time even on a high speed machine. If you are using the AIC 
method (which is actually preferred), I am not even sure the code will run.

Hope this helps.

Cheers,
Danlin Yu

R R R wrote:

>Hi,
>
>I am trying to use a spatially adaptive kernel in spgwr and I have some
>questions.
>
>I am using the following code:
>col.d <- gwr.sel
>(ResponseTime~IsRural+IsSemiRural,data=sb,coords=cbind(sb$Longitude,sb$Latitude),gweight=
>gwr.bisquare,longlat=TRUE)
>
>First, I keep getting a CV score of "NA" for each result returned. What does
>this mean? I do not have any missing values in any observations. Also, while
>gwr.sel is running, results are printed to the screen, but what does each
>line of ouput represent? Each regression point?
>
>Finally, is gwr.sel expected to take a very long time to complete? I have
>19,000 data points that I am hoping to use for a GW regression but so far
>only two lines of output have been printed to the screen after about 4
>hours.
>
>I apologize in advance for the naivete of my questions, but I am a newbie
>;-).
>
>Thanks,
>Ryan
>
>	[[alternative HTML version deleted]]
>
>_______________________________________________
>R-sig-Geo mailing list
>R-sig-Geo at stat.math.ethz.ch
>https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>  
>

-- 
___________________________________________
Danlin Yu, Ph.D.
Assistant Professor
Department of Earth & Environmental Studies
Montclair State University
Montclair, NJ, 07043
Tel: 973-655-4313
Fax: 973-655-4072
email: yud at mail.montclair.edu




More information about the R-sig-Geo mailing list