Skip to contents

geographical convergent cross mapping

Usage

# S4 method for class 'sf'
gccm(
  data,
  cause,
  effect,
  libsizes,
  E = 3,
  tau = 1,
  k = E + 1,
  nb = NULL,
  trendRM = TRUE,
  progressbar = TRUE
)

# S4 method for class 'SpatRaster'
gccm(
  data,
  cause,
  effect,
  libsizes,
  E = 3,
  tau = 1,
  k = E + 3,
  RowCol = NULL,
  trendRM = TRUE,
  progressbar = TRUE
)

Arguments

data

The observation data.

cause

Name of causal variable.

effect

Name of effect variable.

libsizes

A vector of library sizes to use.

E

(optional) The dimensions of the embedding.

tau

(optional) The step of spatial lags.

k

(optional) Number of nearest neighbors to use for prediction.

nb

(optional) The neighbours list.

trendRM

(optional) Whether to remove the linear trend.

progressbar

(optional) whether to print the progress bar.

RowCol

(optional) Matrix of selected row and cols numbers.

Value

A list.

xmap

cross-mapping prediction outputs

varname

names of causal and effect variable

Examples

columbus = sf::read_sf(system.file("shapes/columbus.gpkg", package="spData")[1],
                       quiet=TRUE)
# \donttest{
g = gccm(columbus, "HOVAL", "CRIME", libsizes = seq(5,45,5))
#> 
Computing: [========================================] 100% (done)                         
#> 
Computing: [========================================] 100% (done)                         
g
#>   libsizes CRIME->HOVAL HOVAL->CRIME
#> 1        5   0.08036917    0.2360232
#> 2       10   0.11368175    0.3207803
#> 3       15   0.08758561    0.3509119
#> 4       20   0.10310575    0.3638976
#> 5       25   0.11585893    0.3814201
#> 6       30   0.12976658    0.4063601
#> 7       35   0.14387488    0.4355102
#> 8       40   0.15749070    0.4612822
#> 9       45   0.19913895    0.4838568
plot(g, ylimits = c(0,0.65))

# }