Continuous Ordinal Patterns#
The Continuous Ordinal Patterns (COP) connectivity metric analyzes the patterns in time series data to detect relationships.
import delaynet as dn
# Calculate COP connectivity
result = dn.connectivity(
ts1, ts2, metric="random_patterns", p_size=5, num_rnd_patterns=50, lag_steps=5
)
Parameters:
p_size: Size of the ordinal pattern.num_rnd_patterns: Number of random patterns to consider.lag_steps: Time lags to consider. An integer will consider lags [1, …, lag_steps]. Passing a list will consider the specified values as lags.linear: Whether to start with the identity pattern. Default is True.
- continuous_ordinal_patterns.random_patterns(ts2, p_size=5, num_rnd_patterns=50, linear=True, lag_steps: int | list = None)
Continuous Ordinal Patterns (COP) connectivity metric [OMarinRodriguezAZ25, Zan23].
- Parameters:
ts1 (numpy.ndarray) – First time series.
ts2 (numpy.ndarray) – Second time series.
p_size (int) – Size of the ordinal pattern.
num_rnd_patterns (int) – Number of random patterns to consider.
linear (bool) – Start with the identity pattern.
lag_steps (int | list) – Time lags to consider. Can be a single integer or a list of integers. An integer will consider lags [1, …, lag_steps]. A list will consider the specified values as lags.
- Returns:
Best p-value and corresponding lag.
- Return type: