[R-sig-Geo] Error when running multiscale GWR: Error in gw_weight_vec: Not compatible > with requested type: [type=NULL; target=double]

bi@bi@iu m@iii@g oii whu@edu@c@ bi@bi@iu m@iii@g oii whu@edu@c@
Tue Feb 7 04:28:40 CET 2023


The parameter  var.dMat.indx  is defined for the usage of distance matrix for each variable, and was used wrongly in your code. Try this:

 ab_gwr <- gwr.multiscale(PURCHASE ~ FLOORSZ + PROF,
                         data = londonhp,
                         criterion = "dCVR",
                         kernel = "gaussian",
                         adaptive = FALSE,
                         var.dMat.indx = 1:3,
                         bws0 = c(100,
                                  100,
                                  100),
                         bw.seled = rep(T, 3),
                         dMats = list(dist,
                                      dist,
                                      dist),
                         parallel.method = "omp",
                         parallel.arg = "omp")
It should work now.


binbinlu using whu.edu.cn
 
From: Nikolaos Tziokas
Date: 2023-02-06 01:14
To: r-sig-geo
Subject: [R-sig-Geo] Error when running multiscale GWR: Error in gw_weight_vec: Not compatible > with requested type: [type=NULL; target=double]
I am trying to run multiscale geographically weighted regression (MGWR)
using the GWmodel package in R. When running the function gwr.multiscale
this error is shown:
 
Error in gw_weight_vec(vdist, bw, kernel, adaptive): Not compatible with
requested type: [type=NULL; target=double].
 
An example:
 
library(GWmodel)
 
data(LondonHP)
 
dist <- gw.dist(coordinates(londonhp))
 
ab_gwr <- gwr.multiscale(PURCHASE ~ FLOORSZ + PROF,
                         data = londonhp,
                         criterion = "dCVR",
                         kernel = "gaussian",
                         adaptive = FALSE,
                         var.dMat.indx = 2,
                         bws0 = c(100,
                                  100,
                                  100),
                         bw.seled = rep(T, 3),
                         dMats = list(dist,
                                      dist,
                                      dist),
                         parallel.method = "omp",
                         parallel.arg = "omp")
 
I am following the example from the package's PDF. Also, I tried with my
dataset and many different combinations (different number of covariates,
the dMats parameter, adaptive bandwidths etc etc).
 
-- 
Tziokas Nikolaos
Cartographer
 
Tel:(+44)07561120302
LinkedIn <http://linkedin.com/in/nikolaos-tziokas-896081130>
 
[[alternative HTML version deleted]]
 
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo using r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list