# Geographically Weighted Regression

# Module Description

This module contain functions for basic and Robust GWR, generalised GWR, Heterocedastic GWR, Mixed GWR, Scalable GWR and Local collinearity diagnostics for basic GWR.

# Argument

Argument | Basic | Robust | Generalized | Heterocedastic | Mixed | Scalable
--- | --- | --- | --- | --- | --- | ---
`Dependient` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔
`Independient` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔
`Family` | x | x | ✔ | x | x | x
`Cv` | ✔ | x | ✔ | x | x | x
`Kernel` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔
`Power` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔
`Theta` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔
`Longlat` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔
`Adaptive` | ✔ | ✔ | ✔ | ✔ | ✔ | x
`Distance bandwidth` | ✔ | ✔ | ✔ | ✔ | ✔ | x
`Max iter` | x | ✔ | x | ✔ | x | x
`Fixed` | x | x | x | x | ✔ | x
`Intercep fixed` | x | x | x | x | ✔ | x
`Diagnostic` | x | x | x | x | ✔ | x
`F123` | x | ✔ | x | x | x | x
`Filtered` | x | ✔ | x | x | x | x
`bw.adapt` | x | x | x | x | x | ✔
`Polynomial` | x | x | x | x | x | ✔

The same arguments are used in the Local collinearity diagnostics module as in the GWR Basic module, except for CV.

`Dependient`: Dependent variable of the regression model.

`Independient`: Independent(s) variable(s) of the regression model.

`Family`: a description of the model’s error distribution and link function, which can be “poisson” or “binomial”.

`Cv`: if TRUE, cross-validation data will be calculated

`Kernel` : A set of five commonly used kernel functions;

`Power (Minkowski distance)` : the power of the Minkowski distance (p=1 is manhattan distance, p=2 is euclidean distance).

`Theta (Angle in radians)` : an angle in radians to rotate the coordinate system, default is 0

`longlat` : if TRUE, great circle distances will be calculated

`Adaptive` :if TRUE calculate an adaptive kernel where the bandwidth (bw) corresponds to the number of nearest neighbours (i.e. adaptive distance); default is FALSE, where a fixed kernel is found (bandwidth is a fixed distance)

`Distance bandwidth` : bandwidth used in the weighting function. It has two options, `automatic` which is calculated in the Bandwidth selection module and `manual` in which the user enter the value.

`Max iter`: maximum number of iterations for the automatic approach

`Fixed`: independent variables that appeared in the formula that are to be treated as global

`Intercep fixed`: logical, if TRUE the intercept will be treated as global

`Diagnostic`: logical, if TRUE the diagnostics will be calculated

`F123`:default FALSE, otherwise calculate F-test results

`Filtered`: default FALSE, the automatic approach is used, if TRUE the filtered data approach is employed, as that described in Fotheringham et al [1]

`bw.adapt`: adaptive bandwidth (i.e. number of nearest neighbours) used for geographically weighting

`Polynomial`: degree of the polyunomial to approximate the kernel function

# Value

SDF a SpatialPointsDataFrame (may be gridded) or SpatialPolygonsDataFrame object (see package “sp”) integrated with fit.points,GWR coefficient estimates, predicted values, coefficient standard errors and t-values in its “data” slot.

In the plot tab, the values obtained in the summary can be plotted, customized and downloaded in `.pdf` or `.png`.

# Videos

## Local collinearity diagnostics

Video 1 : Local collinearity diagnostics for basic GWR

## Basic Geographically Weighted Regression

Video 2 : Basic GWR

## Robust Geographically Weighted Regression

Video 3 : Robust GWR

## Generalized Geographically Weighted Regression (GGWR)

Video 4 :Generalized GWR :

## Heterocedastic Geographically Weighted Regression (HGWR)

Video 5 : Heterocedastic GWR

## Mixed Geographically Weighted Regression (MGWR)

Video 6 : Mixed GWR

## Scalable Geographically Weighted Regression (SGWR)

Video 7 : Scalable GWR

# References

[1] Fotheringham S, Brunsdon, C, and Charlton, M (2002), Geographically Weighted Regression: The Analysis of Spatially Varying Relationships, John Wiley & Sons,Chichester.

[2] Belsley, D. A., Kuh, E., & Welsch, R. E. (2005). Regression diagnostics: Identifying influential data and sources of collinearity. John Wiley & Sons.

[3] Wheeler, D., & Tiefelsdorf, M. (2005). Multicollinearity and correlation among local regression coefficients in geographically weighted regression. Journal of Geographical Systems, 7(2), 161-187.

[4] Wheeler, D.C., Diagnostic tools and a remedial method for collinearity in geographically weighted regression. Environment and Planning A 2007, 39, (10), 2464-2481.

[5] Griffith, D.A., Spatial-filtering-based contributions to a critique of geographically weighted regression (GWR). Environment and Planning A 2008, 40, (11), 2751-2769.

[6] Wheeler, D.; Waller, L., Comparing spatially varying coefficient models: a case study examining violent crime rates and their relationships to alcohol outlets and illegal drug arrests. Journal of Geographical Systems 2009, 11, (1), 1-22.

[7] Wheeler, D.C., Simultaneous coefficient penalization and model selection in geographically weighted regression: the geographically weighted lasso. Environment and Planning A 2009, 41, (3), 722-742.

[8] Gollini, I., Lu, B., Charlton, M., Brunsdon, C., & Harris, P. (2015). GWmodel: An R Package for Exploring Spatial Heterogeneity Using Geographically Weighted Models. Journal of Statistical Software, 63(17), 1–50. https://doi.org/10.18637/jss.v063.i17

[9] Oshan, T. M., Li, Z., Kang, W., Wolf, L. J., & Fotheringham, A. S. (2019). mgwr: A Python implementation of multiscale geographically weighted regression for investigating process spatial heterogeneity and scale. ISPRS International Journal of Geo-Information, 8(6), 269.

[10] Zou, H. and Hastie, T. 2005. Regularization and variable selection via the elastic net. Journal of the Royal Statistical Society: Series B, 672., pp.301-320.

[11] Friedman J, Hastie T, Tibshirani R 2010. Regularization paths for generalized linear models via coordinate descent. Journal of Statistical Software 331:1–22

[12] Dormann, C.F., J. Elith, S. Bacher, et al. 2013. Collinearity: a review of methods to deal with it and a simulation study evaluating their performance. Ecography 36: 27-46.

[13] Comber, A., Brunsdon, C., Charlton, M., Dong, G., Harris, R., Lu, B., … & Harris, P. (2020). The GWR route map: a guide to the informed application of Geographically Weighted Regression. arXiv preprint arXiv:2004.06070.

[14] Mei L-M, He S-Y, Fang K-T (2004) A note on the mixed geographically weighted regression model. Journal of regional science 44(1):143-157

[15] Murakami, D., N. Tsutsumida, T. Yoshida, T. Nakaya & B. Lu (2019) Scalable GWR: A linear-time algorithm for large-scale geographically weighted regression with polynomial kernels. arXiv:1905.00266