Skip to content

GWR with anisotropic kernel (bandwidth only in one direction) #39

@nikosGeography

Description

@nikosGeography

Hello, thank you for creating the package and feel free to close the issue if you think the question is not suitable for this place.

I'm working on downscaling VIIRS nighttime lights satellite imagery. VIIRS is a whiskbroom sensor where viewing angle (VA) varies across the image swath in the cross-track direction (left to right, perpendicular to satellite motion). At higher viewing angles, the sensor observes different aspects of ground features - for example, building facades rather than rooftops when viewing straight down.

I suspect that the relationship between my covariates (land cover, population density, etc.) and observed nighttime lights should vary with viewing angle. I am about to use Geographically Weighted Regression (GWR) with a custom kernel that forms "vertical bands":

  • Finite bandwidth in the cross-track direction (x-direction, where VA varies)
  • Effectively infinite bandwidth in the along-track direction (y-direction, where VA is constant)
  • This ensures sufficient replicates for each value of x allowing you to fit the model by pooling all along-track observations together.

Can GWmodel3 accommodate this type of directional anisotropic kernel where bandwidth is controlled in only one spatial direction (aligned with the cross-track/viewing angle direction)?

I've reviewed the GWmodel3 documentation and searched for examples of anisotropic kernels, but I haven't found any implementations of custom kernels.

Standard GWR example (isotropic kernel):

pacman::p_load(sf, GWmodel3)

data(LondonHP)

m1 <- gwr_basic(
  formula = PURCHASE ~ FLOORSZ + UNEMPLOY + PROF,
  data = LondonHP,
  bw = "AIC",
  adaptive = TRUE
)

What I need a kernel where:

Bandwidth in x-direction: finite (e.g., adaptive or fixed)
Bandwidth in y-direction: effectively infinite (all observations at similar x-positions contribute equally)
Would a custom distance matrix (dMat) be the solution, or is there another approach within GWmodel? I couldn't find a solution on how to implement a custom dMat in the package.

Session Info

R version 4.5.2 (2025-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26200)

Matrix products: default
  LAPACK version 3.12.1

locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

time zone: Europe/Budapest
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] GWmodel3_3.0-0 sf_1.1-0      

loaded via a namespace (and not attached):
 [1] compiler_4.5.2     magrittr_2.0.4     class_7.3-23       DBI_1.3.0          tools_4.5.2        otel_0.2.0        
 [7] units_1.0-0        proxy_0.4-29       rstudioapi_0.18.0  Rcpp_1.1.1         KernSmooth_2.23-26 grid_4.5.2        
[13] e1071_1.7-17       classInt_0.4-11    pacman_0.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions