Skip to content

Analyses

An analysis is a function of a source: a system, a trajectory, or measured data. It returns a frozen result. Each analysis reads one kind of data, such as a series, a field, or a network, and may need a capability tag of the system behind the source, such as a deterministic randomness for Lyapunov exponents. The analysis checks the tags of the system, or of the system behind a trajectory, before it does any work, and raises a TagError that names the tag it lacks. Measured data carries no tags, so only its kind is checked. The table lists what every analysis needs, and the kinds of an analysis whose needs differ from its own.

Analysis Data Time Space Randomness Kinds that differ
alignment agents any any any none
applicable_analyses any source any any any none
autocatalytic_sets network any any any none
automaton system any any any none
cell_complex field any any any none
chain_shape agents any any any none
clusters field any any any none
coarse_grain agents any any any none
complexity series any any any none
correlation field any any any auto: data series
two-time: data ensemble
data_collapse ensemble any any any none
defects field any any any none
displacement agents any any any none
distribution series any any any records: data ensemble
domains field any any any none
elementary_modes series any any any none
embedding series any any any none
emergence series any any any causal: data path
effective-information: data path
entropy series any any any ensemble: data ensemble
epsilon_machine series any any any none
ergodicity series any any any breaking: data ensemble
distance: data ensemble
metric: data ensemble
events series any any any counts: data path
fit_law series any any any none
information series any any any none
invariants system any any any none
irreversibility path any any any fluctuation-dissipation: data ensemble
fluctuation-theorem: data ensemble
langevin-entropy-production: data ensemble
response: data ensemble
uncertainty-relation: data ensemble
kramers_moyal series any any any none
large_deviations path any any any block: data series
histogram: data ensemble
reweight: data ensemble
linearization system any any any none
local_information series any any any none
loops system any any any none
lyapunov system any any deterministic largest: data series
markov path any any any none
mode_decomposition series any any any none
motifs network any network any none
neighbors agents any any any like-share: data field
network_measures network any network any none
operator_measures system any any any none
partial_information series any any any none
passage path any any any return-times: data series
recurrence series any any any none
renormalization network any network any none
reservoir series any any any none
rolling series any any any none
scaling series any any any box-counting: data field
power: data ensemble
variance-mean: data field
section system continuous any any none
signatures system any any any none
sparse_identification series any any any none
spectrum field any any any power: data series
stability system any any any none
surrogate_test series any any any none
symbolic system any any any none

A compatible analysis

The logistic map at r=4 is deterministic, so lyapunov measures its largest exponent, close to log 2.

from skcomplex.core.analysis import lyapunov
from skcomplex.systems.mathematics.dynamical_systems import LogisticMapSystem

system = LogisticMapSystem(r=4.0)
system.get_tags().randomness
round(float(lyapunov(system, until=20000).exponents[0]), 2)
deterministic
0.69

An incompatible analysis

The stochastic SIR epidemic has random events, so nearby runs do not separate at a rate of their own. lyapunov rejects it and names the randomness it needs.

from skcomplex.core.analysis import lyapunov
from skcomplex.core.errors import TagError
from skcomplex.systems.biology.epidemiology import SIRSystem

system = SIRSystem(stochastic=True)
system.get_tags().randomness
try:
    lyapunov(system)
except TagError as error:
    message = str(error)
message
assert 'randomness deterministic' in message
stochastic
lyapunov of kind 'spectrum' needs the randomness deterministic, but the system has the randomness stochastic.

A network measure needs a system on a network. A trajectory of the SIR epidemic carries the tags of its system, whose space is none.

from skcomplex.core.analysis import network_measures
from skcomplex.core.engine.runtime import simulate
from skcomplex.core.errors import TagError
from skcomplex.systems.biology.epidemiology import SIRSystem

trajectory = simulate(SIRSystem(), until=10)
try:
    network_measures(trajectory)
except TagError as error:
    message = str(error)
message
assert 'space network' in message
network_measures of kind 'summary' needs the space network, but the system has the space none.