# 收敛交叉映射算法

Convergent cross mapping (CCM) is a statistical test for a cause-and-effect relationship between two time series variables that, like the Granger causality test, seeks to resolve the problem that correlation does not imply causation. While Granger causality is best suited for purely stochastic systems where the influences of the causal variables are separable (independent of each other), CCM is based on the theory of dynamical systems and can be applied to systems where causal variables have synergistic effects. The fundamental idea of this test was first published by Cenys et al. in 1991 and used in a series of statistical approaches (see for example,). It was then further elaborated in 2012 by the lab of George Sugihara of the Scripps Institution of Oceanography.

Convergent cross mapping (CCM) is a statistical test for a cause-and-effect relationship between two time series variables that, like the Granger causality test, seeks to resolve the problem that correlation does not imply causation. While Granger causality is best suited for purely stochastic systems where the influences of the causal variables are separable (independent of each other), CCM is based on the theory of dynamical systems and can be applied to systems where causal variables have synergistic effects. The fundamental idea of this test was first published by Cenys et al. in 1991 and used in a series of statistical approaches (see for example,). It was then further elaborated in 2012 by the lab of George Sugihara of the Scripps Institution of Oceanography.

## Theory

Convergent cross mapping is based on Takens' embedding theorem, which states that generically the attractor manifold of a dynamical system can be reconstructed from a single observation variable of the system, $\displaystyle{ X }$. This reconstructed or shadow attractor $\displaystyle{ M_X }$ is diffeomorphic (has a one-to-one mapping) to the true manifold, $\displaystyle{ M }$. Consequently, if two variables X and Y belong to the same dynamics system, the shadow manifolds $\displaystyle{ M_X }$ and $\displaystyle{ M_Y }$ will also be diffeomorphic. Time points that are nearby on the manifold $\displaystyle{ M_X }$ will also be nearby on $\displaystyle{ M_Y }$. Therefore, the current state of variable $\displaystyle{ Y }$ can be predicted based on $\displaystyle{ M_X }$.

Convergent cross mapping is based on Takens' embedding theorem, which states that generically the attractor manifold of a dynamical system can be reconstructed from a single observation variable of the system, $\displaystyle{ X }$. This reconstructed or shadow attractor $\displaystyle{ M_X }$ is diffeomorphic (has a one-to-one mapping) to the true manifold, $\displaystyle{ M }$. Consequently, if two variables X and Y belong to the same dynamics system, the shadow manifolds $\displaystyle{ M_X }$ and $\displaystyle{ M_Y }$ will also be diffeomorphic. Time points that are nearby on the manifold $\displaystyle{ M_X }$ will also be nearby on $\displaystyle{ M_Y }$. Therefore, the current state of variable $\displaystyle{ Y }$ can be predicted based on $\displaystyle{ M_X }$.

Cross mapping need not be symmetric. If $\displaystyle{ X }$ forces $\displaystyle{ Y }$ unidirectionally, variable $\displaystyle{ Y }$ will contain information about $\displaystyle{ X }$, but not vice versa. Consequently, the state of $\displaystyle{ X }$ can be predicted from $\displaystyle{ M_Y }$, but $\displaystyle{ Y }$ will not be predictable from $\displaystyle{ M_X }$.

Cross mapping need not be symmetric. If $\displaystyle{ X }$ forces $\displaystyle{ Y }$ unidirectionally, variable $\displaystyle{ Y }$ will contain information about $\displaystyle{ X }$, but not vice versa. Consequently, the state of $\displaystyle{ X }$ can be predicted from $\displaystyle{ M_Y }$, but $\displaystyle{ Y }$ will not be predictable from $\displaystyle{ M_X }$.

## Algorithm

The basic steps of the convergent cross mapping test according to

The basic steps of the convergent cross mapping test according to

1. Create the shadow manifold for $\displaystyle{ X }$, called $\displaystyle{ M_X }$
Create the shadow manifold for $\displaystyle{ X }$, called $\displaystyle{ M_X }$


$\displaystyle{ M_X }$创建阴影流形，称为$\displaystyle{ M_X }$

1. Find the nearest neighbors to a point in the shadow manifold at time t
Find the nearest neighbors to a point in the shadow manifold at time t


1. Create weights using the nearest neighbors
Create weights using the nearest neighbors


1. Estimate Y using the weights; (this estimate is called $\displaystyle{ Y }$ | $\displaystyle{ M_X }$ )
Estimate Y using the weights; (this estimate is called $\displaystyle{ Y }$ | $\displaystyle{ M_X }$ )


1. Compute the correlation between $\displaystyle{ Y }$ and $\displaystyle{ Y }$ | $\displaystyle{ M_X }$
Compute the correlation between $\displaystyle{ Y }$ and $\displaystyle{ Y }$ | $\displaystyle{ M_X }$


CCM算法步骤：

M: 嵌入在 e 维状态空间(d ≤ e)中的 d 维流形

{x}: M投影于x上产生的序列

{y}: M投影于y上产生的序列

L: 时间序列长度

E: 重构流形的维度

𝜏: 采样间隔

## VS Granger causality test

CCM is not in competition with the many effective methods that use GC; rather, it is specifically aimed at a class of system not covered by GC

CCM不是和格兰杰因果检验竞争，而是针对格兰杰检验不包含的一类系统。如：含有弱耦合、中等耦合强度的系统、不可分离变量的系统、含有共同驱动变量影响的系统