Learn R Programming

spEDM (version 1.7)

gccm: geographical convergent cross mapping

Description

geographical convergent cross mapping

Usage

# S4 method for 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 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 )

Value

A list

xmap

cross mapping results

varname

names of causal and effect variable

bidirectional

whether to examine bidirectional causality

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 is smap.

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, low or high.

bidirectional

(optional) whether to examine bidirectional causality.

detrend

(optional) whether to remove the linear trend.

progressbar

(optional) whether to show the progress bar.

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

Run this code
columbus = sf::read_sf(system.file("case/columbus.gpkg", package="spEDM"))
# \donttest{
g = gccm(columbus,"hoval","crime",libsizes = seq(5,45,5),E = 6)
g
plot(g, ylimits = c(0,0.85))
# }

Run the code above in your browser using DataLab