ConvergentCrossMappingTest
#
CausalityTools.CausalityTests.ConvergentCrossMappingTest
— Type.
ConvergentCrossMappingTest(timeseries_lengths;
dim::Int = 3, τ::Int = 1, libsize::Int = 10,
replace::Bool = false, n_reps::Int = 100, surr_func::Function = randomshuffle,
which_is_surr::Symbol = :none, exclusion_radius::Int = 0,
tree_type = NearestNeighbors.KDTree, distance_metric = Distances.Euclidean(),
correspondence_measure = StatsBase.cor,
ν::Int = 0)
The parameters for a convergent cross mapping [1] test.
Mandatory keyword arguments
timeseries_lengths
: The time series lengths over which to cross map and check convergence.
Optional keyword arguments
dim
: The dimension of the state space reconstruction (delay embedding) constructed from theresponse
series. Default isdim = 3
.τ
: The embedding lag for the delay embedding constructed fromresponse
. Default isτ = 1
.ν
: The prediction lag to use when predicting scalar values ofdriver
fromthe delay embedding ofresponse
.ν > 0
are forward lags (causal;driver
's past influencesresponse
's future), andν < 0
are backwards lags (non-causal;driver
's' future influencesresponse
's past). Adjust the prediction lag if you want to performed lagged ccm (Ye et al., 2015). Default isν = 0
, as in Sugihara et al. (2012). Note: The sign of the lagν
is organized to conform with the conventions in TransferEntropy.jl, and is opposite to the convention used in therEDM
package (Ye et al., 2016).libsize
: Among how many delay embedding points should we sample time indices and look for nearest neighbours at each cross mapping realization (of which there aren_reps
)?n_reps
: The number of times we draw a library oflibsize
points from the delay embedding ofresponse
and try to predictdriver
values. Equivalently, how many times do we cross map for this value oflibsize
? Default isn_reps = 100
.replace
: Sample delay embedding points with replacement? Default isreplace = true
.exclusion_radius
: How many temporal neighbors of the delay embedding pointresponse_embedding(t)
to exclude when searching for neighbors to determine weights for predicting the scalar pointdriver(t + ν)
. Default isexclusion_radius = 0
.which_is_surr
: Which data series should be replaced by a surrogate realization of the type given bysurr_type
? Must be one of the following::response
,:driver
,:none
,:both
. Default is:none
.surr_func
: A valid surrogate function from TimeseriesSurrogates.jl.tree_type
: The type of tree to build when looking for nearest neighbors. Must be a tree type from NearestNeighbors.jl. For now, this is eitherBruteTree
,KDTree
orBallTree
.distance_metric
: An instance of aMetric
from Distances.jl.BallTree
andBruteTree
work with anyMetric
.KDTree
only works with the axis aligned metricsEuclidean
,Chebyshev
,Minkowski
andCityblock
. Default ismetric = Euclidean()
(note the instantiation of the metric).correspondence_measure
: The function that computes the correspondence between actual values ofdriver
and predicted values. Can be any function returning a similarity measure between two vectors of values. Default iscorrespondence_measure = StatsBase.cor
, which returns values on [-1, 1]. In this case, any negative values are usually filtered out (interpreted as zero coupling) and a value of 1 means perfect prediction. Sugihara et al. (2012) also proposes to use the root mean square deviation, for which a value of 0 would be perfect prediction.summarise
: Should cross map skills be summarised for each time series length? Default issummarise = false
.average_measure
: Either:median
or:mean
. Default is:median
uncertainty_measure
: Either:quantile
or:std
.quantiles
: Compute uncertainty over quantile(s) ifuncertainty_measure
is:quantile
. Default is[0.327, 0.673]
, roughly corresponding to1s
for normally distributed data.
References
- Sugihara, George, et al. "Detecting causality in complex ecosystems." Science (2012): 1227079. http://science.sciencemag.org/content/early/2012/09/19/science.1227079
- Ye, Hao, et al. "Distinguishing time-delayed causal interactions using convergent cross mapping." Scientific Reports 5 (2015): 14750. https://www.nature.com/articles/srep14750
- Ye, H., et al. "rEDM: Applications of empirical dynamic modeling from time series." R Package Version 0.4 7 (2016). https://cran.r-project.org/web/packages/rEDM/index.html