Current version: GD v10.3
GD
To cite GD
R package in publications,
please use:
Song, Y., Wang, J., Ge, Y. & Xu, C. (2020) “An optimal parameters-based geographical detector model enhances geographic characteristics of explanatory variables for spatial heterogeneity analysis: Cases with different types of spatial data”, GIScience & Remote Sensing. 57(5), 593-610. doi: 10.1080/15481603.2020.1760434.
GD
packageExplore potential factors or explanatory variables from a spatial perspective.
Explore potential interactive impacts of geogrpahical variables.
Identify high-risk or low-risk regions from potential explanatory variables.
GD
package makes following steps fast and
easy:It contains both supervised and unsupervised spatial data discretization methods, and the optimal spatial discretization method for continuous variables;
It contains four primary functions of geographical detectors, including factor detector, risk detector, interaction detector and ecological detector;
It can be used to compare size effects of spatial unit;
It provides diverse visualizations of spatial analysis results;
It contains detailed significance tests for spatial analysis in each step of geographical detectors.
gdm
(Highly Recommended)The pacakge provides a one-step function for performing optimal discretization and geographical detectors at the same time.
The output contains all data and visualization results.
## install and library the pacakge
install.packages("GD")
library("GD")
## Example 1
## NDVI: ndvi_40
## set optional parameters of optimal discretization
## optional methods: equal, natural, quantile, geometric, sd and manual
discmethod <- c("equal","natural","quantile")
discitv <- c(4:6)
## "gdm" function
## In this case, Climatezone and Mining are categorical variables,
## and Tempchange and GDP are continuous variables.
ndvigdm <- gdm(NDVIchange ~ Climatezone + Mining + Tempchange + GDP,
continuous_variable = c("Tempchange", "GDP"),
data = ndvi_40,
discmethod = discmethod, discitv = discitv) # ~3s
ndvigdm
plot(ndvigdm)
## Example 2
## H1N1: h1n1_100
## set optional parameters of optimal discretization
discmethod <- c("equal","natural","quantile","geometric","sd")
discitv <- c(3:7)
continuous_variable <- colnames(h1n1_100)[-c(1,11)]
## "gdm" function
h1n1gdm <- gdm(H1N1 ~ .,
continuous_variable = continuous_variable,
data = h1n1_100,
discmethod = discmethod, discitv = discitv)
h1n1gdm
plot(h1n1gdm)
Currently, there are the following advanced models based on spatial stratified heterogeneity.
Model (Publication) | Description |
---|---|
Optimal Parameters-based Geographical Detector (OPGD) (Song et al., 2020) | OPGD is used for characterising spatial heterogeneity, identifying geographical factors and interactive impacts of factors, and estimating risks. |
Interactive Detector for Spatial Associations (IDSA) (Song et al., 2021) | IDSA is used for estimating the power of interactive determinants (PID) from a spatial perspective. The IDSA model considers spatial heterogeneity, spatial autocorrelation, and spatial fuzzy overlay of multiple explanatory variables for calculating PID. |
Generalized Heterogeneity Model (GHM) (Luo et al., 2023) | GHM is used for characterizing local and stratified heterogeneity within variables and to improve interpolation accuracy. |
Geographically Optimal Zones-based Heterogeneity (GOZH) (Luo et al., 2022) | GOZH is used for identifying individual and interactive determinants of geographical attributes (e.g., global soil moisture) across a large study area. GOZH can identify optimal spatial zones and compute the maximum power of determinant (PD) values using an Ω-index. |
Robust Geographical Detector (RGD) (Zhang et al., 2022) | RGD is used for the robust estimation of PD values. |
Spatial stratified heterogeneity can be measured using geographical detectors (Wang et al. 2010, Wang et al. 2016).
Power of determinants is computed using a \(Q\)-statistic:
\[Q=1-\displaystyle \frac{\sum_{j=1}^{M} N_{j} \sigma_{j}^2}{N \sigma^2} \]
where \(N\) and \(\sigma^2\) are the number and population variance of observations within the whole study area, and \(N_{j}\) and \(\sigma_{j}^2\) are the number and population variance of observations within the \(j\) th (\(j\)=1,…,\(M\)) sub-region of an explantory variable.
Please note that in R
environment,
sd
and var
functions are used for computing
sample standard deviation and sample variance. If sample
variance is used in the computation, the equation of \(Q\)-statistic can be converted to:
\[Q=1-\displaystyle \frac{\sum_{j=1}^{M} (N_{j}-1) s_{j}^2}{(N-1) s^2} \]
where \(s^2\) and \(s_{j}^2\) are sample variance of observations in the whole study area and in the \(j\) th sub-region.