time_cluster¶
- time_cluster(act: Any, perm: Any, p_val: float = None, tails: int = 1, ignore: tuple | int = None) ndarray[bool][source][source]¶
Cluster correction for time series data.
- Creates an index of all the binary clusters in the active and permuted
passive data.
- For each permutation in the passive data, determine the maximum cluster
size.
- For each cluster in the active data, determine the proportion of
permutations that have a cluster of the same size or larger.
- Parameters:
- Returns:
clusters – The clusters.
- Return type:
array,shape (...,time)
Examples
>>> import numpy as np >>> perm = np.array([[0, 1, 1, 1, 0, 1, 0, 0], ... [0, 1, 0, 1, 1, 1, 0, 0], ... [0, 1, 1, 0, 1, 1, 0, 0], ... [0, 0, 1, 1, 1, 0, 0, 0]]) >>> time_cluster(np.array([0, 1, 1, 1, 1, 1, 0, 0]), perm) array([0. , 0.75, 0.75, 0.75, 0.75, 0.75, 0. , 0. ]) >>> time_cluster(np.array([0, 0, 1, 1, 1, 0, 0, 0]), perm) array([0. , 0. , 0.25, 0.25, 0.25, 0. , 0. , 0. ])