| gpc | R Documentation |
geographical pattern causality
## S4 method for signature 'sf'
gpc(
data,
cause,
effect,
libsizes = NULL,
E = 3,
k = E + 2,
tau = 1,
style = 1,
lib = NULL,
pred = NULL,
boot = 99,
random = TRUE,
seed = 42,
dist.metric = "L2",
zero.tolerance = k,
relative = TRUE,
weighted = TRUE,
threads = detectThreads(),
detrend = FALSE,
parallel.level = "low",
bidirectional = TRUE,
progressbar = TRUE,
nb = NULL
)
## S4 method for signature 'SpatRaster'
gpc(
data,
cause,
effect,
libsizes = NULL,
E = 3,
k = E + 2,
tau = 1,
style = 1,
lib = NULL,
pred = NULL,
boot = 99,
random = TRUE,
seed = 42,
dist.metric = "L2",
zero.tolerance = k,
relative = TRUE,
weighted = TRUE,
threads = detectThreads(),
detrend = FALSE,
parallel.level = "low",
bidirectional = TRUE,
progressbar = TRUE,
grid.coord = TRUE
)
data |
observation data. |
cause |
name of causal variable. |
effect |
name of effect variable. |
libsizes |
(optional) number of spatial units used (input needed: |
E |
(optional) embedding dimensions. |
k |
(optional) number of nearest neighbors. |
tau |
(optional) step of spatial lags. |
style |
(optional) embedding style ( |
lib |
(optional) libraries indices (input requirement same as |
pred |
(optional) predictions indices (input requirement same as |
boot |
(optional) number of bootstraps to perform. |
random |
(optional) whether to use random sampling. |
seed |
(optional) random seed. |
dist.metric |
(optional) distance metric ( |
zero.tolerance |
(optional) maximum number of zeros tolerated in signature space. |
relative |
(optional) whether to calculate relative changes in embeddings. |
weighted |
(optional) whether to weight causal strength. |
threads |
(optional) number of threads to use. |
detrend |
(optional) whether to remove the linear trend. |
parallel.level |
(optional) level of parallelism, |
bidirectional |
(optional) whether to examine bidirectional causality. |
progressbar |
(optional) whether to show the progress bar. |
nb |
(optional) neighbours list. |
grid.coord |
(optional) whether to detrend using cell center coordinates ( |
A list
xmapcross mapping results (only present if libsizes is not NULL)
causalityper-sample causality statistics (present if libsizes is NULL)
summaryoverall causal strength (present if libsizes is NULL)
patternpairwise pattern relationships (present if libsizes is NULL)
varnamenames of causal and effect variables
bidirectionalwhether to examine bidirectional causality
Zhang, Z., Wang, J., 2025. A model to identify causality for geographic patterns. International Journal of Geographical Information Science 1–21.
columbus = sf::read_sf(system.file("case/columbus.gpkg",package="spEDM"))
gpc(columbus,"hoval","crime",E = 6,k = 9)
# convergence diagnostics
g = gpc(columbus,"hoval","crime",libsizes = seq(5,45,5),E = 6,k = 9)
plot(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.