Skip to content

Estimate the acceptable minimum embedding dimension

kosh edited this page Feb 27, 2022 · 8 revisions

Estimate the acceptable minimum embedding dimension.

est_dimension_w_fnn

dev

Estimate the acceptable minimum embedding dimension using False Nearest Neighbors Algorithm [Kennel_1992].

Select xk appropriately from the embedded data with dimension d, find the closest tangent vector xn, and set the distance to Rkn. It is embedded from 1 to D_max. Calculate the closest distance for all data. The points that satisfy the following two conditions are counted. Atol (threshold_A) and Rtol (threshold_R) are thresholds.

\Biggl( \frac{R_{d+1}^2(k, n)-R_d^2(k, n)}{R_d^2(k, n)} \Biggr)^\frac{1}{2}>R_{tol}

\frac{R_{d+1}(k, n)}{R_A}>A_{tol}

RA is the standard deviation obtained from the time series.
Let the acceptable minimum embedding dimension be the first dimension below 1% (threshold_percent) in the percentages obtained for each embedded dimension.

By default, the actual calculation result is displayed. The point actually adopted is red. If you want to turn off the display, give plot=False.

It is necessary to set the threshold appropriately, and it is difficult to adapt to unknown data. Different value of Rtol and Atol may lead to different result (dimension). AFF Algorithm (est_dimension_w_afn) is devised.

from hundun.exploration import est_dimension_w_fnn

Parameters

  • u_seq
  • T
  • D_max=10
  • threshold_R=10
  • threshold_A=2
  • threshold_percent=1
  • plot=True
  • path_save_plot=None

Returns

  • dimension
  • percentages: numpy.ndarray

Example

Estimate the acceptable minimum embedding dimension for x in the Lorenz time series.

from hundun.equations import Lorenz
from hundun.exploration import est_dimension_w_fnn


x_seq = Lorenz.get_u_seq(25000)[::5, 0]
D, percentages = est_dimension_w_fnn(x_seq, T=10)
print(D)
3

img:est_dimension_w_fnn

Reference

Determining embedding dimension for phase-space reconstruction using a geometrical construction

(1992) Matthew B. Kennel, Reggie Brown, and Henry D. I. Abarbanel
DOI: 10.1103/PhysRevA.45.3403

The analysis of observed chaotic data in physical systems

(1993) Abarbanel, Henry D. I. and Brown, Reggie and Sidorowich, John J. and Tsimring, Lev Sh
DOI: 10.1103/RevModPhys.65.1331

est_dimension_w_afn

dev

Estimate the acceptable minimum embedding dimension using Averaged False Neighbors Algorithm [Cao_1997].

Calculate the distance Rkn in the same way as FNN. However, it uses maximum norm instead of Euclidean distance.
Estimate the acceptable minimum embedding dimensions with reference to E1 and E2 obtained by calculation.
The first value at which E1 and E2 each exceed the threshold (threshold_E1=0.9, threshold_E2=1) is retrieved as the dimension.

from hundun.exploration import est_dimension_w_afn

Parameters

  • u_seq
  • T
  • D_max=10
  • threshold_E1=0.9
  • threshold_E2=1
  • plot=True
  • path_save_plot=None

Returns

  • dimension_list: List[int]
  • E_list: List[numpy.ndarray]

Example

from hundun.equations import Lorenz
from hundun.exploration import est_dimension_w_afn
import numpy as np


x_seq = Lorenz.get_u_seq(25000)[::5, 0]
D_list, E_list = est_dimension_w_afn(x_seq, T=1)
print(D_list)
[4, 3]

img:est_dimension_w_afn

Reference

Practical method for determining the minimum embedding dimension of a scalar time series

(1997) Liangyue Cao
DOI: 10.1016/S0167-2789(97)00118-8

est_dimension_w_wayland

dev

Estimate the dimension based on Wayland Algorithm Wayland_1993.

Find K (K) closest tangent vectors for xt0 at a given time t0. These vectors are represented as xti irange. Using the vector after the tau (tau) step elapses, v is defined as follows.

\mathbf{v}(t_i)=\mathbf{x}(t_i+\tau T) - \mathbf{x}(t_i)

Calculate the variance of v with the following equation.

E_{trans}=\frac{1}{K+1}\sum_{i=0}^{K}\frac{|\mathbf{v}(t_i)-\bar{\mathbf{v}}|}{|\bar{\mathbf{v}}|}

\mathbf{\bar{v}}=\frac{1}{K+1}\sum_{i=0}^{K}\mathbf{v}(t_i)

Randomly calculate Etrans from M=51 xt0 to find the median. Do this Q=10 times.
medianE is calculated in each embedded dimension and the minimum value is adopted as the dimension.

from hundun.exploration import est_dimension_w_afn

Parameters

  • u_seq
  • T
  • D_max=10
  • tau=5
  • K=4
  • Q=10
  • M=51
  • reshape=True
  • plot=True
  • path_save_plot=None

Returns

  • D
  • median_e_trans_ave

Example

from hundun.equations import Lorenz
from hundun.exploration import est_dimension_w_wayland


x_seq = Lorenz.get_u_seq(25000)[::5, 0]
D, median_e_trans_ave = est_dimension_w_wayland(x_seq, T=1)
print(D)
3

img:est_dimension_w_wayland

Reference

Recognizing determinism in a time series

(1993) Wayland, Richard and Bromley, David and Pickett, Douglas and Passamante, Anthony
DOI: 10.1103/PhysRevLett.70.580

fnn

It will not be available after version 0.2. Use est_dimension_w_fnn instead.

afn

It will not be available after version 0.2. Use est_dimension_w_afn instead.

Clone this wiki locally