The state-space of a multivariate dynamical system (not a purely
stochastic one) encodes coherent phase-space variable trajectories. If
enough information is available, one can infer the presence or absence
of cross-variable interactions associated with causal links between
variables. CCM
measures the extent to which states of
variable Y can reliably estimate states of variable X. This can happen
if X is causally influencing Y.
If cross-variable state predictability converges as more state-space
information is provided, this indicates a causal link. CCM
performs this cross-variable mapping using Simplex, with convergence
assessed across a range of observational library sizes as described in
Sugihara et al. 2012.
CCM(pathIn = "./", dataFile = "", dataFrame = NULL,
E = 0, Tp = 0, knn = 0, tau = -1,
exclusionRadius = 0, columns = "", target = "", libSizes = "",
sample = 0, random = TRUE, seed = 0,
embedded = FALSE, includeData = FALSE, parameterList = FALSE,
verbose = FALSE, showPlot = FALSE, noTime = FALSE)
A data.frame with 3 columns. The first column is LibSize
specifying the subsampled library size. Columns 2 and 3 report Pearson correlation coefficients for the prediction of X from Y, and Y from X.
if includeData = TRUE
a named list with the following data.frames
data.frame Combo_rho
columns:
LibMeans | CCM mean correlations for each library size |
CCM1_PredictStat | Forward cross map prediction statistics |
CCM1_Predictions | Forward cross map prediction values |
CCM2_PredictStat | Reverse cross map prediction statistics |
CCM2_Predictions | Reverse cross map prediction values |
If includeData = TRUE
and parameterList = TRUE
a
named list "parameters" is added.
path to dataFile
.
.csv format data file name. The first column must be a time index or time values unless noTime is TRUE. The first row must be column names.
input data.frame. The first column must be a time index or time values unless noTime is TRUE. The columns must be named.
embedding dimension.
prediction horizon (number of time column rows).
number of nearest neighbors. If knn=0, knn is set to E+1.
lag of time delay embedding specified as number of time column rows.
excludes vectors from the search space of nearest neighbors if their relative time index is within exclusionRadius.
string of whitespace separated column name(s), or vector of column names used to create the library. If individual column names contain whitespace place names in a vector, or, append ',' to the name.
column name used for prediction.
string of 3 whitespace separated integer values specifying the intial library size, the final library size, and the library size increment. Can also be a list of strictly increasing library sizes.
integer specifying the number of random samples to draw at each library size evaluation.
logical to specify random (TRUE
) or sequential
library sampling. Note random = FALSE
is not convergent
cross mapping.
integer specifying the random sampler seed. If
seed=0
then a random seed is generated.
logical specifying if the input data are embedded.
logical to include statistics and predictions for every prediction in the ensemble.
logical to add list of invoked parameters.
logical to produce additional console reporting.
logical to plot results.
logical to allow input data with no time column.
CCM
computes the X:Y and Y:X cross-mappings in parallel
using threads.
Sugihara G., May R., Ye H., Hsieh C., Deyle E., Fogarty M., Munch S., 2012. Detecting Causality in Complex Ecosystems. Science 338:496-500.
data(sardine_anchovy_sst)
df = CCM( dataFrame = sardine_anchovy_sst, E = 3, Tp = 0, columns = "anchovy",
target = "np_sst", libSizes = "10 70 10", sample = 100 )
Run the code above in your browser using DataLab