Learn R Programming

spEDM (version 1.11)

scpcm: spatially convergent partial cross mapping

Description

spatially convergent partial cross mapping

Usage

# S4 method for sf
scpcm(
  data,
  cause,
  effect,
  conds,
  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,
  cumulate = FALSE,
  nb = NULL
)

# S4 method for SpatRaster scpcm( data, cause, effect, conds, 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, cumulate = FALSE, grid.coord = TRUE, embed.direction = 0, win.ratio = 0 )

Value

A list

pxmap

partial cross mapping results

xmap

cross mapping results

varname

names of causal, effect and conditioning variables

bidirectional

whether to examine bidirectional causality

Arguments

data

observation data.

cause

name of causal variable.

effect

name of effect variable.

conds

name of conditioning variables.

libsizes

(optional) number of spatial units used (input needed: vector - spatial vector, matrix - spatial raster).

E

(optional) embedding dimensions.

k

(optional) number of nearest neighbors.

tau

(optional) step of spatial lags.

style

(optional) embedding style (0 includes current state, 1 excludes it).

stack

(optional) whether to stack embeddings.

lib

(optional) libraries indices (input requirement same as libsizes).

pred

(optional) predictions indices (input requirement same as libsizes).

dist.metric

(optional) distance metric (L1: Manhattan, L2: Euclidean).

dist.average

(optional) whether to average distance.

theta

(optional) weighting parameter for distances, useful when algorithm is smap.

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

bidirectional

(optional) whether to examine bidirectional causality.

progressbar

(optional) whether to show the progress bar.

cumulate

(optional) serial or cumulative computation of partial cross mapping.

nb

(optional) neighbours list.

grid.coord

(optional) whether to detrend using cell center coordinates (TRUE) or row/column numbers (FALSE).

embed.direction

(optional) direction selector for embeddings (0 returns all directions, 1-8 correspond to NW, N, NE, W, E, SW, S, SE).

win.ratio

(optional) ratio of sliding window scale to speed up state-space predictions.

Examples

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

Run the code above in your browser using DataLab