partial cross mapping
Usage
# S4 method for class 'data.frame'
pcm(
data,
cause,
effect,
conds,
libsizes,
E = 3,
tau = 0,
k = E + 1,
theta = 1,
algorithm = "simplex",
lib = NULL,
pred = NULL,
threads = length(libsizes),
parallel.level = "low",
bidirectional = TRUE,
cumulate = FALSE,
progressbar = TRUE
)
Arguments
- data
observation data.
- cause
name of causal variable.
- effect
name of effect variable.
- conds
name of conditioning variables.
- libsizes
number of time points used in prediction.
- E
(optional) embedding dimensions.
- tau
(optional) step of time lags.
- k
(optional) number of nearest neighbors used in prediction.
- theta
(optional) weighting parameter for distances, useful when
algorithm
issmap
.- algorithm
(optional) prediction algorithm.
- lib
(optional) libraries indices.
- pred
(optional) predictions indices.
- threads
(optional) number of threads to use.
- parallel.level
(optional) level of parallelism,
low
orhigh
.- bidirectional
(optional) whether to examine bidirectional causality.
- cumulate
(optional) serial or cumulative computation of partial cross mapping.
- progressbar
(optional) whether to show the progress bar.
Value
A list
pxmap
partial cross mapping results
xmap
cross mapping results
varname
names of causal and effect variable
bidirectional
whether to examine bidirectional causality
References
Leng, S., Ma, H., Kurths, J. et al. Partial cross mapping eliminates indirect causal influences. Nat Commun 11, 2632 (2020).
Examples
sim = logistic_map(x = 0.4,y = 0.4,z = 0.4,step = 45,
beta_xy = 0.5, beta_xz = 0,
beta_yx = 0, beta_yz = 0.5,
beta_zx = 0, beta_zy = 0)
pcm(sim,"x","z","y",libsizes = seq(5,35,5),E = 10,k = 7,threads = 1)
#>
Computing: [========================================] 100% (done)
#>
Computing: [========================================] 100% (done)
#> --------------------------------------
#> ***partial cross mapping prediction***
#> --------------------------------------
#> libsizes x->z z->x
#> 1 5 0.2549662 0.1687161
#> 2 10 0.1025583 0.1287902
#> 3 15 0.2345731 0.1407319
#> 4 20 0.1310661 0.2028892
#> 5 25 0.1266602 0.2397178
#> 6 30 0.1147702 0.2771978
#> 7 35 0.1245560 0.5516479
#>
#> ------------------------------
#> ***cross mapping prediction***
#> ------------------------------
#> libsizes x->z z->x
#> 1 5 0.8099271 0.6423512
#> 2 10 0.8818607 0.6830390
#> 3 15 0.8961755 0.6924374
#> 4 20 0.8961413 0.6965852
#> 5 25 0.8948321 0.7039838
#> 6 30 0.8941432 0.7064543
#> 7 35 0.9346800 0.7623188