0

I am trying to run a GWR, and using the spgwr package. I just want to run a basic GWR on my data, which looks a little like this:

Concentration ws wd eleva traffic dist_to_RR
10382 2 200 30 11234 112.3
43722 2 210 30 24273 2736.3
26374 2 230 60 23846 2163.1

etc. etc.

I've converted my dataset to a SpatialPointDataFrame (from an sf) and double checked that all of my variables are numeric. I am trying to use this spatial dataset to run a gwr, and here is the code I have:

    band_gwr <- gwr.sel(Concentration~ws+wd+eleva+
                 traffic+dist_to_RR, data=dat, 
                 gweight=gwr.Gauss, adapt=TRUE)

I can't even get to the next step because this code will time out. It doesn't throw errors, it just runs infinitely long. I have this running on a computing cluster with a lot of cores, and I let it run for 3+ hours and still nothing. I think something must be wrong with the way I've written this, I can't imagine why else this won't work.

I have already checked variable correlation and removed those with Pearson's >0.8, and I also removed all of the variables with >40% homogeneity. There are no NAs in the data. This is an SpatialPointsDataFrame so it does not need a coords argument in the function.

Any ideas on how to go about debugging this?

Thanks!

2
  • There's (at least) one important piece of missing info here - how many rows in your data? Does it take forever on a small random sample of your data?
    – Spacedman
    Commented Dec 2, 2023 at 11:41
  • I just tried it with 1000 points on some random data with the same columns as yours and it ran in a minute or two on an old desktop. Trying 10,000 points and its taking its time before it first prints the "Adaptive q" and "CV score" for the first time, so this is grinding but might take an hour. I reckon 100,000 points would be taking days...or weeks... How big is your data set?
    – Spacedman
    Commented Dec 4, 2023 at 14:04

0

Browse other questions tagged or ask your own question.