fuzzyclust.timeseries.correlation_dimension#

fuzzyclust.timeseries.correlation_dimension(Y, radii=None, n_radii=10, max_pairs=200000, random_state=None)[source]#

Grassberger–Procaccia correlation dimension of a point cloud (e.g. delay vectors).

The correlation sum \(C(r)=\frac{2}{N(N-1)}\sum_{k<l}\Theta(r-\|\mathbf{y}_k-\mathbf{y}_l\|)\) scales as \(r^{D_2}\) for small \(r\); \(D_2\) is the slope of \(\log C(r)\) against \(\log r\), fitted here by least squares over the radii where \(0<C(r)<1\). Pairwise distances are computed for a random subset of at most max_pairs pairs. The estimate is a fractal (non-integer) counterpart of the integer local dimension of select_embedding_dimension(); the fuzzy Sammon paper uses it to confirm the clustering-based estimate.

Parameters:
Yarray_like of shape (n_samples, dim)
radiiarray_like, optional

Radii \(r\); default: n_radii values log-spaced between the 0.5th and the 10th percentile of the sampled distances (the scaling region must be small compared with the extent of the set).

n_radiiint, default=10
max_pairsint, default=200000
random_stateint, RandomState instance or None
Returns:
resultsklearn.utils.Bunch

dimension (the slope \(D_2\)), radii, correlation_sum.

References

[1]

P. Grassberger, I. Procaccia, “Measuring the strangeness of strange attractors”, Physica D 9 (1983) 189–208.

Examples

>>> import numpy as np
>>> from fuzzyclust.timeseries import correlation_dimension
>>> rng = np.random.RandomState(0)
>>> plane = np.c_[rng.rand(2000, 2), np.zeros(2000)]  # a flat 2-D set in 3-D
>>> bool(1.8 < correlation_dimension(plane, random_state=0).dimension < 2.2)
True

Examples using fuzzyclust.timeseries.correlation_dimension#

State-space reconstruction and prediction of a chaotic time series

State-space reconstruction and prediction of a chaotic time series