| CCM | R Documentation |
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(dataFrame = NULL, columns, target, E, Tp = 0, knn = 0, tau = -1,
exclusionRadius = 0, libSizes, sample = 30, seed = NULL,
embedded = FALSE, validLib = logical(0), includeData = FALSE,
numProcess = 4, backend = "RANN", pathIn = "./", dataFile = "",
pathOut = "./", predictFile = "", parameterList = FALSE, showPlot = FALSE)
dataFrame |
A data.frame of input data. The first column must be a time
index or time values unless |
columns |
Column name(s) to build the embedding: character vector or space-separated string of columns to create the library. If individual column names contain whitespace place names in a vector, or, append ',' to the name. |
target |
Target column name to predict. |
E |
Embedding dimension. |
Tp |
Forecast interval (prediction horizon). |
knn |
Number of nearest neighbours. |
tau |
Embedding delay (negative selects past lags). |
exclusionRadius |
Temporal (Theiler) exclusion radius around each prediction point. |
libSizes |
Library sizes: 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 ncreasing library sizes. |
sample |
Number of random subsamples per library size. |
seed |
Random seed for reproducibility (not bit-comparable to pyEDM/NumPy). |
embedded |
If |
validLib |
Logical vector marking admissible library rows (or length 0 for all). |
includeData |
Add per-library-size sample-variance columns to the result. |
numProcess |
Number of worker processes for the parameter sweep or task grid. |
backend |
Nearest-neighbour backend: |
pathIn |
File path for input |
dataFile |
Input dataFile, .csv format. The first column must be a time index or time values unless noTime is TRUE. The first row must be column names. |
pathOut |
Output file path for |
predictFile |
Output file name, .csv format. |
parameterList |
Append named list of parameters/values to return. |
showPlot |
If |
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 and parameterList = TRUE a
named list "parameters" is added.
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 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.