# 收敛交叉映射算法

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.[1][2] 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[3] and used in a series of statistical approaches (see for example,[4][5][6]). It was then further elaborated in 2012 by the lab of George Sugihara of the Scripps Institution of Oceanography.[7]

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[8]

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

## References

1. Sugihara, George; et al. (26 October 2012). "Detecting Causality in Complex Ecosystems" (PDF). Science. 338 (6106): 496–500. Bibcode:2012Sci...338..496S. doi:10.1126/science.1227079. PMID 22997134. Retrieved 5 July 2013.
2. "Cause test could end up in court". New Scientist. 28 September 2012. Opinion. Retrieved 5 July 2013.
3. Čenys, A.; Lasiene, G.; Pyragas, K. (1991). "Estimation of interrelation between chaotic observables". Physica D: Nonlinear Phenomena. Elsevier BV. 52 (2–3): 332–337. doi:10.1016/0167-2789(91)90130-2. ISSN 0167-2789.
4. Schiff, Steven J.; So, Paul; Chang, Taeun; Burke, Robert E.; Sauer, Tim (1996-12-01). "Detecting dynamical interdependence and generalized synchrony through mutual prediction in a neural ensemble". Physical Review E. American Physical Society (APS). 54 (6): 6708–6724. doi:10.1103/physreve.54.6708. ISSN 1063-651X.
5. Arnhold, J.; Grassberger, P.; Lehnertz, K.; Elger, C.E. (1999). "A robust method for detecting interdependences: application to intracranially recorded EEG". Physica D: Nonlinear Phenomena. Elsevier BV. 134 (4): 419–430. doi:10.1016/s0167-2789(99)00140-2. ISSN 0167-2789.
6. Chicharro, Daniel; Andrzejak, Ralph G. (2009-08-27). "Reliable detection of directional couplings using rank statistics". Physical Review E. American Physical Society (APS). 80 (2): 026217. doi:10.1103/physreve.80.026217. hdl:10230/16204. ISSN 1539-3755.
7. Michael Marshall in New Scientist magazine 2884: Causality test could help preserve the natural world, 28 September 2012
8. McCracken, James (2014). "Convergent cross-mapping and pairwise asymmetric inference". Physical Review E. 90 (6): 062903. arXiv:1407.5696. Bibcode:2014PhRvE..90f2903M. doi:10.1103/PhysRevE.90.062903. PMID 25615160.