Learn R Programming

geocomplexity (version 0.2.0)

gwr_geoc: geographical complexity-geographically weighted regression

Description

geographical complexity-geographically weighted regression

Usage

gwr_geoc(
  formula,
  data,
  gcs = NULL,
  alpha = seq(0.05, 1, 0.05),
  bw = "RMSE",
  adaptive = TRUE,
  kernel = "gaussian"
)

Value

A list with GCGWR results.

SDF

an sf tibble with coefficients, standard errors and t values

diagnostic

goodness of fit indicators

args

some key parameters

Arguments

formula

A formula of GCGWR model.

data

An sf object or spatial vector object that can be converted to sf by sf::st_as_sf().

gcs

(optional) The geocomplexity matrix corresponding to each variable, which is calculated by default using geocd_vector().

alpha

(optional) Balancing the weights of attribute similarity matrix and geographic distance matrix.

bw

(optional) The bandwidth used in selecting models. The optimal bandwidth can be selected using one of three methods: RMSE, AIC, and AICc. Default will use RMSE.

adaptive

(optional) Whether the bandwidth value is adaptive or not. Default is TRUE.

kernel

(optional) Kernel function. Default is gaussian.

Examples

Run this code
# \donttest{
## The following code takes a long time to run:
econineq = sf::read_sf(system.file('extdata/econineq.gpkg',package = 'geocomplexity'))
g = gwr_geoc(formula = Gini ~ ., data = econineq,
             alpha = 0.5, bw = "AIC", adaptive = TRUE)
g
# }

Run the code above in your browser using DataLab