# Correlation Dimension

The correlation dimension can be calculated using the Grassberger-Procaccia algorithm . This involves calculation of the correlation sum defined as

$C_m\left( r \right) = \mathop {\lim }\limits_{N \to \infty } \frac{2}{{N\left( {N – 1} \right)}}\sum\limits_{i = 1}^N {\sum\limits_{j = i + 1}^N {\Theta \left( {r – \left\| {y_i – y_j } \right\|} \right)} }$   (1)

where $|| y_i – y_j ||$ is the distance between pairs of points in the phase space and $\Theta(x)$  is the Heaviside function: $\Theta = 1$ if $x \geq 0$ and $\Theta = 0$ if $x \leq 0$.  The value $r$ is the radius of a hypersphere in an $m$-dimensional space, and $N$ is the number of points in the space.

In theory the density of the points will scale as a power law with the radius

$\mathop {\lim }\limits_{r \to 0} \mathop {\lim }\limits_{N \to \infty } C_m\left( r \right) = r^D$   (2)

The correlation dimension is then given by

$D = \mathop {\lim }\limits_{r \to 0} \mathop {\lim }\limits_{N \to \infty } \frac{{\log C_m\left( {r} \right)}}{{\log r }}$   (3)

So the gradient of a graph of ${\log C_m\left({r} \right)}$ versus $\log r$ should approach a finite value $D$ in the limit as $r \rightarrow 0$. For data that has finite sampling, the slope of this graph for very small $r$ is very inaccurate so instead a ‘scaling’ region of $r$ is taken over which the slope is relatively stable. A plot of the gradient, $D_m (r) = \partial \log C_m (r) / \partial \log (r)$, as a function of $r$ makes observing this region much clearer. The value of the slope $D_m (r)$ within the scaling region is the correlation dimension.

A great free program for efficient calculation of this measure is the TISEAN package . It contains a range of other very useful tools for time series analysis.

References

 P. Grassberger, and I. Procaccia, “Measuring the strangeness of strange attractors”, Physica D 9, 189-208 (1983).
 R. Hegger, H. Kantz and T. Schreiber, “Practical implementation of nonlinear time series methods: The TISEAN package”, CHAOS 9, 413 (1999).