gccm {spEDM} | R Documentation |
geographical convergent cross mapping
Description
geographical convergent cross mapping
Usage
## S4 method for signature 'sf'
gccm(
data,
cause,
effect,
libsizes = NULL,
E = 3,
tau = 1,
k = E + 2,
theta = 1,
algorithm = "simplex",
lib = NULL,
pred = NULL,
nb = NULL,
threads = detectThreads(),
parallel.level = "low",
bidirectional = TRUE,
detrend = TRUE,
progressbar = TRUE
)
## S4 method for signature 'SpatRaster'
gccm(
data,
cause,
effect,
libsizes = NULL,
E = 3,
tau = 1,
k = E + 2,
theta = 1,
algorithm = "simplex",
lib = NULL,
pred = NULL,
threads = detectThreads(),
parallel.level = "low",
bidirectional = TRUE,
detrend = TRUE,
progressbar = TRUE
)
Arguments
data |
observation data. |
cause |
name of causal variable. |
effect |
name of effect variable. |
libsizes |
(optional) number of spatial units used. |
E |
(optional) embedding dimensions. |
tau |
(optional) step of spatial lags. |
k |
(optional) number of nearest neighbors. |
theta |
(optional) weighting parameter for distances, useful when |
algorithm |
(optional) prediction algorithm. |
lib |
(optional) libraries indices. |
pred |
(optional) predictions indices. |
nb |
(optional) neighbours list. |
threads |
(optional) number of threads to use. |
parallel.level |
(optional) level of parallelism, |
bidirectional |
(optional) whether to examine bidirectional causality. |
detrend |
(optional) whether to remove the linear trend. |
progressbar |
(optional) whether to show the progress bar. |
Value
A list
xmap
cross mapping results
varname
names of causal and effect variable
bidirectional
whether to examine bidirectional causality
References
Gao, B., Yang, J., Chen, Z. et al. Causal inference from cross-sectional earth system data with geographical convergent cross mapping. Nat Commun 14, 5875 (2023).
Examples
columbus = sf::read_sf(system.file("case/columbus.gpkg", package="spEDM"))
g = gccm(columbus,"hoval","crime",libsizes = seq(5,45,5),E = 6)
g
plot(g, ylimits = c(0,0.85))