apollon.fractal module¶
apollon/fractal.py
Tools for estimating fractal dimensions.
- Function:
lorenz_attractor Simulate Lorenz system.
-
apollon.fractal.
delay_embedding
(inp: numpy.ndarray, delay: int, m_dim: int) → numpy.ndarray¶ Compute a delay embedding of the inp.
This method makes a hard cut at the upper bound of inp and does not perform zero padding to match the input size.
- Params:
inp: One-dimensional input vector. delay: Vector delay in samples. m_dim: Number of embedding dimension.
- Returns
Two-dimensional delay embedding array in which the nth row represents the n * delay samples delayed vector.
-
apollon.fractal.
embedding_dists
(inp: numpy.ndarray, delay: int, m_dim: int, metric: str = 'euclidean') → numpy.ndarray¶ Perfom a delay embedding and return the pairwaise distances of the delayed vectors.
The returned vector is the flattend upper triangle of the distance matrix.
- Params:
inp: One-dimensional input vector. delay: Vector delay in samples. m_dim Number of embedding dimension. metric: Metric to use.
- Returns
Flattened upper triangle of the distance matrix.
-
apollon.fractal.
embedding_entropy
(emb: numpy.ndarray, n_bins: int) → numpy.ndarray¶ Compute the information entropy from an embedding.
- Params:
emb: Input embedding. bins: Number of bins per dimension.
- Returns
Entropy of the embedding.
-
apollon.fractal.
log_histogram_bin_edges
(dists, n_bins: int, default: Optional[float] = None)¶ Compute histogram bin edges that are equidistant in log space.
-
apollon.fractal.
lorenz_attractor
(n, sigma=10, rho=28, beta=2.6666666666666665, init_xyz=(0.0, 1.0, 1.05), dt=0.01)¶ Simulate a Lorenz system with given parameters.
- Params:
n (int) Number of data points to generate. sigma (float) System parameter. rho (rho) System parameter. beta (beta) System parameter. init_xyz (tuple) Initial System state. dt (float) Step size.
- Returns
xyz (array) System states.