| gccm | R Documentation |
geographical convergent cross mapping
## S4 method for signature 'sf'
gccm(
data,
cause,
effect,
libsizes = NULL,
E = 3,
k = E + 2,
tau = 1,
style = 1,
stack = FALSE,
lib = NULL,
pred = NULL,
dist.metric = "L2",
dist.average = TRUE,
theta = 1,
algorithm = "simplex",
threads = detectThreads(),
detrend = TRUE,
parallel.level = "low",
bidirectional = TRUE,
progressbar = TRUE,
nb = NULL
)
## S4 method for signature 'SpatRaster'
gccm(
data,
cause,
effect,
libsizes = NULL,
E = 3,
k = E + 2,
tau = 1,
style = 1,
stack = FALSE,
lib = NULL,
pred = NULL,
dist.metric = "L2",
dist.average = TRUE,
theta = 1,
algorithm = "simplex",
threads = detectThreads(),
detrend = TRUE,
parallel.level = "low",
bidirectional = TRUE,
progressbar = TRUE,
grid.coord = TRUE,
embed.direction = 0,
win.ratio = 0
)
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 ( |
stack |
(optional) whether to stack embeddings. |
lib |
(optional) libraries indices (input requirement same as |
pred |
(optional) predictions indices (input requirement same as |
dist.metric |
(optional) distance metric ( |
dist.average |
(optional) whether to average distance. |
theta |
(optional) weighting parameter for distances, useful when |
algorithm |
(optional) prediction algorithm. |
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 ( |
embed.direction |
(optional) direction selector for embeddings ( |
win.ratio |
(optional) ratio of sliding window scale to speed up state-space predictions. |
A list
xmapcross mapping results
varnamenames of causal and effect variables
bidirectionalwhether to examine bidirectional causality
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).
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.